소스 검색

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