fix(bundler): swap WIX registry search order to prioritize InstallDir (#14945)

This commit is contained in:
Varun Chawla
2026-02-16 08:34:58 -08:00
committed by GitHub
parent 2d0b80eb1c
commit 6252432f07
2 changed files with 13 additions and 4 deletions

View File

@@ -0,0 +1,5 @@
---
"tauri-bundler": patch:bug
---
Fix WIX installer registry search order so that the named `InstallDir` key takes priority over the NSIS default key, preventing install location from changing on updates.

View File

@@ -70,12 +70,16 @@
<Property Id="ARPURLUPDATEINFO" Value="{{homepage}}"/>
{{/if}}
<!-- NOTE: The order of RegistrySearch elements below matters. In WIX, when multiple
RegistrySearch elements are listed under a single Property, the LAST successful
match wins. We list the NSIS default-key search first and the MSI InstallDir
search second so that the MSI-specific path takes priority when both keys exist. -->
<Property Id="INSTALLDIR">
<!-- First attempt: Search for "InstallDir" -->
<RegistrySearch Id="PrevInstallDirWithName" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Name="InstallDir" Type="raw" />
<!-- Second attempt: If the first fails, search for the default key value (this is how the nsis installer currently stores the path) -->
<!-- First attempt: Search for the default key value (this is how the nsis installer stores the path) -->
<RegistrySearch Id="PrevInstallDirNoName" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Type="raw" />
<!-- Second attempt: Search for "InstallDir" which takes priority if found (this is how the msi installer stores the path) -->
<RegistrySearch Id="PrevInstallDirWithName" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Name="InstallDir" Type="raw" />
</Property>
<!-- launch app checkbox -->