Ver Fonte

fix(bundler): wix upgrade do not installing new files, closes #4182

Lucas Nogueira há 3 anos atrás
pai
commit
8539e02f7f

+ 5 - 0
.changes/fix-wix-upgrade.md

@@ -0,0 +1,5 @@
+---
+"tauri-bundler": patch
+---
+
+Fixes lost files on upgrade due to wrong implementation to keep shortcuts.

+ 5 - 1
tooling/bundler/src/bundle/windows/templates/main.wxs

@@ -30,11 +30,15 @@
         <Property Id="REINSTALLMODE" Value="dmus" />
 
         {{#if allow_downgrades}}
-            <MajorUpgrade AllowDowngrades="yes" Schedule="afterInstallExecute" />
+            <MajorUpgrade AllowDowngrades="yes" Schedule="afterInstallValidate" />
         {{else}}
             <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeErrorMessage)" AllowSameVersionUpgrades="yes" />
         {{/if}}
 
+        <InstallExecuteSequence>
+            <RemoveShortcuts>Installed AND NOT UPGRADINGPRODUCTCODE</RemoveShortcuts>
+        </InstallExecuteSequence>
+
         <Media Id="1" Cabinet="app.cab" EmbedCab="yes" />
 
         {{#if banner_path}}