diff --git a/INSTALL.md b/INSTALL.md index ba35169a7..9c9395a77 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -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 @@ -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_` in your copy. ### Build @@ -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, @@ -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. diff --git a/appveyor.after_build.bat b/appveyor.after_build.bat deleted file mode 100644 index f01158562..000000000 --- a/appveyor.after_build.bat +++ /dev/null @@ -1,10 +0,0 @@ -setlocal - -"C:\Program Files (x86)\NSIS\makensis.exe" output\install.nsi -if %ERRORLEVEL% NEQ 0 goto ERROR - -:ERROR -set EXITCODE=%ERRORLEVEL% - -:EXIT -exit /b %EXITCODE% diff --git a/appveyor.yml b/appveyor.yml index 8d681185c..82e603ab4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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 diff --git a/build.bat b/build.bat index 7e75c2b4e..9de45bba4 100644 --- a/build.bat +++ b/build.bat @@ -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 @@ -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 @@ -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