git.iko.soy/typeable/pandoc
on master help sign in
Windows installer improvements.

* Handle upgrades better: the old version will be removed automatically. * Detect version in batch file, so pandoc.wxs need not be modified when the version number changes. * Create pandoc-VERSION.msi.

commitf4429e4de62622f644a98c186ccd47535dd59690 authorJohn MacFarlane <fiddlosopher@gmail.com> dateSun 10 Feb 2013, 16:25 (14 years ago) parent038af8a
2 files changed+27−6
windows/make-windows-installer.bat+13−2 windows/pandoc.wxs+14−4
windows/make-windows-installer.bat+13−2
@@ -12,10 +12,21 @@ if %errorlevel% neq 0 exit /b %errorlevel%
1212cabal-dev\bin\pandoc.exe -s --template data\templates\default.rtf COPYING -t rtf -S -o COPYING.rtf
1313if %errorlevel% neq 0 exit /b %errorlevel%
1414copy COPYRIGHT COPYRIGHT.txt
15+for /f "tokens=1-2 delims= " %%a in ('cabal-dev\bin\pandoc --version') do (
16+ @set VERSION=%%b
17+ goto :next
18+ )
19+:next
20+if "%VERSION%" == "" (
21+ echo Error: could not determine version number.
22+ exit /b 1
23+)
24+echo Detected version %VERSION%
1525cd windows
1626echo Creating msi...
17−"C:\Program Files\WiX Toolset v3.7\bin\candle.exe" -ext WixUIExtension pandoc.wxs
27+"C:\Program Files\WiX Toolset v3.7\bin\candle.exe" -dVERSION=%VERSION% -ext WixUIExtension pandoc.wxs
1828if %errorlevel% neq 0 exit /b %errorlevel%
19−"C:\Program Files\WiX Toolset v3.7\bin\light.exe" -ext WixUIExtension pandoc.wixobj
29+"C:\Program Files\WiX Toolset v3.7\bin\light.exe" -ext WixUIExtension -out pandoc-%VERSION%.msi pandoc.wixobj
2030if %errorlevel% neq 0 exit /b %errorlevel%
31+echo Starting kSign: sign, then quit kSign to complete the build...
2132"C:\Program Files\kSign\kSign.exe"
windows/pandoc.wxs+14−4
@@ -1,12 +1,22 @@
11<?xml version="1.0"?>
22<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3− <Product Id="37DB5E26-BDA9-4166-AFD7-E23DA4B75755"
4− UpgradeCode="A68E8EF6-ABB1-4F22-A3C5-68DFDF0AB562" Name="Pandoc 1.10"
5− Version="1.10.2.1" Manufacturer="John MacFarlane"
3+ <Product Id="*"
4+ UpgradeCode="A68E8EF6-ABB1-4F22-A3C5-68DFDF0AB562" Name="Pandoc $(var.VERSION)"
5+ Version="$(var.VERSION)" Manufacturer="John MacFarlane"
66 Language="1033">
77 <Package InstallerVersion="200" Compressed="yes"
88 Comments="Windows Installer Package" />
99 <Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
10+ <Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
11+ <Upgrade Id="A68E8EF6-ABB1-4F22-A3C5-68DFDF0AB562">
12+ <UpgradeVersion
13+ Minimum="0.46.0.0" Maximum="$(var.VERSION)"
14+ Property="PREVIOUSVERSIONSINSTALLED"
15+ IncludeMinimum="yes" IncludeMaximum="no" />
16+ </Upgrade>
17+ <InstallExecuteSequence>
18+ <RemoveExistingProducts After="InstallFinalize"/>
19+ </InstallExecuteSequence>
1020 <Directory Id="TARGETDIR" Name="SourceDir">
1121 <Directory Id="DesktopFolder" Name="Desktop" />
1222 <Directory Id="ProgramMenuFolder">
@@ -44,7 +54,7 @@
4454 <RegistryValue Root="HKCU" Key="Software\John MacFarlane\Pandoc" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
4555 </Component>
4656 </DirectoryRef>
47− <Feature Id="Complete" Level="1" Title="Pandoc 1.10" Description="Complete package" Display="expand" ConfigurableDirectory="INSTALLDIR">
57+ <Feature Id="Complete" Level="1" Title="Pandoc $(var.VERSION)" Description="Complete package" Display="expand" ConfigurableDirectory="INSTALLDIR">
4858 <Feature Id="MainProgram" Title="Program" Description="The main executable." Level="1">
4959 <ComponentRef Id="MainExecutable" />
5060 </Feature>