inno-setupuninstallationcustom-pages

Display custom page at the end of uninstallation


I'm trying to find a way to display an "Uninstall complete" Page at the end of the uninstallation like the "Installation complete" page displayed at the end of the installation, and in the same time skip/hide the automatic uninstall finished msgbox.

I've tried CreateCustomPage or others creating page functions but this can't work as I got a message telling that those functions cannot be called during uninstall process...

So, is there a way to display (and take control of) such a page?

Or do I have to deal with the only uninstall finished msgbox?

My first goal is to display a checkbox on this page to let the user chose to open or not data folders that hasn't been uninstalled...


Solution

  • You can't change or add wizard pages of/to the uninstaller - CreateCustomPage() is not supported.

    But you could show custom forms with CreateCustomForm() (instead of CreateCustomPage) and ShowModal() and display message boxes with MsgBox(), like so

    [Code]
    procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
    begin
      if CurUninstallStep = usPostUninstall then
      begin
        // this is MsgBox will display after uninstall
        if MsgBox('Go to data folder?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES then       
        begin
          // add some code to open the explorer with the folder here
          Exec(ExpandConstant('{win}\explorer.exe'), 'c:\data\folder', '', SW_SHOW, ewNoWait, ResultCode);
        end;
      end;
    end;
    

    If you want to display checkboxes, then CreateCustomForm() is the way to go.