Search code examples
installationinno-setuppascalscript

Getting text from FinishedLabel in Inno Setup


I'm trying to create a TLabel and get text from FinishedLabel to show transparency on text when show a custom background image on Finished Page.

I make the same with FinishedHeadingLabel and works perfectly, But it does not work with FinishedLabel, here is the code:

BottomFinishedLabel := TLabel.Create(WizardForm);
BottomFinishedLabel.Parent := WizardForm.FinishedLabel.Parent;
BottomFinishedLabel.Font := WizardForm.FinishedLabel.Font;
BottomFinishedLabel.Caption := WizardForm.FinishedLabel.Caption;
BottomFinishedLabel.WordWrap := WizardForm.FinishedLabel.WordWrap;
InheritBoundsRect(WizardForm.FinishedLabel, BottomFinishedLabel);
WizardForm.FinishedLabel.Visible := False;

This is what it show:

enter image description here

And this is what I'm trying to do (with TLabel):
enter image description here


Solution

  • You probably copy the text too early.

    The FinishedLabel is set only after CurStepChanged(ssPostInstall).

    I.e. earliest you can read it is in CurPageChanged(wpFinished) (or in ShouldSkipPage(wpFinished)).


    If you know what variant of the text shows, you can also read msgFinishedRestartLabel, msgFinishedLabel or msgFinishedLabelNoIcons + msgClickFinish using SetupMessage.