Skip to content

Commit 61bbd83

Browse files
authored
fix(bundler/wix): Add AUTOLAUNCHAPP and LAUNCHAPPARGS public properties (#10117)
1 parent 6c9e24a commit 61bbd83

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
tauri-bundler: patch:enhance
3+
---
4+
5+
Added a public property to the msi to tell the installer to launch the app after installation. This was added for the updater plugin.

tooling/bundler/src/bundle/windows/templates/main.wxs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
<!-- reinstall all files; rewrite all registry entries; reinstall all shortcuts -->
3030
<Property Id="REINSTALLMODE" Value="amus" />
3131

32+
<!-- Auto launch app after installation, useful for passive mode which usually used in updates -->
33+
<Property Id="AUTOLAUNCHAPP" Secure="yes" />
34+
<!-- Property to forward cli args to the launched app to not lose those of the pre-update instance -->
35+
<Property Id="LAUNCHAPPARGS" Secure="yes" />
36+
3237
{{#if allow_downgrades}}
3338
<MajorUpgrade Schedule="afterInstallInitialize" AllowDowngrades="yes" />
3439
{{else}}
@@ -70,8 +75,7 @@
7075
<!-- launch app checkbox -->
7176
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="!(loc.LaunchApp)" />
7277
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
73-
<Property Id="WixShellExecTarget" Value="[!Path]" />
74-
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
78+
<CustomAction Id="LaunchApplication" Impersonate="yes" FileKey="Path" ExeCommand="[LAUNCHAPPARGS]" Return="asyncNoWait" />
7579

7680
<UI>
7781
<!-- launch app checkbox -->
@@ -334,6 +338,10 @@
334338
</InstallExecuteSequence>
335339
{{/if}}
336340

341+
<InstallExecuteSequence>
342+
<Custom Action="LaunchApplication" After="InstallFinalize">AUTOLAUNCHAPP AND NOT Installed</Custom>
343+
</InstallExecuteSequence>
344+
337345
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize"/>
338346
</Product>
339347
</Wix>

0 commit comments

Comments
 (0)