浏览代码

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

Lucas Fernandes Nogueira 3 年之前
父节点
当前提交
72e577dcc6
共有 2 个文件被更改,包括 10 次插入1 次删除
  1. 5 0
      .changes/fix-windows-downgrades.md
  2. 5 1
      tooling/bundler/src/bundle/windows/templates/main.wxs

+ 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}}