Skip a built-in page using a custom page?
I'm trying to make a custom uninstall page using InstallOptions 2. Well - actually, I'm succeeding in doing that, but not in making it do what I want:
On this custom uninstall page, I give the user two options using radiobuttons. The page works, and the radiobuttons appear, but it doesn't do what I want it to do.
This is what I want to happen:
If one option is chosen, the uninstall is to go on as usual, no change.
If the other option is chosen, I want the uninstall process to essentially be skipped, replacing the uninstall process with only removing a few files and some registry entries, instead of going through all the uninstall Sections.
So I have tried a couple of things in order to make this happen, but it doesn't quite work.
As mentioned, the custom uninstall page does appear, it looks how I want it to look, but it doesn't seem to do much.
So in my latest attempt, I have instead made a custom function with the page commands in it. I have then used this function in a !define MUI_PAGE_CUSTOMFUNCTION_PRE before the !insertmacro MUI_UNPAGE_INSTFILES in order to skip it.
What this did, was to show the custom page, but then all three buttons on the custom page were greyed out (Back, Uninstall and Cancel), so I was forced to do a Ctrl+Alt+Delete to quit the uninstaller process.
Before that, I have tried to just make an UninstPage custom, which calls Abort if a certain option is chosen, but that doesn't make the uninstaller skip the next built-in page (which is the UNPAGE_INSTFILES page).
Here's how the function that caused the buttons to be greyed out looks:
LangString TEXT_IO_HEADER ${LANG_ENGLISH} "Please decide what you will do next:"
LangString TEXT_IO_SUBHEADER ${LANG_ENGLISH} "-Are you going to uninstall the game as well?"
Function un.QuickUninstall ;Used to skip uninstall page
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_HEADER)" "$(TEXT_IO_SUBHEADER)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "UninstallOptions.ini"
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "UninstallOptions.ini" "Field 2" "STATE"
StrCmp $R0 1 done
messagebox MB_OK "Here is where it's supposed to skip the page and remove a few registry entries."
Abort
done:
FunctionEnd
Then in the uninstall macros it looks like this:
!define MUI_PAGE_CUSTOMFUNCTION_PRE un.QuickUninstall
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
The messagebox will be replaced by the code to remove the registry entries and few files I want to remove when that option is chosen, once I get this script to work the way I want.
Again - I have also tried the other route by making a Page custom above the UNPAGE_INSTFILES, but it didn't do anything either: the message box appears, but when I click OK, the uninstall continues as usual. I want it to "jump over" the uninstall process when that option is chosen, and replace that with only removing a few files and registry entries instead.
All the script attempts I have made have been compiled without warnings, so the scripts "work" in that sense.
Hope you are able to understand what I want to do.
I know how to skip pages and have done that before, but not from a custom page like this.
Is it possible somehow?