Clean up indentation in the WiX template

This commit is contained in:
Kovid Goyal 2015-02-16 19:22:36 +05:30
parent 47841f1e0f
commit 96abc72ed1

View File

@ -2,204 +2,196 @@
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" <Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
> >
<Product Name='{app}{x64}' Id='*' UpgradeCode='{upgrade_code}' <Product Name='{app}{x64}' Id='*' UpgradeCode='{upgrade_code}' Language='1033' Codepage='1252' Version='{version}' Manufacturer='Kovid Goyal'>
Language='1033' Codepage='1252' Version='{version}' Manufacturer='Kovid Goyal'>
<Package Id='*' Keywords='Installer' Description="{app} Installer" <Package Id='*' Keywords='Installer' Description="{app} Installer"
Comments='{app} is a registered trademark of Kovid Goyal' Manufacturer='Kovid Goyal' Comments='{app} is a registered trademark of Kovid Goyal' Manufacturer='Kovid Goyal'
InstallerVersion='300' Languages='1033' Compressed='yes' InstallerVersion='300' Languages='1033' Compressed='yes'
SummaryCodepage='1252' /> SummaryCodepage='1252' />
<Media Id="1" Cabinet="{app}.cab" CompressionLevel="{compression}" EmbedCab="yes" /> <Media Id="1" Cabinet="{app}.cab" CompressionLevel="{compression}" EmbedCab="yes" />
<!-- The following line ensures that DLLs are replaced even if <!-- The following line ensures that DLLs are replaced even if
their version is the same as before or they dont have their version is the same as before or they dont have versions.
versions. Microsoft's brain dead installer will otherwise Microsoft's brain dead installer will otherwise use file dates to
use file dates to determine whether to install a file or determine whether to install a file or not. Simply not robust. And
not. Simply not robust. And since we dont install any since we dont install any system files whatsoever, we can never replace
system files whatsoever, we can never replace a system a system file with an older version. This way the calibre install
file with an older version. This way the calibre install should always result in a consistent set of files being present in the
should always result in a consistent set of files being installation folder, though of course, with Microsoft there are no
present in the installation folder, though of course, with guarantees of anything. -->
Microsoft there are no guarantees of anything. --> <Property Id='REINSTALLMODE' Value='amus'/>
<Property Id='REINSTALLMODE' Value='amus'/>
<Upgrade Id="{upgrade_code}"> <Upgrade Id="{upgrade_code}">
<UpgradeVersion Maximum="{version}" <UpgradeVersion Maximum="{version}"
IncludeMaximum="yes" IncludeMaximum="yes"
OnlyDetect="no" OnlyDetect="no"
Language="1033" Language="1033"
MigrateFeatures="yes" MigrateFeatures="yes"
Property="OLDPRODUCTFOUND"/> Property="OLDPRODUCTFOUND"/>
<UpgradeVersion Minimum="{version}" <UpgradeVersion Minimum="{version}"
IncludeMinimum="no" IncludeMinimum="no"
OnlyDetect="yes" OnlyDetect="yes"
Language="1033" Language="1033"
Property="NEWPRODUCTFOUND"/> Property="NEWPRODUCTFOUND"/>
</Upgrade> </Upgrade>
<CustomAction Id="PreventDowngrading" Error="Newer version of {app} already installed. If you want to downgrade you must uninstall {app} first."/> <CustomAction Id="PreventDowngrading" Error="Newer version of {app} already installed. If you want to downgrade you must uninstall {app} first."/>
<Property Id="APPLICATIONFOLDER"> <Property Id="APPLICATIONFOLDER">
<RegistrySearch Id='calibreInstDir' Type='raw' <RegistrySearch Id='calibreInstDir' Type='raw'
Root='HKLM' Key="Software\{app}{x64}\Installer" Name="InstallPath" /> Root='HKLM' Key="Software\{app}{x64}\Installer" Name="InstallPath" />
</Property> </Property>
<Directory Id='TARGETDIR' Name='SourceDir'> <Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='{ProgramFilesFolder}' Name='PFiles'> <Directory Id='{ProgramFilesFolder}' Name='PFiles'>
<!-- The name must be calibre on 32 bit to ensure <!-- The name must be calibre on 32 bit to ensure
that the component guids dont change compared that the component guids dont change compared to previous msis.
to previous msis. However, on 64 bit it must However, on 64 bit it must be Calibre2 otherwise by default it
be Calibre2 otherwise by default it will will install to C:\Program Files\calibre -->
install to C:\Program Files\calibre --> <Directory Id='APPLICATIONFOLDER' Name="{appfolder}" />
<Directory Id='APPLICATIONFOLDER' Name="{appfolder}" /> </Directory>
</Directory> <Directory Id="ProgramMenuFolder">
<Directory Id="ProgramMenuFolder"> <Directory Id="ApplicationProgramsFolder" Name="{app}{x64} - E-book Management"/>
<Directory Id="ApplicationProgramsFolder" Name="{app}{x64} - E-book Management"/> </Directory>
</Directory> <Directory Id="DesktopFolder" Name="Desktop"/>
<Directory Id="DesktopFolder" Name="Desktop"/> </Directory>
</Directory>
<DirectoryRef Id="APPLICATIONFOLDER"> <DirectoryRef Id="APPLICATIONFOLDER">
{app_components} {app_components}
<Component Id="AddToPath" Guid="*"> <Component Id="AddToPath" Guid="*">
<Environment Id='UpdatePath' Name='PATH' Action='set' System='yes' Part='last' Value='[APPLICATIONFOLDER]' /> <Environment Id='UpdatePath' Name='PATH' Action='set' System='yes' Part='last' Value='[APPLICATIONFOLDER]' />
<RegistryValue Root="HKCU" Key="Software\Microsoft\{app}{x64}" Name="system_path_updated" Type="integer" Value="1" KeyPath="yes"/> <RegistryValue Root="HKCU" Key="Software\Microsoft\{app}{x64}" Name="system_path_updated" Type="integer" Value="1" KeyPath="yes"/>
</Component> </Component>
<Component Id="RememberInstallDir" Guid="*"> <Component Id="RememberInstallDir" Guid="*">
<RegistryValue Root="HKLM" Key="Software\{app}{x64}\Installer" Name="InstallPath" Type="string" Value="[APPLICATIONFOLDER]" KeyPath="yes"/> <RegistryValue Root="HKLM" Key="Software\{app}{x64}\Installer" Name="InstallPath" Type="string" Value="[APPLICATIONFOLDER]" KeyPath="yes"/>
</Component> </Component>
</DirectoryRef> </DirectoryRef>
<DirectoryRef Id="ApplicationProgramsFolder"> <DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="StartMenuShortcuts" Guid="*"> <Component Id="StartMenuShortcuts" Guid="*">
<Shortcut Id="s1" Name="{app}{x64} - E-book management" <Shortcut Id="s1" Name="{app}{x64} - E-book management"
Description="Manage your e-book collection and download news" Description="Manage your e-book collection and download news"
Target="[#{exe_map[calibre]}]" Target="[#{exe_map[calibre]}]"
WorkingDirectory="APPLICATIONROOTDIRECTORY" /> WorkingDirectory="APPLICATIONROOTDIRECTORY" />
<Shortcut Id="s2" Name="E-book viewer{x64}" <Shortcut Id="s2" Name="E-book viewer{x64}"
Description="Viewer for all the major e-book formats" Description="Viewer for all the major e-book formats"
Target="[#{exe_map[ebook-viewer]}]" Target="[#{exe_map[ebook-viewer]}]"
WorkingDirectory="APPLICATIONROOTDIRECTORY" /> WorkingDirectory="APPLICATIONROOTDIRECTORY" />
<Shortcut Id="s4" Name="Edit E-book{x64}" <Shortcut Id="s4" Name="Edit E-book{x64}"
Description="Edit e-books" Description="Edit e-books"
Target="[#{exe_map[ebook-edit]}]" Target="[#{exe_map[ebook-edit]}]"
WorkingDirectory="APPLICATIONROOTDIRECTORY" /> WorkingDirectory="APPLICATIONROOTDIRECTORY" />
<Shortcut Id="s3" Name="LRF viewer{x64}" <Shortcut Id="s3" Name="LRF viewer{x64}"
Description="Viewer for LRF format e-books" Description="Viewer for LRF format e-books"
Target="[#{exe_map[lrfviewer]}]" Target="[#{exe_map[lrfviewer]}]"
WorkingDirectory="APPLICATIONROOTDIRECTORY" /> WorkingDirectory="APPLICATIONROOTDIRECTORY" />
<util:InternetShortcut Id="OnlineDocumentationShortcut" <util:InternetShortcut Id="OnlineDocumentationShortcut"
Name="User Manual" Type="url" Name="User Manual" Type="url"
Target="http://manual.calibre-ebook.com"/> Target="http://manual.calibre-ebook.com"/>
<util:InternetShortcut Id="GetInvolvedS" <util:InternetShortcut Id="GetInvolvedS"
Name="Get Involved" Type="url" Name="Get Involved" Type="url"
Target="http://calibre-ebook.com/get-involved"/> Target="http://calibre-ebook.com/get-involved"/>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/> <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Microsoft\{app}{x64}" Name="start_menu_shortcuts_installed" Type="integer" Value="1" KeyPath="yes"/> <RegistryValue Root="HKCU" Key="Software\Microsoft\{app}{x64}" Name="start_menu_shortcuts_installed" Type="integer" Value="1" KeyPath="yes"/>
</Component> </Component>
</DirectoryRef> </DirectoryRef>
<DirectoryRef Id="DesktopFolder"> <DirectoryRef Id="DesktopFolder">
<Component Id="DesktopShortcut" Guid="*"> <Component Id="DesktopShortcut" Guid="*">
<Shortcut Id="ds1" Name="{app}{x64} - E-book management" <Shortcut Id="ds1" Name="{app}{x64} - E-book management"
Description="Manage your e-book collection and download news" Description="Manage your e-book collection and download news"
Target="[#{exe_map[calibre]}]" Target="[#{exe_map[calibre]}]"
WorkingDirectory="APPLICATIONROOTDIRECTORY" /> WorkingDirectory="APPLICATIONROOTDIRECTORY" />
<RegistryValue Root="HKCU" Key="Software\Microsoft\{app}{x64}" Name="desktop_shortcut_installed" Type="integer" Value="1" KeyPath="yes"/> <RegistryValue Root="HKCU" Key="Software\Microsoft\{app}{x64}" Name="desktop_shortcut_installed" Type="integer" Value="1" KeyPath="yes"/>
</Component> </Component>
</DirectoryRef> </DirectoryRef>
<Feature Id="Complete" Title="{app}" Display="expand" Level="1"
ConfigurableDirectory="APPLICATIONFOLDER">
<Feature Id="Complete" Title="{app}" Display="expand" Level="1" <Feature Id="MainApplication" Title="Program Files" Level="1"
ConfigurableDirectory="APPLICATIONFOLDER"> Description="All the files needed to run {app}" Absent="disallow">
<ComponentRef Id="RememberInstallDir"/>
</Feature>
<Feature Id="MainApplication" Title="Program Files" Level="1" <Feature Id="FSMS" Title="Start menu shortcuts" Level="1"
Description="All the files needed to run {app}" Absent="disallow"> Description="Program shortcuts installed in the Start Menu">
<ComponentRef Id="RememberInstallDir"/> <ComponentRef Id="StartMenuShortcuts"/>
</Feature> </Feature>
<Feature Id="FSMS" Title="Start menu shortcuts" Level="1" <Feature Id="DS" Title="Shortcut on desktop" Level="1"
Description="Program shortcuts installed in the Start Menu"> Description="Shortcut to {app} on your desktop">
<ComponentRef Id="StartMenuShortcuts"/> <ComponentRef Id="DesktopShortcut"/>
</Feature> </Feature>
<Feature Id="DS" Title="Shortcut on desktop" Level="1" <Feature Id="FAddToPath" Title="Add install directory to path" Level="1"
Description="Shortcut to {app} on your desktop"> Description="Add installation directory to PATH. Makes using command line tools easier">
<ComponentRef Id="DesktopShortcut"/> <ComponentRef Id="AddToPath"/>
</Feature> </Feature>
</Feature>
<Feature Id="FAddToPath" Title="Add install directory to path" Level="1" <!-- Add icon to entry in Add/Remove programs -->
Description="Add installation directory to PATH. Makes using command line tools easier"> <Icon Id="main_icon" SourceFile="{main_icon}"/>
<ComponentRef Id="AddToPath"/> <Property Id="ARPPRODUCTICON" Value="main_icon" />
</Feature> <Property Id="ARPURLINFOABOUT" Value="http://calibre-ebook.com" />
</Feature> <Property Id='ARPHELPLINK' Value="http://calibre-ebook.com/help" />
<Property Id='ARPURLUPDATEINFO' Value="http://calibre-ebook.com/download_windows" />
<SetProperty Id="ARPINSTALLLOCATION" Value="[APPLICATIONFOLDER]" After="CostFinalize" />
<!-- Add icon to entry in Add/Remove programs --> <Condition
<Icon Id="main_icon" SourceFile="{main_icon}"/> Message="This application is only supported on {minverhuman}, or higher.">
<Property Id="ARPPRODUCTICON" Value="main_icon" /> <![CDATA[Installed OR (VersionNT >= {minver})]]>
<Property Id="ARPURLINFOABOUT" Value="http://calibre-ebook.com" /> </Condition>
<Property Id='ARPHELPLINK' Value="http://calibre-ebook.com/help" /> <!-- On 64 bit installers there is a bug in WiX that causes the
<Property Id='ARPURLUPDATEINFO' Value="http://calibre-ebook.com/download_windows" /> WixSetDefaultPerMachineFolder action to incorrectly set
<SetProperty Id="ARPINSTALLLOCATION" Value="[APPLICATIONFOLDER]" After="CostFinalize" /> APPLICATIONFOLDER to the x86 value, so we override it. See
http://stackoverflow.com/questions/5479790/wix-how-to-override-c-program-files-x86-on-x64-machine-in-wixui-advanced-s
-->
<CustomAction
Id="OverwriteWixSetDefaultPerMachineFolder"
Property="WixPerMachineFolder"
Value="[APPLICATIONFOLDER]"
Execute="immediate"
/>
<Condition <InstallExecuteSequence>
Message="This application is only supported on {minverhuman}, or higher."> <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
<![CDATA[Installed OR (VersionNT >= {minver})]]> {fix_wix}
</Condition> <RemoveExistingProducts After="InstallFinalize" />
<!-- On 64 bit installers there is a bug in WiX that causes the </InstallExecuteSequence>
WixSetDefaultPerMachineFolder action to incorrectly set <InstallUISequence>
APPLICATIONFOLDER to the x86 value, so we override it. See <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
http://stackoverflow.com/questions/5479790/wix-how-to-override-c-program-files-x86-on-x64-machine-in-wixui-advanced-s {fix_wix}
--> </InstallUISequence>
<CustomAction
Id="OverwriteWixSetDefaultPerMachineFolder"
Property="WixPerMachineFolder"
Value="[APPLICATIONFOLDER]"
Execute="immediate"
/>
<InstallExecuteSequence> <UI>
<Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom> <UIRef Id="WixUI_Advanced" />
{fix_wix} <Publish Dialog="ExitDialog"
<RemoveExistingProducts After="InstallFinalize" /> Control="Finish"
</InstallExecuteSequence> Event="DoAction"
<InstallUISequence> Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
<Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
{fix_wix}
</InstallUISequence>
<UI> </UI>
<UIRef Id="WixUI_Advanced" />
<Publish Dialog="ExitDialog"
Control="Finish"
Event="DoAction"
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI> <!--
Set default folder name and allow only per machine installs.
For a per-machine installation, the default installation location
will be [ProgramFilesFolder][ApplicationFolderName] and the user
will be able to change it in the setup UI. This is no longer necessary
(i.e. per user installs should work) but left this way as I
dont want to deal with the complications
-->
<Property Id="ApplicationFolderName" Value="Calibre2" />
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
<Property Id="ALLUSERS" Value="1" />
<WixVariable Id="WixUISupportPerUser" Value="0" />
<!-- <!-- Add option to launch calibre after install -->
Set default folder name and allow only per machine installs. <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch {app}" />
For a per-machine installation, the default installation location <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
will be [ProgramFilesFolder][ApplicationFolderName] and the user <Property Id="WixShellExecTarget" Value="[#{exe_map[calibre]}]" />
will be able to change it in the setup UI. This is no longer necessary <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes"/>
(i.e. per user installs should work) but left this way as I
dont want to deal with the complications
-->
<Property Id="ApplicationFolderName" Value="Calibre2" />
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
<Property Id="ALLUSERS" Value="1" />
<WixVariable Id="WixUISupportPerUser" Value="0" />
<!-- Add option to launch calibre after install --> </Product>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch {app}" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
<Property Id="WixShellExecTarget" Value="[#{exe_map[calibre]}]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA"
DllEntry="WixShellExec" Impersonate="yes"/>
</Product>
</Wix> </Wix>