Skip to content

Commit

Permalink
feat(build.bat): build installer
Browse files Browse the repository at this point in the history
  • Loading branch information
lotem committed Apr 15, 2018
1 parent b6a002c commit e18117b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 24 deletions.
15 changes: 5 additions & 10 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Download third-party libraries: `boost(>=1.60.0)`

Optional:
install `bash` (available via Git for Windows) for installing data files from `plum`;
install `python` for building OpenCC dictionaries.
install `python` for building OpenCC dictionaries;
install [NSIS](http://nsis.sourceforge.net/Download) for creating installer.

## Checkout source code

Expand All @@ -35,7 +36,7 @@ set BOOST_ROOT=X:\path\to\boost_N_NN_N

Alternatively, save your build environment settings in `env.bat`.
You can create the file by copying `env.bat.template` and make modifications.
Make sure `BOOST_ROOT` is set to existing `X:\path\to\boost_N_NN_N` in your copy.
Make sure `BOOST_ROOT` is set to existing `X:\path\to\boost_<version_number>` in your copy.

### Build

Expand All @@ -46,6 +47,8 @@ build.bat all

Voila.

Installer will be generated in `output\archives` directory.

### Alternative: using prebuilt Rime binaries

If you've already got a copy of prebuilt binaries of librime,
Expand Down Expand Up @@ -76,11 +79,3 @@ copy /Y build\lib\Release\rime.dll build\bin\
cd build\bin
echo zhongzhouyunshurufa | Release\rime_api_console.exe > output.txt
```

### Create installer packages

To create installer packages, you need to download and install [Unicode NSIS] (https://github.com/jimpark/unsis/releases).

Then go to `output` directory, right-click and choose "Compile Unicode NSIS Script" with `install.nsi`.

Installers will be generated in `output\archives` directory.
10 changes: 0 additions & 10 deletions appveyor.after_build.bat

This file was deleted.

5 changes: 1 addition & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ install:
- .\appveyor.install.bat

build_script:
- .\build.bat data hant

after_build:
- appveyor.after_build.bat
- .\build.bat data hant installer

artifacts:
- path: output\archives\weasel-0.11.0.0-installer.exe
Expand Down
9 changes: 9 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ set build_boost=0
set build_data=0
set build_hant=0
set build_rime=0
set build_installer=0
set build_x64=1

:parse_cmdline_options
Expand All @@ -43,11 +44,13 @@ if "%1" == "data" set build_data=1
if "%1" == "hant" set build_hant=1
if "%1" == "rime" set build_rime=1
if "%1" == "librime" set build_rime=1
if "%1" == "installer" set build_installer=1
if "%1" == "all" (
set build_boost=1
set build_data=1
set build_hant=1
set build_rime=1
set build_installer=1
)
if "%1" == "nox64" set build_x64=0
shift
Expand Down Expand Up @@ -108,6 +111,12 @@ if %build_x64% == 1 (
)
msbuild.exe weasel.sln %build_option% /p:Configuration=Release /p:Platform="Win32" /fl1
if errorlevel 1 goto error

if %build_installer% == 1 (
"%ProgramFiles(x86)%"\NSIS\Bin\makensis.exe output\install.nsi
if errorlevel 1 goto error
)

goto end

:build_boost
Expand Down

0 comments on commit e18117b

Please sign in to comment.