git.iko.soy/typeable/pandoc
on master help sign in
Use stack for Windows installer.
commit87f20f11e220241ced3ba8a32d8d9867d2baebd9 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 14 Nov 2015, 22:23 (11 years ago) parent2725ad3
3 files changed+34−23
windows/make-windows-installer.bat+9−17 windows/pandoc.wxs+6−6 windows/stack.yaml+19
windows/make-windows-installer.bat+9−17
@@ -1,22 +1,15 @@
11@echo off
2−cd ..
3−cabal update
4−cabal sandbox init
5−cabal clean
6−cabal install hsb2hs
2+stack install --test
73if %errorlevel% neq 0 exit /b %errorlevel%
8−cabal install -v1 --force --enable-tests --reinstall --flags="embed_data_files" . pandoc-citeproc
4+for /f "delims=" %%a in ('stack path --local-bin-path') do @set BINPATH=%%a
5+strip %BINPATH%\pandoc.exe
6+strip %BINPATH%\pandoc-citeproc.exe
7+%BINPATH%\pandoc.exe -s -S ..\README -o README.html
98if %errorlevel% neq 0 exit /b %errorlevel%
10−cabal test
9+%BINPATH%\pandoc.exe -s ..\COPYING -t rtf -S -o COPYING.rtf
1110if %errorlevel% neq 0 exit /b %errorlevel%
12−strip .\.cabal-sandbox\bin\pandoc.exe
13−strip .\.cabal-sandbox\bin\pandoc-citeproc.exe
14−.\.cabal-sandbox\bin\pandoc.exe -s --template data\templates\default.html -S README -o README.html
15−if %errorlevel% neq 0 exit /b %errorlevel%
16−.\.cabal-sandbox\bin\pandoc.exe -s --template data\templates\default.rtf COPYING -t rtf -S -o COPYING.rtf
17−if %errorlevel% neq 0 exit /b %errorlevel%
18−copy COPYRIGHT COPYRIGHT.txt
19−for /f "tokens=1-2 delims= " %%a in ('.\.cabal-sandbox\bin\pandoc --version') do (
11+copy ..\COPYRIGHT COPYRIGHT.txt
12+for /f "tokens=1-2 delims= " %%a in ('%BINPATH%\pandoc.exe --version') do (
2013 @set VERSION=%%b
2114 goto :next
2215 )
@@ -26,9 +19,8 @@ if "%VERSION%" == "" (
2619 exit /b 1
2720)
2821echo Detected version %VERSION%
29−cd windows
3022echo Creating msi...
31−candle -dVERSION=%VERSION% pandoc.wxs
23+candle -dVERSION=%VERSION% -dBINPATH=%BINPATH% pandoc.wxs
3224if %errorlevel% neq 0 exit /b %errorlevel%
3325light -sw1076 -ext WixUIExtension -ext WixUtilExtension -out pandoc-%VERSION%-windows.msi pandoc.wixobj
3426if %errorlevel% neq 0 exit /b %errorlevel%
windows/pandoc.wxs+6−6
@@ -41,11 +41,11 @@
4141 KeyPath="yes"/>
4242 <RemoveFolder Id="APPLICATIONFOLDER" On="uninstall"/>
4343 <File Id="pandocEXE" Name="pandoc.exe"
44− Source="..\.cabal-sandbox\bin\pandoc.exe" />
44+ Source="$(var.BINPATH)\pandoc.exe" />
4545 <File Id="pandocCOPYRIGHT" Name="COPYRIGHT.txt"
46− Source="..\COPYRIGHT.txt" />
46+ Source="COPYRIGHT.txt" />
4747 <File Id="pandocCOPYING" Name="COPYING.rtf"
48− Source="..\COPYING.rtf" />
48+ Source="COPYING.rtf" />
4949 </Component>
5050
5151 <Component Id="CitationSupport"
@@ -55,13 +55,13 @@
5555 Name="Version" Type="string" Value="[ProductVersion]"
5656 KeyPath="yes"/>
5757 <File Id="pandoc_citeprocEXE" Name="pandoc-citeproc.exe"
58− Source="..\.cabal-sandbox\bin\pandoc-citeproc.exe" />
58+ Source="$(var.BINPATH)\pandoc-citeproc.exe" />
5959 </Component>
6060
6161 <Component Id="Documentation"
6262 Guid="A8D54A76-1A3D-4647-8327-81B69D39D8A3">
6363 <File Id="pandocREADME" Name="Pandoc User's Guide.html"
64− Source="..\README.html" KeyPath="yes">
64+ Source="README.html" KeyPath="yes">
6565 <Shortcut Id="ApplicationStartMenuShortcut"
6666 Directory="ApplicationProgramsFolder"
6767 Name="Pandoc User’s Guide" Advertise="yes" />
@@ -163,7 +163,7 @@
163163 <Property Id="ALLUSERS" Value="2" Secure="yes" />
164164 <Property Id="MSIINSTALLPERUSER" Value="1" />
165165
166− <WixVariable Id="WixUILicenseRtf" Value="..\COPYING.rtf" />
166+ <WixVariable Id="WixUILicenseRtf" Value="COPYING.rtf" />
167167
168168 <UI Id="MyWixUI_Advanced">
169169 <UIRef Id="WixUI_Advanced" />
windows/stack.yamlnew file+19
@@ -0,0 +1,19 @@
1+flags:
2+ pandoc:
3+ trypandoc: false
4+ https: true
5+ embed_data_files: true
6+ old-locale: false
7+ network-uri: true
8+ pandoc-citeproc:
9+ bibutils: true
10+ embed_data_files: true
11+ unicode_collation: false
12+ test_citeproc: false
13+ debug: false
14+packages:
15+- '..'
16+- '../../pandoc-citeproc'
17+extra-deps:
18+- 'hsb2hs-0.3.1'
19+resolver: lts-3.13