Search code examples
windowsinno-setuppascalscript

Inno Setup: How to change uninstall background color


I'm trying to figure out how to change the background color of the bottom panel in the UNINSTALLER to match the colors I was able to set for the INSTALLER using information I found here: Inno Setup: How to change background color Unfortunately, I have been unable to find any way to extend that answer to include the uninstall page, too. It works great for the install, but when I test the uninstall I see this:

Ugly output example

In the installer, when the background color of the lower pane changed, the background of the beveled label changed with it, but I cannot find a similar setting for the uninstaller. I looked at the list of CurPageID values and none seem related to the uninstaller, though I would expect it to either be listed or use the same settings as the installer. Sadly, neither seem to be true.

Can anyone please explain the right way to do this? Thanks!

EDIT: For anyone who doesn't want to look at the code from the linked article, here's the way it looks right now in my project:

procedure CurPageChanged(CurPageID: Integer);
begin
  WizardForm.Color := WizardForm.InnerPage.Color;
end;

procedure InitializeWizard;
begin
  WizardForm.Color := clWhite;
end;

I originally tried it without commenting out the lines in CurPageChanged, then I thought, why not ALWAYS set the color on a page change. Still, the uninstall pages have a gray lower pane. Apparently, the code doesn't affect them and/or they are not WizardForm pages.

EDIT: When asked to show the code I had tried, I added the block of code as it looked at the time. That block included some commented out lines that were part of previous attempts. Someone here decided that those previous attempts were NOT needed and removed them from my post. So may I ask, "Why is SOME of my failed code appropriate but other parts of it are not? Or should I post every single individual version of the functions in the 20-something times I tweaked them before giving up and asking my question?"


Solution

  • Uninstaller equivalent of InitializeWizard is InitializeUninstallProgressForm:

    procedure InitializeUninstallProgressForm();
    begin
      UninstallProgressForm.Color := clWhite;
    end;
    

    enter image description here


    An equivalent of CurPageChanged is CurUninstallStepChanged. The UninstallProgressForm is not available in initial usAppMutexCheck and final usDone steps.

    Though you should use the InitializeUninstallProgressForm as shown above anyway.