Inno Setup personaliza FinishedLabel con Pascal Script
Mi objetivo con Inno Setup 6.x es personalizar el FinishedLabeltexto en código, es decir, Pascal Script. La razón por la que estoy usando Pascal Script es que solo quiero personalizar / cambiar la etiqueta si IsAdminMode()es verdadera. ¿Cómo puedo hacer eso?
Los dos enfoques siguientes no funcionan:
Utilice una constante con script:
[Messages] FinishedLabel={code:GetFinishedLabel}[Code] function GetFinishedLabel(Param: String): String; begin Result := 'BLA'; end;Esto muestra "{código: GetFinishedLabel}" en lugar de "BLA".
Personaliza el asistente en formato
InitializeWizard.Complete (failing) example:
[Code] procedure InitializeWizard(); begin WizardForm.FinishedLabel.Caption := 'BLA'; end;The
FinishLabelstill shows the original text fromDefault.isl
Any ideas?
Respuestas
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:
- Taking into account, if restart is needed (
FinishedRestartLabel); - Taking into account, if icons were created (
FinishedLabelvs.FinishedLabelNoIcons); - Adjusting the label height to fit the message;
- Shifting
RunListposition according to the message height.