CPack/NSIS: Fix PATH modification without "bin" directory

Previously our NSIS project template hard-coded `$INSTDIR\bin` for
inclusion in the `PATH`.  If the directory does not exist, nothing is
done.  Use `CPACK_NSIS_EXECUTABLES_DIRECTORY` instead of `bin`.

Fixes: #15635
This commit is contained in:
Pedro López-Cabanillas
2026-08-28 11:18:18 -04:00
committed by Brad King
parent 3773fb5a46
commit 6b695daab8
+2 -2
View File
@@ -742,7 +742,7 @@ Section "-Core installation"
SectionEnd
Section "-Add to path"
Push $INSTDIR\bin
Push $INSTDIR\@CPACK_NSIS_EXECUTABLES_DIRECTORY@
StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 doNotAddToPath
StrCmp $DO_NOT_ADD_TO_PATH "1" doNotAddToPath 0
Call AddToPath
@@ -902,7 +902,7 @@ Section "Uninstall"
DeleteRegKey /ifempty SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@"
Push $INSTDIR\bin
Push $INSTDIR\@CPACK_NSIS_EXECUTABLES_DIRECTORY@
StrCmp $DO_NOT_ADD_TO_PATH_ "1" doNotRemoveFromPath 0
Call un.RemoveFromPath
doNotRemoveFromPath: