I have a requirement to configure an unknown number of (call them) customers at install time.
It could be as few as one, it could be as may as a couple of dozen.
The customer names are hashed, and, of course, no collisions can be allowed, so it cannot be simple list, each name has to checked on entry and validated.
I have come up with a brute-force approach, involving a "finish" check box, and "delete/un-delete" radio buttons, storing data in a bunch of arrays, and a quick bit of python to spit out a hundred page functions and invocations, but it's fiddly, and I don't trust it.
It's been a while since I've worked with NSIS, is there something I have missed that I can use here?
Just to reiterate it is at RUN TIME I have to handle multiple entries, not build time.
Thoughts? Comments? Ideas?
Unknown number of pages at run time...
4 posts
Unlimited number of custom pages in a row is possible, if you need other pages you might have to try the jump to/skip a page code on the wiki...
Page Custom customCreate customLeave
Page InstFiles
!include nsDialogs.nsh
!include LogicLib.nsh
var custOk
Function customCreate
again:
StrCpy $custOk 0
nsDialogs::Create 1018
System::Call kernel32::GetTickCount()i.r0
${NSD_CreateLabel} 0 0 100% 24u "Customer $0"
GetDlgItem $0 $hwndparent 1
SendMessage $0 ${WM_SETTEXT} 0 "STR:$(^NextBtn)"
nsDialogs::Show
${If} $custOk <> 0
MessageBox MB_YesNo Again? IDYES again
${EndIf}
FunctionEnd
Function customLeave
StrCpy $custOk 1
FunctionEnd
Oh, of course, so obvious once you see it!
Or, did I ever really know that the "leave" function is (effectively) called by "nsDialogs::Show", as opposed to being an attribute of the entire "page'd" function?
I don't suppose there is any way to determine if Prev or Next have been clicked?
Or, did I ever really know that the "leave" function is (effectively) called by "nsDialogs::Show", as opposed to being an attribute of the entire "page'd" function?
I don't suppose there is any way to determine if Prev or Next have been clicked?
The leave callback is only called when you click next.