I have a small bootstrapper with custom UI, which contains two pages, one to configure the install, and the other showing a progressbar for the download and install of the payload. My problem: If the user presses Enter key when in the second page, the installer exits, even if it didn't finish installing.
I removed all the controls I could from the UI with:
GetDlgItem $1 $HWNDPARENT 1 //(2, and 3)
System::Call `User32::DestroyWindow(i $1)`
in the onGuiInit function, and the first page ignores enter and space keys now, but the second page still exits on Enter key. I have no other components on that page except some labels, a progressbar, and a slideshow (nsisSlideshow plugin). In the background I have a thread which downloads and installs the payload.
The pages are declared like this:
Page Custom Options_Show Options_Leave
Page Custom Progress_Show Progress_Leave
So, long story short, when I press enter, the nsDialogs::Show function returns, killing the installer.
Any way I can stop it from doing this?
You really should try to stop forward page changes by calling
Abortin the page leave callback function.NSIS only blocks clicks from buttons that exist and are disabled.