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" <Feature Id="Complete" Title="{app}" Display="expand" Level="1"
ConfigurableDirectory="APPLICATIONFOLDER"> ConfigurableDirectory="APPLICATIONFOLDER">
<Feature Id="MainApplication" Title="Program Files" Level="1" <Feature Id="MainApplication" Title="Program Files" Level="1"
Description="All the files needed to run {app}" Absent="disallow"> Description="All the files needed to run {app}" Absent="disallow">
<ComponentRef Id="RememberInstallDir"/> <ComponentRef Id="RememberInstallDir"/>
</Feature> </Feature>
<Feature Id="FSMS" Title="Start menu shortcuts" Level="1" <Feature Id="FSMS" Title="Start menu shortcuts" Level="1"
Description="Program shortcuts installed in the Start Menu"> Description="Program shortcuts installed in the Start Menu">
<ComponentRef Id="StartMenuShortcuts"/> <ComponentRef Id="StartMenuShortcuts"/>
</Feature> </Feature>
<Feature Id="DS" Title="Shortcut on desktop" Level="1" <Feature Id="DS" Title="Shortcut on desktop" Level="1"
Description="Shortcut to {app} on your desktop"> Description="Shortcut to {app} on your desktop">
<ComponentRef Id="DesktopShortcut"/> <ComponentRef Id="DesktopShortcut"/>
</Feature> </Feature>
<Feature Id="FAddToPath" Title="Add install directory to path" Level="1" <Feature Id="FAddToPath" Title="Add install directory to path" Level="1"
Description="Add installation directory to PATH. Makes using command line tools easier"> Description="Add installation directory to PATH. Makes using command line tools easier">
<ComponentRef Id="AddToPath"/> <ComponentRef Id="AddToPath"/>
</Feature> </Feature>
</Feature> </Feature>
<!-- Add icon to entry in Add/Remove programs --> <!-- Add icon to entry in Add/Remove programs -->
<Icon Id="main_icon" SourceFile="{main_icon}"/> <Icon Id="main_icon" SourceFile="{main_icon}"/>
<Property Id="ARPPRODUCTICON" Value="main_icon" /> <Property Id="ARPPRODUCTICON" Value="main_icon" />
<Property Id="ARPURLINFOABOUT" Value="http://calibre-ebook.com" /> <Property Id="ARPURLINFOABOUT" Value="http://calibre-ebook.com" />
<Property Id='ARPHELPLINK' Value="http://calibre-ebook.com/help" /> <Property Id='ARPHELPLINK' Value="http://calibre-ebook.com/help" />
<Property Id='ARPURLUPDATEINFO' Value="http://calibre-ebook.com/download_windows" /> <Property Id='ARPURLUPDATEINFO' Value="http://calibre-ebook.com/download_windows" />
<SetProperty Id="ARPINSTALLLOCATION" Value="[APPLICATIONFOLDER]" After="CostFinalize" /> <SetProperty Id="ARPINSTALLLOCATION" Value="[APPLICATIONFOLDER]" After="CostFinalize" />
<Condition <Condition
Message="This application is only supported on {minverhuman}, or higher."> Message="This application is only supported on {minverhuman}, or higher.">
<![CDATA[Installed OR (VersionNT >= {minver})]]> <![CDATA[Installed OR (VersionNT >= {minver})]]>
</Condition> </Condition>
<!-- On 64 bit installers there is a bug in WiX that causes the <!-- On 64 bit installers there is a bug in WiX that causes the
WixSetDefaultPerMachineFolder action to incorrectly set WixSetDefaultPerMachineFolder action to incorrectly set
APPLICATIONFOLDER to the x86 value, so we override it. See 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 http://stackoverflow.com/questions/5479790/wix-how-to-override-c-program-files-x86-on-x64-machine-in-wixui-advanced-s
--> -->
<CustomAction <CustomAction
Id="OverwriteWixSetDefaultPerMachineFolder" Id="OverwriteWixSetDefaultPerMachineFolder"
Property="WixPerMachineFolder" Property="WixPerMachineFolder"
Value="[APPLICATIONFOLDER]" Value="[APPLICATIONFOLDER]"
Execute="immediate" Execute="immediate"
/> />
<InstallExecuteSequence> <InstallExecuteSequence>
<Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom> <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
{fix_wix} {fix_wix}
<RemoveExistingProducts After="InstallFinalize" /> <RemoveExistingProducts After="InstallFinalize" />
</InstallExecuteSequence> </InstallExecuteSequence>
<InstallUISequence> <InstallUISequence>
<Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom> <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
{fix_wix} {fix_wix}
</InstallUISequence> </InstallUISequence>
<UI> <UI>
<UIRef Id="WixUI_Advanced" /> <UIRef Id="WixUI_Advanced" />
<Publish Dialog="ExitDialog" <Publish Dialog="ExitDialog"
Control="Finish" Control="Finish"
Event="DoAction" Event="DoAction"
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish> Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI> </UI>
<!-- <!--
Set default folder name and allow only per machine installs. Set default folder name and allow only per machine installs.
For a per-machine installation, the default installation location For a per-machine installation, the default installation location
will be [ProgramFilesFolder][ApplicationFolderName] and the user will be [ProgramFilesFolder][ApplicationFolderName] and the user
will be able to change it in the setup UI. This is no longer necessary 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 (i.e. per user installs should work) but left this way as I
dont want to deal with the complications dont want to deal with the complications
--> -->
<Property Id="ApplicationFolderName" Value="Calibre2" /> <Property Id="ApplicationFolderName" Value="Calibre2" />
<Property Id="WixAppFolder" Value="WixPerMachineFolder" /> <Property Id="WixAppFolder" Value="WixPerMachineFolder" />
<Property Id="ALLUSERS" Value="1" /> <Property Id="ALLUSERS" Value="1" />
<WixVariable Id="WixUISupportPerUser" Value="0" /> <WixVariable Id="WixUISupportPerUser" Value="0" />
<!-- Add option to launch calibre after install --> <!-- Add option to launch calibre after install -->
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch {app}" /> <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch {app}" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/> <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
<Property Id="WixShellExecTarget" Value="[#{exe_map[calibre]}]" /> <Property Id="WixShellExecTarget" Value="[#{exe_map[calibre]}]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes"/>
DllEntry="WixShellExec" Impersonate="yes"/>
</Product> </Product>
</Wix> </Wix>