При установке в папке назначения по умолчанию отображается путь «C: \ Program Files (x86) \ DllTesting \» (как и ожидалось).
введите описание изображения здесь
Затем я попытался изменить путь на «C: \ Program Files \ AppTest»
Но из окна «Обзор» один разЯ выбрал вышеуказанный путь и нажал «ОК», он показывает «C: \ Program Files \ AppTest \ DllTesting» вместо «C: \ Program Files \ AppTest»
введите описание изображения здесь Когда я удаляю «DllTesting» из приведенного ниже пути, он корректно отображает новый путь без добавления старого.
InstallDir $ PROGRAMFILES \ DllTesting
Но я не могуудалите «DllTesting» из указанного выше пути, потому что по умолчанию я должен отобразить путь «C: \ Program Files (x86) \ DllTesting \»
Ниже приведен мой фрагмент кода:
; DllTesting.nsi
;
;--------------------------------
!include LogicLib.nsh
Name "DllTesting"
OutFile "DllTesting.exe"
InstallDir $PROGRAMFILES\DllTesting
InstallDirRegKey HKLM "Software\NSIS_DllTesting" "Install_Dir"
RequestExecutionLevel admin
; Pages
Page components
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
;--------------------------------
; The stuff to install
Section "DllTesting (required)"
SetOutPath $INSTDIR
; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\NSIS_DllTesting "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DllTesting" "DisplayName" "NSIS DllTesting"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DllTesting" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DllTesting" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DllTesting" "NoRepair" 1
WriteUninstaller "uninstall.exe"
SectionEnd
Пожалуйста, помогите мне, как изменить путь из обзора, не добавляя к предыдущему пути?