Search code examples
installationprogress-barinno-setuppascalscript

Inno Setup: How to manipulate progress bar on Registering section?


Just like my question in Inno Setup: How to manipulate progress bar on Run section?, which Martin Prikryl gave me an excellent suggestion, I want to do the same (change the style of the progress gauge) in the registering section, I mean, just before the Run section, when Inno Setup registers the DLLs / OCXs (regserver flag in [Files]).

I tried using some of the PageID to make it work, which I think is the wpInstalling one, comparing it to when it values goes to 100, it changes to Marquee style, but I didn't make it work.

Thanks a lot.


Solution

  • There's no event that is triggered before the registration.


    The closest you can get is using AfterInstall parameter of the last installed file (not the .dll):

    [Files]
    Source: "mydll.dll"; DestDir: "{app}"; Flags: regserver
    Source: "myfile1"; DestDir: "{app}"
    Source: "myfile2"; DestDir: "{app}"
    ...
    Source: "myfileN"; DestDir: "{app}"; AfterInstall: AfterLastFileInstall
    
    [Code]
    
    procedure AfterLastFileInstall;
    begin
      Log('Last file installed, file registration is starting');
      WizardForm.ProgressGauge.Style := npbstMarquee;
    end;
    

    Another option is to handle CurInstallProgressChanged event and wait for CurProgress = MaxProgress:

    [Code] 
    
    procedure CurInstallProgressChanged(CurProgress, MaxProgress: Integer);
    begin
      if CurProgress >= MaxProgress then
      begin
        Log('Everything is installed, file registration is starting');
        WizardForm.ProgressGauge.Style := npbstMarquee;
      end;
    end;