Automated translation of wxs file for wix 4

This commit is contained in:
Kovid Goyal 2023-10-10 10:29:43 +05:30
parent 85d899461d
commit a4237b7814
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1,13 +1,6 @@
<?xml version='1.0' encoding='utf-8'?> <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<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}' Language='1033' Codepage='1252' Version='{version}' Manufacturer='Kovid Goyal'> <Package Name="{app}{x64}" UpgradeCode="{upgrade_code}" Language="1033" Codepage="1252" Version="{version}" Manufacturer="Kovid Goyal" InstallerVersion="300"><SummaryInformation Keywords="Installer" Description="{app} Installer" Manufacturer="Kovid Goyal" />
<Package Id='*' Keywords='Installer' Description="{app} Installer"
Comments='{app} is a registered trademark of Kovid Goyal' Manufacturer='Kovid Goyal'
InstallerVersion='300' Languages='1033' Compressed='yes'
SummaryCodepage='1252' />
<!-- Disable creation of system restore points on calibre installs. Speeds <!-- Disable creation of system restore points on calibre installs. Speeds
up the install. We dont need system restore since we dont install any up the install. We dont need system restore since we dont install any
@ -24,7 +17,7 @@
should always result in a consistent set of files being present in the should always result in a consistent set of files being present in the
installation folder, though of course, with Microsoft there are no installation folder, though of course, with Microsoft there are no
guarantees of anything. --> guarantees of anything. -->
<Property Id='REINSTALLMODE' Value='amus'/> <Property Id="REINSTALLMODE" Value="amus" />
<!-- get the windows build number --> <!-- get the windows build number -->
<Property Id="WINDOWSBUILDNUMBER" Secure="yes"> <Property Id="WINDOWSBUILDNUMBER" Secure="yes">
@ -32,60 +25,37 @@
</Property> </Property>
<Upgrade Id="{upgrade_code}"> <Upgrade Id="{upgrade_code}">
<UpgradeVersion Maximum="{version}" <UpgradeVersion Maximum="{version}" IncludeMaximum="yes" OnlyDetect="no" Language="1033" MigrateFeatures="yes" Property="OLDPRODUCTFOUND" />
IncludeMaximum="yes" <UpgradeVersion Minimum="{version}" IncludeMinimum="no" OnlyDetect="yes" Language="1033" Property="NEWPRODUCTFOUND" />
OnlyDetect="no"
Language="1033"
MigrateFeatures="yes"
Property="OLDPRODUCTFOUND"/>
<UpgradeVersion Minimum="{version}"
IncludeMinimum="no"
OnlyDetect="yes"
Language="1033"
Property="NEWPRODUCTFOUND"/>
</Upgrade> </Upgrade>
<Upgrade Id="BEB2A80D-E902-4DAD-ADF9-8BD2DA42CFE1"> <Upgrade Id="BEB2A80D-E902-4DAD-ADF9-8BD2DA42CFE1">
<UpgradeVersion Maximum="{version}" <UpgradeVersion Maximum="{version}" IncludeMaximum="yes" OnlyDetect="no" Language="1033" MigrateFeatures="yes" Property="THIRTYTWOBITINSTALLFOUND" />
IncludeMaximum="yes"
OnlyDetect="no"
Language="1033"
MigrateFeatures="yes"
Property="THIRTYTWOBITINSTALLFOUND"/>
</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='ProgramFiles64Folder' Name='PFiles'>
<Directory Id='APPLICATIONFOLDER' Name="Calibre2" />
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="{app}{x64} - E-book Management"/>
</Directory>
<Directory Id="DesktopFolder" Name="Desktop"/>
</Directory>
<Icon Id="main_icon" SourceFile="{main_icon}"/> <Icon Id="main_icon" SourceFile="{main_icon}" />
<!-- <Icon Id="viewer_icon" SourceFile="{viewer_icon}"/> --> <!-- <Icon Id="viewer_icon" SourceFile="{viewer_icon}"/> -->
<!-- <Icon Id="editor_icon" SourceFile="{editor_icon}"/> --> <!-- <Icon Id="editor_icon" SourceFile="{editor_icon}"/> -->
<DirectoryRef Id="APPLICATIONFOLDER"> <DirectoryRef Id="APPLICATIONFOLDER">
{app_components} {app_components}
<Component Id="AddToPath" Guid="*"> <Component Id="AddToPath">
<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">
<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>
<Component Id="calibreProtocol" Guid="*"> <Component Id="calibreProtocol">
<RegistryKey Root="HKCR" Key="calibre" ForceDeleteOnUninstall="yes"> <RegistryKey Root="HKCR" Key="calibre" ForceDeleteOnUninstall="yes">
<RegistryValue Type="string" Value="URL:calibre Protocol" KeyPath="yes"/> <RegistryValue Type="string" Value="URL:calibre Protocol" KeyPath="yes" />
<RegistryValue Type="string" Name="URL Protocol" Value=""/> <RegistryValue Type="string" Name="URL Protocol" Value="" />
<RegistryKey Key="DefaultIcon"> <RegistryKey Key="DefaultIcon">
<RegistryValue Type="string" Value="[APPLICATIONFOLDER]calibre.exe" /> <RegistryValue Type="string" Value="[APPLICATIONFOLDER]calibre.exe" />
</RegistryKey> </RegistryKey>
@ -97,115 +67,81 @@
</DirectoryRef> </DirectoryRef>
<DirectoryRef Id="ApplicationProgramsFolder"> <DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="StartMenuShortcuts" Guid="*"> <Component Id="StartMenuShortcuts">
<Shortcut Id="s1" Name="{app}{x64} - E-book management" <Shortcut Id="s1" Name="{app}{x64} - E-book management" Description="Manage your e-book collection, read or edit your e-books and download news" Target="[#{exe_map[calibre]}]" WorkingDirectory="APPLICATIONROOTDIRECTORY" />
Description="Manage your e-book collection, read or edit your e-books and download news" <Shortcut Id="s2" Name="E-book viewer{x64}" Description="Viewer for all the major e-book formats" Target="[#{exe_map[ebook-viewer]}]" WorkingDirectory="APPLICATIONROOTDIRECTORY" />
Target="[#{exe_map[calibre]}]" <Shortcut Id="s4" Name="Edit E-book{x64}" Description="Edit e-books" Target="[#{exe_map[ebook-edit]}]" WorkingDirectory="APPLICATIONROOTDIRECTORY" />
WorkingDirectory="APPLICATIONROOTDIRECTORY" /> <Shortcut Id="s3" Name="LRF viewer{x64}" Description="Viewer for LRF format e-books" Target="[#{exe_map[lrfviewer]}]" WorkingDirectory="APPLICATIONROOTDIRECTORY" />
<Shortcut Id="s2" Name="E-book viewer{x64}" <util:InternetShortcut Id="OnlineDocumentationShortcut" Name="User Manual" Type="url" Target="https://manual.calibre-ebook.com" />
Description="Viewer for all the major e-book formats" <util:InternetShortcut Id="GetInvolvedS" Name="Get Involved" Type="url" Target="https://calibre-ebook.com/get-involved" />
Target="[#{exe_map[ebook-viewer]}]"
WorkingDirectory="APPLICATIONROOTDIRECTORY" />
<Shortcut Id="s4" Name="Edit E-book{x64}"
Description="Edit e-books"
Target="[#{exe_map[ebook-edit]}]"
WorkingDirectory="APPLICATIONROOTDIRECTORY" />
<Shortcut Id="s3" Name="LRF viewer{x64}"
Description="Viewer for LRF format e-books"
Target="[#{exe_map[lrfviewer]}]"
WorkingDirectory="APPLICATIONROOTDIRECTORY" />
<util:InternetShortcut Id="OnlineDocumentationShortcut"
Name="User Manual" Type="url"
Target="https://manual.calibre-ebook.com"/>
<util:InternetShortcut Id="GetInvolvedS"
Name="Get Involved" Type="url"
Target="https://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"> <StandardDirectory Id="DesktopFolder">
<Component Id="DesktopShortcut" Guid="*"> <Component Id="DesktopShortcut">
<Shortcut Id="ds1" Name="{app}{x64} - E-book management" <Shortcut Id="ds1" Name="{app}{x64} - E-book management" Description="Manage your e-book collection, read or edit your e-books and download news" Target="[#{exe_map[calibre]}]" WorkingDirectory="APPLICATIONROOTDIRECTORY" />
Description="Manage your e-book collection, read or edit your e-books and download news" <RegistryValue Root="HKCU" Key="Software\Microsoft\{app}{x64}" Name="desktop_shortcut_installed" Type="integer" Value="1" KeyPath="yes" />
Target="[#{exe_map[calibre]}]"
WorkingDirectory="APPLICATIONROOTDIRECTORY" />
<RegistryValue Root="HKCU" Key="Software\Microsoft\{app}{x64}" Name="desktop_shortcut_installed" Type="integer" Value="1" KeyPath="yes"/>
</Component> </Component>
</DirectoryRef> </StandardDirectory>
<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}" AllowAbsent="no">
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 Id="FcalibreProtocol" Title="Register calibre:// URLs" Level="1" <Feature Id="FcalibreProtocol" Title="Register calibre:// URLs" Level="1" Description="Register to handle URLs starting with calibre://">
Description="Register to handle URLs starting with calibre://"> <ComponentRef Id="calibreProtocol" />
<ComponentRef Id="calibreProtocol"/>
</Feature> </Feature>
</Feature> </Feature>
<!-- Add icon to entry in Add/Remove programs --> <!-- Add icon to entry in Add/Remove programs -->
<Property Id="ARPPRODUCTICON" Value="main_icon" /> <Property Id="ARPPRODUCTICON" Value="main_icon" />
<Property Id="ARPURLINFOABOUT" Value="https://calibre-ebook.com" /> <Property Id="ARPURLINFOABOUT" Value="https://calibre-ebook.com" />
<Property Id='ARPHELPLINK' Value="https://calibre-ebook.com/help" /> <Property Id="ARPHELPLINK" Value="https://calibre-ebook.com/help" />
<Property Id='ARPURLUPDATEINFO' Value="https://calibre-ebook.com/download_windows" /> <Property Id="ARPURLUPDATEINFO" Value="https://calibre-ebook.com/download_windows" />
<SetProperty Id="ARPINSTALLLOCATION" Value="[APPLICATIONFOLDER]" After="CostFinalize" /> <SetProperty Id="ARPINSTALLLOCATION" Value="[APPLICATIONFOLDER]" After="CostFinalize" />
<Condition Message="calibre requires Windows 10 or newer."> <!-- See https://en.wikipedia.org/wiki/Windows_10_version_history for build numbers -->
<!-- See https://en.wikipedia.org/wiki/Windows_10_version_history for build numbers -->
<![CDATA[Installed OR (WINDOWSBUILDNUMBER >= 10240)]]> <Launch Condition="Installed OR (WINDOWSBUILDNUMBER &gt;= 10240)" Message="calibre requires Windows 10 or newer." />
</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" Property="WixPerMachineFolder" Value="[APPLICATIONFOLDER]" Execute="immediate" />
Id="OverwriteWixSetDefaultPerMachineFolder"
Property="WixPerMachineFolder"
Value="[APPLICATIONFOLDER]"
Execute="immediate"
/>
<InstallExecuteSequence> <InstallExecuteSequence>
<Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom> <Custom Action="PreventDowngrading" After="FindRelatedProducts" Condition="NEWPRODUCTFOUND" />
<Custom Action="OverwriteWixSetDefaultPerMachineFolder" After="WixSetDefaultPerMachineFolder" /> <Custom Action="OverwriteWixSetDefaultPerMachineFolder" After="WixSetDefaultPerMachineFolder" />
<RemoveExistingProducts After="InstallFinalize" /> <RemoveExistingProducts After="InstallFinalize" />
</InstallExecuteSequence> </InstallExecuteSequence>
<InstallUISequence> <InstallUISequence>
<Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom> <Custom Action="PreventDowngrading" After="FindRelatedProducts" Condition="NEWPRODUCTFOUND" />
<Custom Action="OverwriteWixSetDefaultPerMachineFolder" After="WixSetDefaultPerMachineFolder" /> <Custom Action="OverwriteWixSetDefaultPerMachineFolder" After="WixSetDefaultPerMachineFolder" />
</InstallUISequence> </InstallUISequence>
<UI> <UI>
<UIRef Id="WixUI_Advanced" /> <ui:WixUI Id="WixUI_Advanced" />
<UIRef Id="WixUI_ErrorProgressText" /> <UIRef Id="WixUI_ErrorProgressText" />
<Publish Dialog="ExitDialog" <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication" Condition="WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed" />
Control="Finish"
Event="DoAction"
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI> </UI>
@ -224,9 +160,17 @@
<!-- 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" DllEntry="WixShellExec" Impersonate="yes"/> <CustomAction Id="LaunchApplication" DllEntry="WixShellExec" Impersonate="yes" BinaryRef="Wix4UtilCA_X86" />
</Product>
<StandardDirectory Id="ProgramFiles64Folder">
<Directory Id="APPLICATIONFOLDER" Name="Calibre2" />
</StandardDirectory>
<StandardDirectory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="{app}{x64} - E-book Management" />
</StandardDirectory>
<StandardDirectory Id="DesktopFolder" />
</Package>
</Wix> </Wix>