I have a script that works well. But now I want to add to it a custom page that prompts the user to select a folder. Here is the function for that page:
Var varSelectedFolder ; global var - defined before any section, page or function
LangString PAGE_TITLE ${LANG_ENGLISH} "Title"
LangString PAGE_SUBTITLE ${LANG_ENGLISH} "Subtitle"
Function PageDirSelect
!insertmacro MUI_HEADER_TEXT $(PAGE_TITLE) $(PAGE_SUBTITLE)
nsDialogs::SelectFolderDialog /NOUNLOAD "Select Folder" "$DOCUMENTS"
Pop $varSelectedFolder ;where selected folder string is returned
; Check A Folder Has Been Selected
${If} $varSelectedFolder == "error"
MessageBox MB_OK "You must select a folder a folder. Aborting."
Abort ; Cancel Installation
${Else}
${EndIf}
nsDialogs::Show
FunctionEnd The custom page is simply inserted between the version checking (custom) page and the MUI_PAGE_INSTFILES.!ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
Page custom PageReinstall PageLeaveReinstall
!endif
Page custom PageDirSelect
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH Again, when I comment out the Page custom line, the script works and finishes fine.But with the Page custom code, the script never reaches the finish page!
This is beyond me. Clearly there is something wrong that I am doing in the custom page function (PageDirSelect). But what is it?
That function is so simple... I am lost.😕
Any help, clue or insight would be deeply appreciated.
Thanks!
P.S. Is it possible that I need a leave function for this custom page? Must I have a leave function even when a page is that simple? (if so, why?)