Skip to content

Commit 72748cc

Browse files
authored
fix(windows): Resolve broken installation directory handling in MSI & NSIS, preventing duplicate installations during updates (#12365)
1 parent cf771bf commit 72748cc

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
tauri-bundler: 'patch:bug'
3+
---
4+
5+
Fixed an issue that caused the `.msi` installer not to lookup the `INSTALLDIR` set in the `nsis` installer.

crates/tauri-bundler/src/bundle/windows/msi/main.wxs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,12 @@
7070
<Property Id="ARPURLUPDATEINFO" Value="{{homepage}}"/>
7171
{{/if}}
7272

73-
<!-- initialize with previous InstallDir -->
7473
<Property Id="INSTALLDIR">
75-
<RegistrySearch Id="PrevInstallDirReg" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Name="InstallDir" Type="raw"/>
74+
<!-- First attempt: Search for "InstallDir" -->
75+
<RegistrySearch Id="PrevInstallDirWithName" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Name="InstallDir" Type="raw" />
76+
77+
<!-- Second attempt: If the first fails, search for the default key value (this is how the nsis installer currently stores the path) -->
78+
<RegistrySearch Id="PrevInstallDirNoName" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Type="raw" />
7679
</Property>
7780

7881
<!-- launch app checkbox -->

0 commit comments

Comments
 (0)