Skip to content

Commit

Permalink
fix(windows): Resolve broken installation directory handling in MSI &…
Browse files Browse the repository at this point in the history
… NSIS, preventing duplicate installations during updates (#12365)
  • Loading branch information
don41382 authored Jan 17, 2025
1 parent cf771bf commit 72748cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-bundler-msi-install-dir-lookup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
tauri-bundler: 'patch:bug'
---

Fixed an issue that caused the `.msi` installer not to lookup the `INSTALLDIR` set in the `nsis` installer.
7 changes: 5 additions & 2 deletions crates/tauri-bundler/src/bundle/windows/msi/main.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,12 @@
<Property Id="ARPURLUPDATEINFO" Value="{{homepage}}"/>
{{/if}}

<!-- initialize with previous InstallDir -->
<Property Id="INSTALLDIR">
<RegistrySearch Id="PrevInstallDirReg" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Name="InstallDir" Type="raw"/>
<!-- 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) -->
<RegistrySearch Id="PrevInstallDirNoName" Root="HKCU" Key="Software\\{{manufacturer}}\\{{product_name}}" Type="raw" />
</Property>

<!-- launch app checkbox -->
Expand Down

0 comments on commit 72748cc

Please sign in to comment.