@@ -1,5 +1,11 @@
11<?xml version="1.0"?>
22<?define UpgradeCode = "A68E8EF6-ABB1-4F22-A3C5-68DFDF0AB562" ?>
3+<?if $(sys.BUILDARCH)=x64?>
4+ <?define ProgFilesFolder="ProgramFiles64Folder"?>
5+<?else?>
6+ <?define ProgFilesFolder="ProgramFilesFolder"?>
7+<?endif?>
8+
39<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
410 <Product Id="*"
511 UpgradeCode="$(var.UpgradeCode)" Name="Pandoc $(var.VERSION)"
@@ -23,47 +29,64 @@
2329
2430 <Property Id="DISABLEADVTSHORTCUTS" Value="1" />
2531
26−
2732 <Directory Id="TARGETDIR" Name="SourceDir">
2833
29− <Directory Id="ProgramFilesFolder">
34+ <Directory Id="$(var.ProgFilesFolder)">
3035 <Directory Id="APPLICATIONFOLDER" Name="Pandoc">
3136 <Component Id="MainExecutable"
32− Guid="ECD35082-4C28-49E1-977E-B90FC7C400C7">
33− <RegistryValue Root="HKMU" Key="Software\John MacFarlane\Pandoc"
34− Name="Version" Type="string" Value="[ProductVersion]"
35− KeyPath="yes"/>
37+ Guid="ECD35082-4C28-49E1-977E-B90FC7C400C7">
38+ <RegistryValue Root="HKMU"
39+ Key="Software\John MacFarlane\Pandoc"
40+ Name="Version" Type="string" Value="[ProductVersion]"
41+ KeyPath="yes"/>
3642 <RemoveFolder Id="APPLICATIONFOLDER" On="uninstall"/>
3743 <File Id="pandocEXE" Name="pandoc.exe"
38− Source="..\.cabal-sandbox\bin\pandoc.exe" />
44+ Source="..\.cabal-sandbox\bin\pandoc.exe" />
3945 <File Id="pandocCOPYRIGHT" Name="COPYRIGHT.txt"
40− Source="..\COPYRIGHT.txt" />
46+ Source="..\COPYRIGHT.txt" />
4147 <File Id="pandocCOPYING" Name="COPYING.rtf"
42− Source="..\COPYING.rtf" />
43− <Environment Id='UpdatePath' Name='PATH' Action='set'
44− Permanent='no' System='no' Part='last'
45− Value='[APPLICATIONFOLDER]' />
48+ Source="..\COPYING.rtf" />
4649 </Component>
4750
4851 <Component Id="CitationSupport"
49− Guid="0A214839-2E69-4026-8DBB-0F0A9DB75C12">
50− <RegistryValue Root="HKMU" Key="Software\John MacFarlane\Pandoc"
51− Name="Version" Type="string" Value="[ProductVersion]"
52− KeyPath="yes"/>
52+ Guid="0A214839-2E69-4026-8DBB-0F0A9DB75C12">
53+ <RegistryValue Root="HKMU"
54+ Key="Software\John MacFarlane\Pandoc"
55+ Name="Version" Type="string" Value="[ProductVersion]"
56+ KeyPath="yes"/>
5357 <File Id="pandoc_citeprocEXE" Name="pandoc-citeproc.exe"
54− Source="..\.cabal-sandbox\bin\pandoc-citeproc.exe" />
58+ Source="..\.cabal-sandbox\bin\pandoc-citeproc.exe" />
5559 </Component>
5660
57−
5861 <Component Id="Documentation"
59− Guid="A8D54A76-1A3D-4647-8327-81B69D39D8A3">
62+ Guid="A8D54A76-1A3D-4647-8327-81B69D39D8A3">
6063 <File Id="pandocREADME" Name="Pandoc User's Guide.html"
61− Source="..\README.html" KeyPath="yes">
64+ Source="..\README.html" KeyPath="yes">
6265 <Shortcut Id="ApplicationStartMenuShortcut"
6366 Directory="ApplicationProgramsFolder"
64− Name="Pandoc User’s Guide" Advertise="yes" />
67+ Name="Pandoc User’s Guide" Advertise="yes" />
6568 </File>
6669 </Component>
70+
71+
72+ <Component Id="UpdateUserPath"
73+ Guid="7ECEAD05-CA5C-4147-82CB-F7CADABAC7F3"
74+ KeyPath="yes">
75+ <Condition>ALLUSERS = "" OR ALLUSERS = 2</Condition>
76+ <Environment Id='SetUserPath' Name='PATH' Action='set'
77+ Permanent='no' System='no' Part='last'
78+ Value='[APPLICATIONFOLDER]' />
79+ </Component>
80+
81+ <Component Id="UpdateSystemPath"
82+ Guid="F8AC4135-C0AE-48C7-BAC5-311DAC97CFD8"
83+ KeyPath="yes">
84+ <Condition>ALLUSERS = 1</Condition>
85+ <Environment Id='SetSystemPath' Name='PATH' Action='set'
86+ Permanent='no' System='yes' Part='last'
87+ Value='[APPLICATIONFOLDER]' />
88+ </Component>
89+
6790 </Directory>
6891 </Directory>
6992
@@ -74,8 +97,8 @@
7497 <RemoveFolder Id="ApplicationProgramsFolder"
7598 On="uninstall"/>
7699 <RegistryValue Root="HKMU" Key="Software\John MacFarlane\Pandoc"
77− Name="ShortcutInstalled" Type="integer" Value="1"
78− KeyPath="yes"/>
100+ Name="ShortcutInstalled" Type="integer" Value="1"
101+ KeyPath="yes"/>
79102 </Component>
80103 </Directory>
81104 </Directory>
@@ -85,10 +108,13 @@
85108 <Feature Id="Complete" Level="1" Title="Pandoc $(var.VERSION)"
86109 Description="Complete package" Display="expand"
87110 ConfigurableDirectory="APPLICATIONFOLDER">
88− <Feature Id="MainProgram" Title="Program" Description="The main
89− executable."
111+ <Feature Id="MainProgram"
112+ Title="Program"
113+ Description="The main executable."
90114 Level="1">
91115 <ComponentRef Id="MainExecutable" />
116+ <ComponentRef Id="UpdateUserPath" />
117+ <ComponentRef Id="UpdateSystemPath" />
92118 </Feature>
93119 <Feature Id="Manual" Title="Manual">
94120 <ComponentRef Id="Documentation" />
@@ -102,67 +128,90 @@
102128
103129
104130 <SetProperty Id="ARPINSTALLLOCATION" Value="[APPLICATIONFOLDER]"
105− After="CostFinalize" />
131+ After="CostFinalize" />
106132
107133 <CustomAction Id="SetExitDialogOptText"
108− Property="WIXUI_EXITDIALOGOPTIONALTEXT"
109− Value="[ProductName] was installed in [APPLICATIONFOLDER]. You
110− may need to restart Cmd/Powershell windows before using it."
111− />
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" />
112141
113− <CustomAction Id="CustomWixSetPerUserFolder" Property="APPLICATIONFOLDER" Value="[LocalAppDataFolder][ApplicationFolderName]" Execute="immediate" />
114142
115143 <InstallExecuteSequence>
116− <Custom Action="CustomWixSetPerUserFolder" After="WixSetPerUserFolder">
117− ACTION="INSTALL" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))
118− </Custom>
144+ <Custom Action="CustomWixSetPerUserFolder" After="WixSetDefaultPerUserFolder">
145+ ACTION="INSTALL" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))
146+ </Custom>
119147 </InstallExecuteSequence>
120148
121149 <InstallUISequence>
122− <Custom Action="SetExitDialogOptText" Before="ExecuteAction">
123− NOT Installed
124− </Custom>
125− <Custom Action="CustomWixSetPerUserFolder" After="WixSetPerUserFolder">
126− ACTION="INSTALL" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))
127− </Custom>
150+ <Custom Action="SetExitDialogOptText" Before="ExecuteAction">
151+ NOT Installed
152+ </Custom>
153+ <Custom Action="CustomWixSetPerUserFolder" After="WixSetDefaultPerUserFolder">
154+ ACTION="INSTALL" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))
155+ </Custom>
128156 </InstallUISequence>
129157
130158 <CustomActionRef Id="WixBroadcastSettingChange" />
131159 <CustomActionRef Id="WixBroadcastEnvironmentChange" />
132160
133−
134−
135161 <Property Id="ApplicationFolderName" Value="Pandoc" />
136162 <Property Id="WixAppFolder" Value="WixPerUserFolder" />
137163 <Property Id="ALLUSERS" Value="2" Secure="yes" />
138− <Property Id='MSIINSTALLPERUSER' Value='1' />
164+ <Property Id="MSIINSTALLPERUSER" Value="1" />
139165
140166 <WixVariable Id="WixUILicenseRtf" Value="..\COPYING.rtf" />
141167
142168 <UI Id="MyWixUI_Advanced">
143− <UIRef Id="WixUI_Advanced" />
144− <UIRef Id="WixUI_ErrorProgressText" />
145−
146− <Publish Dialog="InstallScopeDlg" Control="Next"
147− Event="NewDialog" Value="VerifyReadyDlg"
148− Order="6">WixAppFolder =
149− "WixPerUserFolder"</Publish>
150− <Publish Dialog="InstallDirDlg" Control="Next"
151− Event="NewDialog" Value="VerifyReadyDlg"
152− Order="4">WIXUI_DONTVALIDATEPATH OR
153− WIXUI_INSTALLDIR_VALID="1"</Publish>
154−
155− <Publish Dialog="VerifyReadyDlg" Control="Back"
156− Event="NewDialog" Value="InstallScopeDlg"
157− Order="11">WixAppFolder =
158− "WixPerUserFolder"</Publish>
159− <Publish Dialog="VerifyReadyDlg" Control="Back"
160− Event="NewDialog" Value="InstallDirDlg"
161− Order="12">WixAppFolder =
162− "WixPerMachineFolder"</Publish>
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>
163213 </UI>
164214
165−
166215 </Product>
167216
168217</Wix>