git.iko.soy/typeable/pandoc
on master help sign in
Improved Windows installer (nkalvi, #2708, #2389).

* Scope selection in the first screen. Since I couldn't detect if the user is 'real' admin user, default is still per user. * Scope is limited to per machine on servers. Though not perfect (couldn't detect `DisableMSI` policy), it should handle #2389 better. * For per machine, location can be changed by selecting Advanced. Localization: modified templates from WiX toolkit support localization very well. A short sample localization file for en-us is used. * Dialog elements are moved to their own files.

commit146c7a78e551af2f59c95215833f39be5b6c8a67 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 4 Jun 2016, 11:34 (10 years ago) parent64a0371
5 files changed+299−85
windows/AdvancedWelcomeEulaDlg_Custom.wxs+90 windows/Pandoc-en-us.wxl+14 windows/WixUI_Advanced_Custom.wxs+142 windows/make-windows-installer.bat+2−2 windows/pandoc.wxs+51−83
windows/AdvancedWelcomeEulaDlg_Custom.wxsnew file+90
@@ -0,0 +1,90 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<!--
3+ <copyright file="AdvancedWelcomeEulaDlg.wxs" company="Outercurve Foundation">
4+ Copyright (c) 2004, Outercurve Foundation.
5+ This software is released under Microsoft Reciprocal License (MS-RL).
6+ The license and further copyright text can be found in the file
7+ LICENSE.TXT at the root directory of the distribution.
8+ </copyright>
9+-->
10+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
11+ <Fragment>
12+ <UI>
13+ <Dialog Id="AdvancedWelcomeEulaDlg_Custom" Width="370" Height="270" Title="!(loc.AdvancedWelcomeEulaDlg_Title)">
14+
15+ <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.AdvancedWelcomeEulaDlgBannerBitmap)" />
16+ <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
17+ <Control Id="Title" Type="Text" X="20" Y="10" Width="300" Height="24" Transparent="yes" NoPrefix="yes" Text="!(loc.AdvancedWelcomeEulaDlgTitle)" />
18+
19+ <Control Id="LicenseAcceptedCheckBox" Type="CheckBox" X="20" Y="140" Width="226" Height="19" CheckBoxValue="1" Property="LicenseAccepted" Text="!(loc.WelcomeEulaDlgLicenseAcceptedCheckBox)" />
20+
21+ <Control Id="ScopeGroupBox" Type="GroupBox" X="20" Y="155" Height="70" Width="330" />
22+
23+ <Control Id="AllUsersCheckBox" Type="CheckBox" X="88" Y="200" Width="226" Height="18" CheckBoxValue="1" Property="ALLUSERS" Text="!(loc.InstallScopeDlgPerMachine)">
24+ <Condition Action="enable">LicenseAccepted AND (WixUISupportPerUser = 1)</Condition>
25+ <Condition Action="disable">(NOT LicenseAccepted) OR (WixUISupportPerUser = 0)</Condition>
26+ </Control>
27+
28+ <Control Id="PerUserDescription" Type="Text" X="30" Y="167" Width="300" Height="36" NoPrefix="yes" Text="!(loc.InstallScopeDlgPerUserDescription)">
29+ <Condition Action="hide">ALLUSERS</Condition>
30+ <Condition Action="show">NOT (ALLUSERS = 1)</Condition>
31+ <Condition Action="disable">NOT LicenseAccepted</Condition>
32+ <Condition Action="enable">LicenseAccepted</Condition>
33+ </Control>
34+
35+ <Control Id="PerMachineDescription" Type="Text" X="30" Y="167" Width="300" Height="36" Hidden="yes" NoPrefix="yes" Text="!(loc.InstallScopeDlgPerMachineDescription)">
36+ <Condition Action="hide">NOT (ALLUSERS = 1)</Condition>
37+ <Condition Action="show">ALLUSERS = 1</Condition>
38+ <Condition Action="disable">NOT LicenseAccepted</Condition>
39+ <Condition Action="enable">LicenseAccepted</Condition>
40+ </Control>
41+
42+ <Control Id="Print" Type="PushButton" X="88" Y="243" Width="56" Height="17" Text="!(loc.WixUIPrint)">
43+ <Publish Event="DoAction" Value="WixUIPrintEula">1</Publish>
44+ </Control>
45+
46+ <Control Id="Advanced" Type="PushButton" X="156" Y="243" Width="56" Height="17" Text="!(loc.AdvancedWelcomeEulaDlgAdvanced)">
47+ <Condition Action="disable">NOT LicenseAccepted OR NOT (ALLUSERS = 1)</Condition>
48+ <Condition Action="enable">(LicenseAccepted = "1") AND (ALLUSERS = 1)</Condition>
49+ </Control>
50+
51+ <Control Id="Install" Type="PushButton" ElevationShield="yes" X="212" Y="243" Width="80" Height="17" Default="yes" Text="!(loc.AdvancedWelcomeEulaDlgInstall)" Hidden="yes">
52+ <Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>
53+ <Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
54+ <Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
55+ <Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
56+ <Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
57+ <Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
58+ <Condition Action="disable">NOT LicenseAccepted</Condition>
59+ <Condition Action="enable">LicenseAccepted = "1"</Condition>
60+ <Condition Action="show">ALLUSERS = 1</Condition>
61+ <Condition Action="hide">NOT (ALLUSERS = 1)</Condition>
62+ </Control>
63+ <Control Id="InstallNoShield" Type="PushButton" ElevationShield="no" X="212" Y="243" Width="80" Height="17" Default="yes" Text="!(loc.AdvancedWelcomeEulaDlgInstall)" Hidden="yes">
64+ <Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>
65+ <Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
66+ <Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
67+ <Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
68+ <Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
69+ <Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
70+ <Condition Action="disable">NOT LicenseAccepted</Condition>
71+ <Condition Action="enable">LicenseAccepted = "1"</Condition>
72+ <Condition Action="show">NOT (ALLUSERS = 1)</Condition>
73+ <Condition Action="hide">ALLUSERS = 1</Condition>
74+ </Control>
75+
76+ <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
77+ <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
78+ </Control>
79+ <Control Id="LicenseText" Type="ScrollableText" X="20" Y="55" Width="330" Height="80" Sunken="yes" TabSkip="no">
80+ <!--<Text SourceFile="!(wix.WixUILicenseRtf=$(var.licenseRtf))" />-->
81+ <Text SourceFile="!(loc.LicenseRtf)" />
82+ </Control>
83+ </Dialog>
84+ </UI>
85+
86+ <InstallUISequence>
87+ <Show Dialog="AdvancedWelcomeEulaDlg_Custom" Before="ProgressDlg">NOT Installed</Show>
88+ </InstallUISequence>
89+ </Fragment>
90+</Wix>
windows/Pandoc-en-us.wxlnew file+14
@@ -0,0 +1,14 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<WixLocalization Culture="en-us" Codepage="1252" xmlns="http://schemas.microsoft.com/wix/2006/localization">
3+ <String Id="Language">1033</String>
4+ <!-- Supported language and codepage codes can be found here: http://www.tramontana.co.hu/wix/lesson2.php#2.4 -->
5+
6+ <String Id="LicenseRtf" Overridable="yes">COPYING.rtf</String>
7+
8+ <String Id="ExitDialogText">[ProductName] was installed in
9+
10+[APPLICATIONFOLDER].
11+
12+You may need to restart Cmd/Powershell windows before using it.</String>
13+
14+</WixLocalization>
windows/WixUI_Advanced_Custom.wxsnew file+142
@@ -0,0 +1,142 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<?if $(sys.BUILDARCH)=x64?>
3+<?define ProgFilesFolder="ProgramFiles64Folder"?>
4+<?else?>
5+<?define ProgFilesFolder="ProgramFilesFolder"?>
6+<?endif?>
7+<!--
8+ <copyright file="WixUI_Advanced_Custom.wxs" company="Outercurve Foundation">
9+ Copyright (c) 2004, Outercurve Foundation.
10+ This software is released under Microsoft Reciprocal License (MS-RL).
11+ The license and further copyright text can be found in the file
12+ LICENSE.TXT at the root directory of the distribution.
13+ </copyright>
14+-->
15+
16+<!--
17+WixUI_Advanced_Custom offers a two-click install (EULA checkbox and Install button)
18+and offers an Advanced button that lets users choose per-machine or per-user
19+installs, install path, and features.
20+
21+WiX variables used:
22+ - WixUISupportPerMachine
23+ - WixUISupportPerUser
24+
25+Todo:
26+ - Clicking Install doesn't work! - APPLICATIONFOLDER isn't set; need to accept another "incoming" property.
27+ - Replace this dialog set UI fragment with the UI extension.
28+ = This set is still in active development.
29+ = Future releases are likely to be incompatible.
30+ = Future releases are likely to be much easier to use.
31+ = Use at your own risk.
32+
33+-->
34+
35+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
36+ <Fragment>
37+ <WixVariable Id="WixUISupportPerUser" Value="1" Overridable="yes" />
38+ <WixVariable Id="WixUISupportPerMachine" Value="1" Overridable="yes" />
39+
40+ <PropertyRef Id="ApplicationFolderName" />
41+
42+ <CustomAction Id="WixSetDefaultPerUserFolder2" Property="WixPerUserFolder" Value="[LocalAppDataFolder][ApplicationFolderName]" Execute="immediate" />
43+ <CustomAction Id="WixSetDefaultPerMachineFolder2" Property="WixPerMachineFolder" Value="[$(var.ProgFilesFolder)][ApplicationFolderName]" Execute="immediate" />
44+ <CustomAction Id="WixSetPerUserFolder2" Property="APPLICATIONFOLDER" Value="[WixPerUserFolder]" Execute="immediate" />
45+ <CustomAction Id="WixSetPerMachineFolder2" Property="APPLICATIONFOLDER" Value="[WixPerMachineFolder]" Execute="immediate" />
46+
47+ <InstallExecuteSequence>
48+ <Custom Action="WixSetDefaultPerUserFolder2" Before="CostFinalize" />
49+ <Custom Action="WixSetDefaultPerMachineFolder2" After="WixSetDefaultPerUserFolder2" />
50+ <Custom Action="WixSetPerUserFolder2" After="WixSetDefaultPerMachineFolder2">ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))</Custom>
51+ <Custom Action="WixSetPerMachineFolder2" After="WixSetPerUserFolder2">ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS=1 OR (ALLUSERS=2 AND Privileged))</Custom>
52+ </InstallExecuteSequence>
53+ <InstallUISequence>
54+ <Custom Action="WixSetDefaultPerUserFolder2" Before="CostFinalize" />
55+ <Custom Action="WixSetDefaultPerMachineFolder2" After="WixSetDefaultPerUserFolder2" />
56+ <Custom Action="WixSetPerUserFolder2" After="WixSetDefaultPerMachineFolder2">ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))</Custom>
57+ <Custom Action="WixSetPerMachineFolder2" After="WixSetPerUserFolder2">ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS=1 OR (ALLUSERS=2 AND Privileged))</Custom>
58+ </InstallUISequence>
59+
60+ <UI Id="WixUI_Advanced_Custom">
61+ <TextStyle Id="WixUI_Font_Normal" FaceName="!(loc.Advanced_Font_FaceName)" Size="!(loc.Advanced_Font_Normal_Size)" />
62+ <TextStyle Id="WixUI_Font_Bigger" FaceName="!(loc.Advanced_Font_FaceName)" Size="!(loc.Advanced_Font_Bigger_Size)" />
63+ <TextStyle Id="WixUI_Font_Title" FaceName="!(loc.Advanced_Font_FaceName)" Size="!(loc.Advanced_Font_Title_Size)" Bold="yes" />
64+ <TextStyle Id="WixUI_Font_Emphasized" FaceName="!(loc.Advanced_Font_FaceName)" Size="!(loc.Advanced_Font_Emphasized_Size)" Bold="yes" />
65+
66+ <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
67+ <Property Id="WixUI_Mode" Value="Advanced" />
68+
69+ <DialogRef Id="BrowseDlg" />
70+ <DialogRef Id="DiskCostDlg" />
71+ <DialogRef Id="ErrorDlg" />
72+ <DialogRef Id="FatalError" />
73+ <DialogRef Id="FilesInUse" />
74+ <DialogRef Id="MsiRMFilesInUse" />
75+ <DialogRef Id="PrepareDlg" />
76+ <DialogRef Id="ProgressDlg" />
77+ <DialogRef Id="ResumeDlg" />
78+ <DialogRef Id="UserExit" />
79+ <DialogRef Id="WelcomeDlg"/>
80+
81+ <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
82+
83+ <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="1">1</Publish>
84+ <Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="2"><![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
85+
86+ <!--<Publish Dialog="AdvancedWelcomeEulaDlg_Custom" Control="Advanced" Event="NewDialog" Value="InstallScopeDlg" Order="1">!(wix.WixUISupportPerMachine) AND !(wix.WixUISupportPerUser)</Publish>-->
87+ <!--<Publish Dialog="AdvancedWelcomeEulaDlg_Custom" Control="Advanced" Event="NewDialog" Value="FeaturesDlg" Order="2">NOT !(wix.WixUISupportPerMachine)</Publish>-->
88+ <!--<Publish Dialog="AdvancedWelcomeEulaDlg_Custom" Control="Advanced" Event="NewDialog" Value="InstallDirDlg" Order="3">!(wix.WixUISupportPerMachine) AND NOT !(wix.WixUISupportPerUser)</Publish>-->
89+
90+ <Publish Dialog="AdvancedWelcomeEulaDlg_Custom" Control="Advanced" Property="WixAppFolder" Value="WixPerMachineFolder" Order="1">ALLUSERS = 1</Publish>
91+ <Publish Dialog="AdvancedWelcomeEulaDlg_Custom" Control="Advanced" Property="APPLICATIONFOLDER" Value="[$(var.ProgFilesFolder)][ApplicationFolderName]" Order="2">ALLUSERS = 1</Publish>
92+ <Publish Dialog="AdvancedWelcomeEulaDlg_Custom" Control="Advanced" Event="NewDialog" Value="InstallDirDlg" Order="3">!(wix.WixUISupportPerMachine) AND !(wix.WixUISupportPerUser)</Publish>
93+
94+ <Publish Dialog="AdvancedWelcomeEulaDlg_Custom" Control="AllUsersCheckBox" Property="WixAppFolder" Value="WixPerMachineFolder" Order="1">ALLUSERS = 1</Publish>
95+ <Publish Dialog="AdvancedWelcomeEulaDlg_Custom" Control="AllUsersCheckBox" Property="APPLICATIONFOLDER" Value="[$(var.ProgFilesFolder)][ApplicationFolderName]" Order="2">ALLUSERS = 1</Publish>
96+
97+ <Publish Dialog="AdvancedWelcomeEulaDlg_Custom" Control="AllUsersCheckBox" Property="WixAppFolder" Value="WixPerUserFolder" Order="1">NOT (ALLUSERS = 1)</Publish>
98+ <Publish Dialog="AdvancedWelcomeEulaDlg_Custom" Control="AllUsersCheckBox" Property="APPLICATIONFOLDER" Value="[LocalAppDataFolder][ApplicationFolderName]" Order="2">NOT (ALLUSERS = 1)</Publish>
99+
100+ <!--<Publish Dialog="InstallScopeDlg" Control="Back" Event="NewDialog" Value="AdvancedWelcomeEulaDlg_Custom">1</Publish>-->
101+ <!-- override default WixAppFolder of WixPerMachineFolder as standard user won't be shown the radio group to set WixAppFolder -->
102+
103+ <!--<Publish Dialog="InstallScopeDlg" Control="Next" Property="WixAppFolder" Value="WixPerUserFolder" Order="1">!(wix.WixUISupportPerUser) AND NOT Privileged</Publish>-->
104+
105+
106+
107+ <!--<Publish Dialog="InstallScopeDlg" Control="Next" Event="NewDialog" Value="FeaturesDlg" Order="6">WixAppFolder = "WixPerUserFolder"</Publish>
108+ <Publish Dialog="InstallScopeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="7">WixAppFolder = "WixPerMachineFolder"</Publish>-->
109+
110+ <!--<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="InstallScopeDlg">!(wix.WixUISupportPerUser)</Publish>-->
111+ <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="AdvancedWelcomeEulaDlg_Custom">1</Publish>
112+ <Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
113+ <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
114+ <Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
115+ <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
116+ <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
117+ <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
118+
119+ <!--<Publish Dialog="FeaturesDlg" Control="Back" Event="NewDialog" Value="InstallScopeDlg">NOT Installed AND WixAppFolder = "WixPerUserFolder"</Publish>-->
120+ <Publish Dialog="FeaturesDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg">NOT Installed AND WixAppFolder = "WixPerMachineFolder"</Publish>
121+ <Publish Dialog="FeaturesDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg">Installed</Publish>
122+
123+ <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
124+
125+ <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
126+ <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
127+ <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
128+
129+ <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
130+ <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">Installed AND PATCH</Publish>
131+
132+ <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
133+ </UI>
134+
135+ <InstallUISequence>
136+ <Show Dialog="WelcomeDlg" Before="AdvancedWelcomeEulaDlg_Custom" >Installed AND PATCH</Show>
137+ </InstallUISequence>
138+
139+ <Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONFOLDER" />
140+ <UIRef Id="WixUI_Common" />
141+ </Fragment>
142+</Wix>
windows/make-windows-installer.bat+2−2
@@ -18,9 +18,9 @@ if "%VERSION%" == "" (
1818)
1919echo Detected version %VERSION%
2020echo Creating msi...
21−candle -dVERSION=%VERSION% -dBINPATH=%BINPATH% pandoc.wxs
21+candle -dVERSION=%VERSION% -dBINPATH=%BINPATH% *.wxs -out wixobj\
2222if %errorlevel% neq 0 exit /b %errorlevel%
23−light -sw1076 -ext WixUIExtension -ext WixUtilExtension -out pandoc-%VERSION%-windows.msi pandoc.wixobj
23+light -sw1076 -ext WixUIExtension -ext WixUtilExtension -cultures:en-us -loc Pandoc-en-us.wxl -out pandoc-%VERSION%-windows.msi wixobj\*.wixobj
2424if %errorlevel% neq 0 exit /b %errorlevel%
2525echo Starting kSign: sign, then quit kSign to complete the build...
2626kSign
windows/pandoc.wxs+51−83
@@ -1,18 +1,16 @@
1−<?xml version="1.0"?>
21<?define UpgradeCode = "A68E8EF6-ABB1-4F22-A3C5-68DFDF0AB562" ?>
32<?if $(sys.BUILDARCH)=x64?>
4− <?define ProgFilesFolder="ProgramFiles64Folder"?>
3+<?define ProgFilesFolder="ProgramFiles64Folder"?>
54<?else?>
6− <?define ProgFilesFolder="ProgramFilesFolder"?>
5+<?define ProgFilesFolder="ProgramFilesFolder"?>
76<?endif?>
8−
97<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
108 <Product Id="*"
119 UpgradeCode="$(var.UpgradeCode)" Name="Pandoc $(var.VERSION)"
1210 Version="$(var.VERSION)" Manufacturer="John MacFarlane"
1311 Language="1033">
1412
15− <Package InstallerVersion="200" Compressed="yes"
13+ <Package InstallerVersion="301" Compressed="yes"
1614 Comments="Windows Installer Package" />
1715 <Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
1816 <Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
@@ -21,7 +19,6 @@
2119 Minimum='0.0.0.0' IncludeMinimum='yes'
2220 Maximum="99.0.0.0" IncludeMaximum="no" />
2321 </Upgrade>
24− <Property Id="ARPURLINFOABOUT" Value="http://pandoc.org" />
2522
2623 <InstallExecuteSequence>
2724 <RemoveExistingProducts After="InstallFinalize"/>
@@ -126,92 +123,63 @@
126123 </Feature>
127124 </Feature>
128125
126+
127+ <!-- Set properties for add/remove programs -->
128+ <Property Id="ARPURLINFOABOUT" Value="http://pandoc.org" />
129+ <Property Id="ARPHELPLINK" Value="http://pandoc.org" />
130+ <Property Id="ARPNOREPAIR" Value="yes" Secure="yes" /> <!-- Remove repair -->
131+ <Property Id="ARPNOMODIFY" Value="yes" Secure="yes" /> <!-- Remove modify -->
132+
133+
134+ <!--Needed for WixUI_Advanced-->
135+ <Property Id="ApplicationFolderName" Value="Pandoc" />
136+ <Property Id="WixAppFolder" Value="WixPerUserFolder" />
137+
138+ <!--For Single Package for dual purpose i.e. per User/Machine-->
139+ <!--<Property Id="ALLUSERS" Value="2" Secure="yes" />-->
140+ <Property Id="MSIINSTALLPERUSER" Value="1" />
129141
142+ <!--Inform about installed location-->
130143 <SetProperty Id="ARPINSTALLLOCATION" Value="[APPLICATIONFOLDER]"
131144 After="CostFinalize" />
132−
133145 <CustomAction Id="SetExitDialogOptText"
134− Property="WIXUI_EXITDIALOGOPTIONALTEXT"
135− Value="[ProductName] was installed in [APPLICATIONFOLDER]. You may need to restart Cmd/Powershell windows before using it." />
136−
137− <CustomAction Id="CustomWixSetPerUserFolder"
138− Property="WixPerUserFolder"
139− Value="[LocalAppDataFolder][ApplicationFolderName]"
140− Execute="immediate" />
141−
142−
143− <InstallExecuteSequence>
144− <Custom Action="CustomWixSetPerUserFolder" After="WixSetDefaultPerUserFolder">
145− ACTION="INSTALL" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))
146− </Custom>
147− </InstallExecuteSequence>
146+ Property="WIXUI_EXITDIALOGOPTIONALTEXT"
147+ Value="!(loc.ExitDialogText)" />
148+
149+ <!--Offer Per User installs only on workstations (block on servers)-->
150+ <SetProperty Id="WixUISupportPerUser" Value="0" Before="FindRelatedProducts">
151+ <!--https://msdn.microsoft.com/en-us/library/windows/desktop/aa370329(v=vs.85).aspx-->
152+ MsiNTProductType > 1
153+ </SetProperty>
154+ <SetProperty Id="WixUISupportPerUser" Value="1" Before="FindRelatedProducts" Action="CASupportPerUser">
155+ MsiNTProductType = 1
156+ </SetProperty>
157+ <SetProperty Id="ALLUSERS" Value="1" Before="FindRelatedProducts">
158+ MsiNTProductType > 1
159+ </SetProperty>
160+ <SetProperty Id="ALLUSERS" Value="{}" Before="FindRelatedProducts" Action="CASetPuaPackage">
161+ MsiNTProductType = 1
162+ </SetProperty>
163+ <SetProperty Id="MSIINSTALLPERUSER" Value="1" Before="FindRelatedProducts">
164+ MsiNTProductType = 1
165+ </SetProperty>
166+ <SetProperty Id="WixAppFolder" Value="WixPerMachineFolder" Before="FindRelatedProducts">
167+ MsiNTProductType > 1
168+ </SetProperty>
169+
170+ <!--Make changes to PATH visible immeidiately-->
171+ <CustomActionRef Id="WixBroadcastSettingChange" />
172+ <CustomActionRef Id="WixBroadcastEnvironmentChange" />
148173
149174 <InstallUISequence>
150175 <Custom Action="SetExitDialogOptText" Before="ExecuteAction">
151176 NOT Installed
152177 </Custom>
153− <Custom Action="CustomWixSetPerUserFolder" After="WixSetDefaultPerUserFolder">
154− ACTION="INSTALL" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))
155− </Custom>
156178 </InstallUISequence>
157−
158− <CustomActionRef Id="WixBroadcastSettingChange" />
159− <CustomActionRef Id="WixBroadcastEnvironmentChange" />
160−
161− <Property Id="ApplicationFolderName" Value="Pandoc" />
162− <Property Id="WixAppFolder" Value="WixPerUserFolder" />
163− <Property Id="ALLUSERS" Value="2" Secure="yes" />
164− <Property Id="MSIINSTALLPERUSER" Value="1" />
165−
166− <WixVariable Id="WixUILicenseRtf" Value="COPYING.rtf" />
167−
168− <UI Id="MyWixUI_Advanced">
169− <UIRef Id="WixUI_Advanced" />
170− <UIRef Id="WixUI_ErrorProgressText" />
171−
172− <Publish Dialog="InstallScopeDlg" Control="Next"
173− Event="NewDialog" Value="VerifyReadyDlg"
174− Order="6">WixAppFolder = "WixPerUserFolder"</Publish>
175−
176− <Publish Dialog="InstallScopeDlg" Control="Next"
177− Property="APPLICATIONFOLDER"
178− Value="[$(var.ProgFilesFolder)][ApplicationFolderName]"
179− Order="7">WixAppFolder = "WixPerMachineFolder"</Publish>
180−
181− <Publish Dialog="InstallScopeDlg" Control="Next"
182− Property="APPLICATIONFOLDER" Value="[LocalAppDataFolder][ApplicationFolderName]"
183− Order="8">WixAppFolder = "WixPerUserFolder"</Publish>
184−
185− <Publish Dialog="InstallScopeDlg" Control="Next"
186− Property="MSIINSTALLPERUSER" Value="{}"
187− Order="18">WixAppFolder = "WixPerMachineFolder" AND ALLUSERS = 1</Publish>
188− <Publish Dialog="InstallScopeDlg" Control="Next"
189− Property="MSIINSTALLPERUSER" Value="1"
190− Order="19">WixAppFolder = "WixPerUserFolder" AND ALLUSERS = 2</Publish>
191− <Publish Dialog="InstallScopeDlg" Control="Next"
192− Property="ALLUSERS" Value="2"
193− Order="20">WixAppFolder = "WixPerUserFolder"</Publish>
194−
195−
196− <Publish Dialog="InstallDirDlg" Control="Next"
197− Event="NewDialog" Value="VerifyReadyDlg"
198− Order="4">
199− WIXUI_DONTVALIDATEPATH OR
200− WIXUI_INSTALLDIR_VALID="1"
201− </Publish>
202−
203− <Publish Dialog="VerifyReadyDlg" Control="Back"
204− Event="NewDialog" Value="InstallScopeDlg"
205− Order="11">
206− WixAppFolder = "WixPerUserFolder"
207− </Publish>
208− <Publish Dialog="VerifyReadyDlg" Control="Back"
209− Event="NewDialog" Value="InstallDirDlg"
210− Order="12">
211− WixAppFolder = "WixPerMachineFolder"
212− </Publish>
213− </UI>
214−
179+
180+ <UIRef Id="WixUI_Advanced_Custom"/>
181+
215182 </Product>
216−
183+
184+
217185</Wix>