Skip to content

Commit

Permalink
fix(bundler/nsis): auto append product name when choosing a new insta…
Browse files Browse the repository at this point in the history
…ll path (#9478)

* Fix picking install folder
doesn't auto append product name folder for nsis installer

* Add change file

* patch -> patch:enhance

* Update nsis-append-product-name.md
  • Loading branch information
Legend-Master authored Apr 22, 2024
1 parent a1e0e26 commit de7bcf3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/nsis-append-product-name.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tauri-bundler': 'patch:enhance'
---

Append product name automatically when choosing a new install path using browse for nsis installer
8 changes: 7 additions & 1 deletion tooling/bundler/src/bundle/windows/templates/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ Name "${PRODUCTNAME}"
BrandingText "${COPYRIGHT}"
OutFile "${OUTFILE}"

; We don't actually use this value as default install path,
; it's just for nsis to append the product name folder in the directory selector
; https://nsis.sourceforge.io/Reference/InstallDir
!define PLACEHOLDER_INSTALL_DIR "placeholder\${PRODUCTNAME}"
InstallDir "${PLACEHOLDER_INSTALL_DIR}"

VIProductVersion "${VERSIONWITHBUILD}"
VIAddVersionKey "ProductName" "${PRODUCTNAME}"
VIAddVersionKey "FileDescription" "${SHORTDESCRIPTION}"
Expand Down Expand Up @@ -388,7 +394,7 @@ Function .onInit

!insertmacro SetContext

${If} $INSTDIR == ""
${If} $INSTDIR == "${PLACEHOLDER_INSTALL_DIR}"
; Set default install location
!if "${INSTALLMODE}" == "perMachine"
${If} ${RunningX64}
Expand Down

0 comments on commit de7bcf3

Please sign in to comment.