Reputation: 1586
My goal with Inno Setup 6.x is to customize the FinishedLabel
text in code, i.e., Pascal Script. The reason why I'm using Pascal Script is that I want to only customize/change the label if IsAdminMode()
is true. How can I do that?
The following two approaches do not work:
Use a scripted constant:
[Messages]
FinishedLabel={code:GetFinishedLabel}
[Code]
function GetFinishedLabel(Param: String): String;
begin
Result := 'BLA';
end;
This shows "{code:GetFinishedLabel}" rather than "BLA".
Customize the wizard in InitializeWizard
.
Complete (failing) example:
[Code]
procedure InitializeWizard();
begin
WizardForm.FinishedLabel.Caption := 'BLA';
end;
The FinishLabel
still shows the original text from Default.isl
Any ideas?
Upvotes: 3
Views: 584
Reputation: 469
The FinishedLabel
is updated at the end of the installation according to various factors. So your value set in InitializeWizard
is overridden. You have to set your custom message later, such as in CurPageChanged(wpFinished)
:
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
WizardForm.FinishedLabel.Caption := 'BLA';
end;
end;
You might consider to improve the code to do what Inno Setup would do, like:
FinishedRestartLabel
);FinishedLabel
vs. FinishedLabelNoIcons
);RunList
position according to the message height.Upvotes: 3