Reputation: 856
In my code I use NSD_CreateDirRequest
to set path to folder. When I use browse button it work good. But when I change directory manually it doesn't work.
Ex. I choose this directory using Browse button:
C:\Users\User\Desktop\Folder
And when I change directory manually to:
C:\Users\User\Desktop\Folder2
And press next, it't still old directory: C:\Users\User\Desktop\Folder
How to fix it?
My code:
${NSD_CreateDirRequest} 0 22u 84% 12u "Choose directory"
Pop $Dir
${NSD_SetText} $Dir $DirApp
${NSD_CreateBrowseButton} 85% 22u 15% 12u "Choose"
Pop $BrowseButton
${NSD_OnClick} $BrowseButton OnBrowseForDir
Function OnBrowseForDir
nsDialogs::SelectFolderDialog /NOUNLOAD "Directory"
Pop $0
${If} $0 == error
${Else}
StrCpy $DirApp $0
${NSD_SetText} $Dir $DirApp
${EndIf}
FunctionEnd
Upvotes: 2
Views: 947
Reputation: 11465
You need to read explicitely the value of the directory, for example in a page leaving callback:
Page custom CustomPageName LeaveCallback
# ...
Function LeaveCallback
${NSD_GetText} $Dir $DirApp
FunctionEnd
Upvotes: 1