[desktop] Update tauri Wix template

This commit is contained in:
Vladimir Stoilov 2024-07-16 11:25:40 +03:00
parent 273b16c523
commit 090a5e6508
No known key found for this signature in database
GPG key ID: 2F190B67A43A81AF
3 changed files with 43 additions and 9 deletions

View file

@ -4,6 +4,9 @@
<?elseif $(sys.BUILDARCH)="x64"?> <?elseif $(sys.BUILDARCH)="x64"?>
<?define Win64 = "yes" ?> <?define Win64 = "yes" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?> <?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?elseif $(sys.BUILDARCH)="arm64"?>
<?define Win64 = "yes" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else?> <?else?>
<?error Unsupported value of sys.BUILDARCH=$(sys.BUILDARCH)?> <?error Unsupported value of sys.BUILDARCH=$(sys.BUILDARCH)?>
<?endif?> <?endif?>
@ -28,7 +31,11 @@
<!-- https://docs.microsoft.com/en-us/windows/win32/msi/reinstallmode --> <!-- https://docs.microsoft.com/en-us/windows/win32/msi/reinstallmode -->
<!-- reinstall all files; rewrite all registry entries; reinstall all shortcuts --> <!-- reinstall all files; rewrite all registry entries; reinstall all shortcuts -->
<Property Id="REINSTALLMODE" Value="amus" /> <Property Id="REINSTALLMODE" Value="amus" />
<Property Id="MsiLogging" Value="v" />
<!-- Auto launch app after installation, useful for passive mode which usually used in updates -->
<Property Id="AUTOLAUNCHAPP" Secure="yes" />
<!-- Property to forward cli args to the launched app to not lose those of the pre-update instance -->
<Property Id="LAUNCHAPPARGS" Secure="yes" />
{{#if allow_downgrades}} {{#if allow_downgrades}}
<MajorUpgrade Schedule="afterInstallInitialize" AllowDowngrades="yes" /> <MajorUpgrade Schedule="afterInstallInitialize" AllowDowngrades="yes" />
@ -57,6 +64,12 @@
<Property Id="ARPNOREPAIR" Value="yes" Secure="yes" /> <!-- Remove repair --> <Property Id="ARPNOREPAIR" Value="yes" Secure="yes" /> <!-- Remove repair -->
<SetProperty Id="ARPNOMODIFY" Value="1" After="InstallValidate" Sequence="execute"/> <SetProperty Id="ARPNOMODIFY" Value="1" After="InstallValidate" Sequence="execute"/>
{{#if homepage}}
<Property Id="ARPURLINFOABOUT" Value="{{homepage}}"/>
<Property Id="ARPHELPLINK" Value="{{homepage}}"/>
<Property Id="ARPURLUPDATEINFO" Value="{{homepage}}"/>
{{/if}}
<!-- initialize with previous InstallDir --> <!-- initialize with previous InstallDir -->
<Property Id="INSTALLDIR"> <Property Id="INSTALLDIR">
<RegistrySearch Id="PrevInstallDirReg" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Name="InstallDir" Type="raw"/> <RegistrySearch Id="PrevInstallDirReg" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Name="InstallDir" Type="raw"/>
@ -65,8 +78,7 @@
<!-- launch app checkbox --> <!-- launch app checkbox -->
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="!(loc.LaunchApp)" /> <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="!(loc.LaunchApp)" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/> <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
<Property Id="WixShellExecTarget" Value="[!Path]" /> <CustomAction Id="LaunchApplication" Impersonate="yes" FileKey="Path" ExeCommand="[LAUNCHAPPARGS]" Return="asyncNoWait" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<UI> <UI>
<!-- launch app checkbox --> <!-- launch app checkbox -->
@ -328,10 +340,15 @@
</Custom> </Custom>
</InstallExecuteSequence> </InstallExecuteSequence>
{{/if}} {{/if}}
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize"/>
<CustomActionRef Id='InstallPortmasterService' /> <CustomActionRef Id='InstallPortmasterService' />
<CustomActionRef Id='StopPortmasterService' /> <CustomActionRef Id='StopPortmasterService' />
<CustomActionRef Id='DeletePortmasterService' /> <CustomActionRef Id='DeletePortmasterService' />
<InstallExecuteSequence>
<Custom Action="LaunchApplication" After="InstallFinalize">AUTOLAUNCHAPP AND NOT Installed</Custom>
</InstallExecuteSequence>
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize"/>
</Product> </Product>
</Wix> </Wix>

View file

@ -4,6 +4,9 @@
<?elseif $(sys.BUILDARCH)="x64"?> <?elseif $(sys.BUILDARCH)="x64"?>
<?define Win64 = "yes" ?> <?define Win64 = "yes" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?> <?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?elseif $(sys.BUILDARCH)="arm64"?>
<?define Win64 = "yes" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else?> <?else?>
<?error Unsupported value of sys.BUILDARCH=$(sys.BUILDARCH)?> <?error Unsupported value of sys.BUILDARCH=$(sys.BUILDARCH)?>
<?endif?> <?endif?>
@ -29,6 +32,11 @@
<!-- reinstall all files; rewrite all registry entries; reinstall all shortcuts --> <!-- reinstall all files; rewrite all registry entries; reinstall all shortcuts -->
<Property Id="REINSTALLMODE" Value="amus" /> <Property Id="REINSTALLMODE" Value="amus" />
<!-- Auto launch app after installation, useful for passive mode which usually used in updates -->
<Property Id="AUTOLAUNCHAPP" Secure="yes" />
<!-- Property to forward cli args to the launched app to not lose those of the pre-update instance -->
<Property Id="LAUNCHAPPARGS" Secure="yes" />
{{#if allow_downgrades}} {{#if allow_downgrades}}
<MajorUpgrade Schedule="afterInstallInitialize" AllowDowngrades="yes" /> <MajorUpgrade Schedule="afterInstallInitialize" AllowDowngrades="yes" />
{{else}} {{else}}
@ -56,6 +64,12 @@
<Property Id="ARPNOREPAIR" Value="yes" Secure="yes" /> <!-- Remove repair --> <Property Id="ARPNOREPAIR" Value="yes" Secure="yes" /> <!-- Remove repair -->
<SetProperty Id="ARPNOMODIFY" Value="1" After="InstallValidate" Sequence="execute"/> <SetProperty Id="ARPNOMODIFY" Value="1" After="InstallValidate" Sequence="execute"/>
{{#if homepage}}
<Property Id="ARPURLINFOABOUT" Value="{{homepage}}"/>
<Property Id="ARPHELPLINK" Value="{{homepage}}"/>
<Property Id="ARPURLUPDATEINFO" Value="{{homepage}}"/>
{{/if}}
<!-- initialize with previous InstallDir --> <!-- initialize with previous InstallDir -->
<Property Id="INSTALLDIR"> <Property Id="INSTALLDIR">
<RegistrySearch Id="PrevInstallDirReg" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Name="InstallDir" Type="raw"/> <RegistrySearch Id="PrevInstallDirReg" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Name="InstallDir" Type="raw"/>
@ -64,8 +78,7 @@
<!-- launch app checkbox --> <!-- launch app checkbox -->
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="!(loc.LaunchApp)" /> <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="!(loc.LaunchApp)" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/> <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
<Property Id="WixShellExecTarget" Value="[!Path]" /> <CustomAction Id="LaunchApplication" Impersonate="yes" FileKey="Path" ExeCommand="[LAUNCHAPPARGS]" Return="asyncNoWait" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<UI> <UI>
<!-- launch app checkbox --> <!-- launch app checkbox -->
@ -328,6 +341,10 @@
</InstallExecuteSequence> </InstallExecuteSequence>
{{/if}} {{/if}}
<InstallExecuteSequence>
<Custom Action="LaunchApplication" After="InstallFinalize">AUTOLAUNCHAPP AND NOT Installed</Custom>
</InstallExecuteSequence>
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize"/> <SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize"/>
</Product> </Product>
</Wix> </Wix>