Explorar o código

fix(bundler): properly reinstall files on MSI downgrades, closes #3868 (#4044)

Lucas Fernandes Nogueira %!s(int64=3) %!d(string=hai) anos
pai
achega
72e577dcc6

+ 5 - 0
.changes/fix-windows-downgrades.md

@@ -0,0 +1,5 @@
+---
+"tauri-bundler": patch
+---
+
+Fix app downgrades when using the Windows installer.

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

@@ -25,8 +25,12 @@
                  InstallScope="perMachine"
                  SummaryCodepage="!(loc.TauriCodepage)"/>
 
+        <!-- https://docs.microsoft.com/en-us/windows/win32/msi/reinstallmode -->
+        <!-- force all files to be reinstalled; rewrite all registry entries; reinstall all shortcuts -->
+        <Property Id="REINSTALLMODE" Value="amus" />
+
         {{#if allow_downgrades}}
-            <MajorUpgrade AllowDowngrades="yes" />
+            <MajorUpgrade AllowDowngrades="yes" Schedule="afterInstallInitialize" />
         {{else}}
             <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeErrorMessage)" AllowSameVersionUpgrades="yes" />
         {{/if}}