Skip to content

Commit de7bcf3

Browse files
fix(bundler/nsis): auto append product name when choosing a new install 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
1 parent a1e0e26 commit de7bcf3

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.changes/nsis-append-product-name.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'tauri-bundler': 'patch:enhance'
3+
---
4+
5+
Append product name automatically when choosing a new install path using browse for nsis installer

tooling/bundler/src/bundle/windows/templates/installer.nsi

+7-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ Name "${PRODUCTNAME}"
4848
BrandingText "${COPYRIGHT}"
4949
OutFile "${OUTFILE}"
5050

51+
; We don't actually use this value as default install path,
52+
; it's just for nsis to append the product name folder in the directory selector
53+
; https://nsis.sourceforge.io/Reference/InstallDir
54+
!define PLACEHOLDER_INSTALL_DIR "placeholder\${PRODUCTNAME}"
55+
InstallDir "${PLACEHOLDER_INSTALL_DIR}"
56+
5157
VIProductVersion "${VERSIONWITHBUILD}"
5258
VIAddVersionKey "ProductName" "${PRODUCTNAME}"
5359
VIAddVersionKey "FileDescription" "${SHORTDESCRIPTION}"
@@ -388,7 +394,7 @@ Function .onInit
388394

389395
!insertmacro SetContext
390396

391-
${If} $INSTDIR == ""
397+
${If} $INSTDIR == "${PLACEHOLDER_INSTALL_DIR}"
392398
; Set default install location
393399
!if "${INSTALLMODE}" == "perMachine"
394400
${If} ${RunningX64}

0 commit comments

Comments
 (0)