Updated pandoc.wxs.

From @nkalvi with a few modifications (custom variables).

- when per-machine installation is chosen, the system path
  is updated instead of the user's
- an appropriate default is used for per-machine installation directory.
This commit is contained in:
John MacFarlane 2015-07-09 22:02:30 -07:00
parent b587acb224
commit cb2c81b45b

View file

@ -1,5 +1,11 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<?define UpgradeCode = "A68E8EF6-ABB1-4F22-A3C5-68DFDF0AB562" ?> <?define UpgradeCode = "A68E8EF6-ABB1-4F22-A3C5-68DFDF0AB562" ?>
<?if $(sys.BUILDARCH)=x64?>
<?define ProgFilesFolder="ProgramFiles64Folder"?>
<?else?>
<?define ProgFilesFolder="ProgramFilesFolder"?>
<?endif?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" <Product Id="*"
UpgradeCode="$(var.UpgradeCode)" Name="Pandoc $(var.VERSION)" UpgradeCode="$(var.UpgradeCode)" Name="Pandoc $(var.VERSION)"
@ -23,47 +29,64 @@
<Property Id="DISABLEADVTSHORTCUTS" Value="1" /> <Property Id="DISABLEADVTSHORTCUTS" Value="1" />
<Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder"> <Directory Id="$(var.ProgFilesFolder)">
<Directory Id="APPLICATIONFOLDER" Name="Pandoc"> <Directory Id="APPLICATIONFOLDER" Name="Pandoc">
<Component Id="MainExecutable" <Component Id="MainExecutable"
Guid="ECD35082-4C28-49E1-977E-B90FC7C400C7"> Guid="ECD35082-4C28-49E1-977E-B90FC7C400C7">
<RegistryValue Root="HKMU" Key="Software\John MacFarlane\Pandoc" <RegistryValue Root="HKMU"
Name="Version" Type="string" Value="[ProductVersion]" Key="Software\John MacFarlane\Pandoc"
KeyPath="yes"/> Name="Version" Type="string" Value="[ProductVersion]"
KeyPath="yes"/>
<RemoveFolder Id="APPLICATIONFOLDER" On="uninstall"/> <RemoveFolder Id="APPLICATIONFOLDER" On="uninstall"/>
<File Id="pandocEXE" Name="pandoc.exe" <File Id="pandocEXE" Name="pandoc.exe"
Source="..\.cabal-sandbox\bin\pandoc.exe" /> Source="..\.cabal-sandbox\bin\pandoc.exe" />
<File Id="pandocCOPYRIGHT" Name="COPYRIGHT.txt" <File Id="pandocCOPYRIGHT" Name="COPYRIGHT.txt"
Source="..\COPYRIGHT.txt" /> Source="..\COPYRIGHT.txt" />
<File Id="pandocCOPYING" Name="COPYING.rtf" <File Id="pandocCOPYING" Name="COPYING.rtf"
Source="..\COPYING.rtf" /> Source="..\COPYING.rtf" />
<Environment Id='UpdatePath' Name='PATH' Action='set'
Permanent='no' System='no' Part='last'
Value='[APPLICATIONFOLDER]' />
</Component> </Component>
<Component Id="CitationSupport" <Component Id="CitationSupport"
Guid="0A214839-2E69-4026-8DBB-0F0A9DB75C12"> Guid="0A214839-2E69-4026-8DBB-0F0A9DB75C12">
<RegistryValue Root="HKMU" Key="Software\John MacFarlane\Pandoc" <RegistryValue Root="HKMU"
Name="Version" Type="string" Value="[ProductVersion]" Key="Software\John MacFarlane\Pandoc"
KeyPath="yes"/> Name="Version" Type="string" Value="[ProductVersion]"
KeyPath="yes"/>
<File Id="pandoc_citeprocEXE" Name="pandoc-citeproc.exe" <File Id="pandoc_citeprocEXE" Name="pandoc-citeproc.exe"
Source="..\.cabal-sandbox\bin\pandoc-citeproc.exe" /> Source="..\.cabal-sandbox\bin\pandoc-citeproc.exe" />
</Component> </Component>
<Component Id="Documentation" <Component Id="Documentation"
Guid="A8D54A76-1A3D-4647-8327-81B69D39D8A3"> Guid="A8D54A76-1A3D-4647-8327-81B69D39D8A3">
<File Id="pandocREADME" Name="Pandoc User's Guide.html" <File Id="pandocREADME" Name="Pandoc User's Guide.html"
Source="..\README.html" KeyPath="yes"> Source="..\README.html" KeyPath="yes">
<Shortcut Id="ApplicationStartMenuShortcut" <Shortcut Id="ApplicationStartMenuShortcut"
Directory="ApplicationProgramsFolder" Directory="ApplicationProgramsFolder"
Name="Pandoc Users Guide" Advertise="yes" /> Name="Pandoc Users Guide" Advertise="yes" />
</File> </File>
</Component> </Component>
<Component Id="UpdateUserPath"
Guid="7ECEAD05-CA5C-4147-82CB-F7CADABAC7F3"
KeyPath="yes">
<Condition>ALLUSERS = "" OR ALLUSERS = 2</Condition>
<Environment Id='SetUserPath' Name='PATH' Action='set'
Permanent='no' System='no' Part='last'
Value='[APPLICATIONFOLDER]' />
</Component>
<Component Id="UpdateSystemPath"
Guid="F8AC4135-C0AE-48C7-BAC5-311DAC97CFD8"
KeyPath="yes">
<Condition>ALLUSERS = 1</Condition>
<Environment Id='SetSystemPath' Name='PATH' Action='set'
Permanent='no' System='yes' Part='last'
Value='[APPLICATIONFOLDER]' />
</Component>
</Directory> </Directory>
</Directory> </Directory>
@ -74,8 +97,8 @@
<RemoveFolder Id="ApplicationProgramsFolder" <RemoveFolder Id="ApplicationProgramsFolder"
On="uninstall"/> On="uninstall"/>
<RegistryValue Root="HKMU" Key="Software\John MacFarlane\Pandoc" <RegistryValue Root="HKMU" Key="Software\John MacFarlane\Pandoc"
Name="ShortcutInstalled" Type="integer" Value="1" Name="ShortcutInstalled" Type="integer" Value="1"
KeyPath="yes"/> KeyPath="yes"/>
</Component> </Component>
</Directory> </Directory>
</Directory> </Directory>
@ -85,10 +108,13 @@
<Feature Id="Complete" Level="1" Title="Pandoc $(var.VERSION)" <Feature Id="Complete" Level="1" Title="Pandoc $(var.VERSION)"
Description="Complete package" Display="expand" Description="Complete package" Display="expand"
ConfigurableDirectory="APPLICATIONFOLDER"> ConfigurableDirectory="APPLICATIONFOLDER">
<Feature Id="MainProgram" Title="Program" Description="The main <Feature Id="MainProgram"
executable." Title="Program"
Description="The main executable."
Level="1"> Level="1">
<ComponentRef Id="MainExecutable" /> <ComponentRef Id="MainExecutable" />
<ComponentRef Id="UpdateUserPath" />
<ComponentRef Id="UpdateSystemPath" />
</Feature> </Feature>
<Feature Id="Manual" Title="Manual"> <Feature Id="Manual" Title="Manual">
<ComponentRef Id="Documentation" /> <ComponentRef Id="Documentation" />
@ -102,67 +128,90 @@
<SetProperty Id="ARPINSTALLLOCATION" Value="[APPLICATIONFOLDER]" <SetProperty Id="ARPINSTALLLOCATION" Value="[APPLICATIONFOLDER]"
After="CostFinalize" /> After="CostFinalize" />
<CustomAction Id="SetExitDialogOptText" <CustomAction Id="SetExitDialogOptText"
Property="WIXUI_EXITDIALOGOPTIONALTEXT" Property="WIXUI_EXITDIALOGOPTIONALTEXT"
Value="[ProductName] was installed in [APPLICATIONFOLDER]. You Value="[ProductName] was installed in [APPLICATIONFOLDER]. You may need to restart Cmd/Powershell windows before using it." />
may need to restart Cmd/Powershell windows before using it."
/> <CustomAction Id="CustomWixSetPerUserFolder"
Property="WixPerUserFolder"
Value="[LocalAppDataFolder][ApplicationFolderName]"
Execute="immediate" />
<CustomAction Id="CustomWixSetPerUserFolder" Property="APPLICATIONFOLDER" Value="[LocalAppDataFolder][ApplicationFolderName]" Execute="immediate" />
<InstallExecuteSequence> <InstallExecuteSequence>
<Custom Action="CustomWixSetPerUserFolder" After="WixSetPerUserFolder"> <Custom Action="CustomWixSetPerUserFolder" After="WixSetDefaultPerUserFolder">
ACTION="INSTALL" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged))) ACTION="INSTALL" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))
</Custom> </Custom>
</InstallExecuteSequence> </InstallExecuteSequence>
<InstallUISequence> <InstallUISequence>
<Custom Action="SetExitDialogOptText" Before="ExecuteAction"> <Custom Action="SetExitDialogOptText" Before="ExecuteAction">
NOT Installed NOT Installed
</Custom> </Custom>
<Custom Action="CustomWixSetPerUserFolder" After="WixSetPerUserFolder"> <Custom Action="CustomWixSetPerUserFolder" After="WixSetDefaultPerUserFolder">
ACTION="INSTALL" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged))) ACTION="INSTALL" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))
</Custom> </Custom>
</InstallUISequence> </InstallUISequence>
<CustomActionRef Id="WixBroadcastSettingChange" /> <CustomActionRef Id="WixBroadcastSettingChange" />
<CustomActionRef Id="WixBroadcastEnvironmentChange" /> <CustomActionRef Id="WixBroadcastEnvironmentChange" />
<Property Id="ApplicationFolderName" Value="Pandoc" /> <Property Id="ApplicationFolderName" Value="Pandoc" />
<Property Id="WixAppFolder" Value="WixPerUserFolder" /> <Property Id="WixAppFolder" Value="WixPerUserFolder" />
<Property Id="ALLUSERS" Value="2" Secure="yes" /> <Property Id="ALLUSERS" Value="2" Secure="yes" />
<Property Id='MSIINSTALLPERUSER' Value='1' /> <Property Id="MSIINSTALLPERUSER" Value="1" />
<WixVariable Id="WixUILicenseRtf" Value="..\COPYING.rtf" /> <WixVariable Id="WixUILicenseRtf" Value="..\COPYING.rtf" />
<UI Id="MyWixUI_Advanced"> <UI Id="MyWixUI_Advanced">
<UIRef Id="WixUI_Advanced" /> <UIRef Id="WixUI_Advanced" />
<UIRef Id="WixUI_ErrorProgressText" /> <UIRef Id="WixUI_ErrorProgressText" />
<Publish Dialog="InstallScopeDlg" Control="Next" <Publish Dialog="InstallScopeDlg" Control="Next"
Event="NewDialog" Value="VerifyReadyDlg" Event="NewDialog" Value="VerifyReadyDlg"
Order="6">WixAppFolder = Order="6">WixAppFolder = "WixPerUserFolder"</Publish>
"WixPerUserFolder"</Publish>
<Publish Dialog="InstallDirDlg" Control="Next"
Event="NewDialog" Value="VerifyReadyDlg"
Order="4">WIXUI_DONTVALIDATEPATH OR
WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" <Publish Dialog="InstallScopeDlg" Control="Next"
Event="NewDialog" Value="InstallScopeDlg" Property="APPLICATIONFOLDER"
Order="11">WixAppFolder = Value="[$(var.ProgFilesFolder)][ApplicationFolderName]"
"WixPerUserFolder"</Publish> Order="7">WixAppFolder = "WixPerMachineFolder"</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back"
Event="NewDialog" Value="InstallDirDlg" <Publish Dialog="InstallScopeDlg" Control="Next"
Order="12">WixAppFolder = Property="APPLICATIONFOLDER" Value="[LocalAppDataFolder][ApplicationFolderName]"
"WixPerMachineFolder"</Publish> Order="8">WixAppFolder = "WixPerUserFolder"</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next"
Property="MSIINSTALLPERUSER" Value="{}"
Order="18">WixAppFolder = "WixPerMachineFolder" AND ALLUSERS = 1</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next"
Property="MSIINSTALLPERUSER" Value="1"
Order="19">WixAppFolder = "WixPerUserFolder" AND ALLUSERS = 2</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next"
Property="ALLUSERS" Value="2"
Order="20">WixAppFolder = "WixPerUserFolder"</Publish>
<Publish Dialog="InstallDirDlg" Control="Next"
Event="NewDialog" Value="VerifyReadyDlg"
Order="4">
WIXUI_DONTVALIDATEPATH OR
WIXUI_INSTALLDIR_VALID="1"
</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back"
Event="NewDialog" Value="InstallScopeDlg"
Order="11">
WixAppFolder = "WixPerUserFolder"
</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back"
Event="NewDialog" Value="InstallDirDlg"
Order="12">
WixAppFolder = "WixPerMachineFolder"
</Publish>
</UI> </UI>
</Product> </Product>
</Wix> </Wix>