Inno setup ISDone(错误)完成页

Inno setup ISDone(错误)完成页,inno-setup,pascalscript,Inno Setup,Pascalscript,我对ISdone库错误完成页有问题。 根据图书馆的要求,错误页面应为红色,如下所示: 但我没有得到红色: 我知道为什么会发生这种情况,这是因为对图像进行战略规划的代码。 现在,如果发生ISDone错误,如何获取FinishedLabel和FinishedHeadingLabel的红色 谢谢你 脚本: ;--由InnoSetup脚本Joiner版本3.0生成,2009年7月22日,(c)Bulat Zigansin。更多信息请访问http://issjoiner.codeplex.com/ ; -

我对ISdone库错误完成页有问题。 根据图书馆的要求,错误页面应为红色,如下所示:

但我没有得到红色:

我知道为什么会发生这种情况,这是因为对图像进行战略规划的代码。 现在,如果发生ISDone错误,如何获取
FinishedLabel
FinishedHeadingLabel
的红色

谢谢你

脚本:

;--由InnoSetup脚本Joiner版本3.0生成,2009年7月22日,(c)Bulat Zigansin。更多信息请访问http://issjoiner.codeplex.com/
; --- 资料来源:2.1------------------------------------------------------------
//Setup.ini内部
#定义MyAppName“游戏”
#定义MyAppVersion“2.0.0.0”
#定义MyAppPublisher“Dante1995”
#定义MyAppExeName“MyProg.exe”
#定义需求规模“5000000”
//仅限Arc,禁用预编译
;#定义预编译
[设置]
WizardSmallImageFile=Include\WizModernSmallImage.bmp
WizardImageFile=Include\WizModernImage-IS.bmp
AppName={#MyAppName}
AppVerName={#MyAppName}
AppPublisher={#MyAppPublisher}
AppVersion={#MyAppVersion}
DefaultDirName={pf}{MyAppPublisher}{{MyAppName}
OutputBaseFilename=设置
OutputDir=输出
压缩=压缩
InternalCompressLevel=Ultra64
SetupIconFile=include\icon.ico
卸载显示图标={uninstallexe}
VersionInfo版权={#MyAppPublisher}
#ifdef需要大小
ExtraDiskSpaceRequired={#NeedSize}
#恩迪夫
DisableWelcomePage=False
DisableProgramGroupPage=是
[语文]
名称:“默认”;MessagesFile:“编译器:Default.isl”
[任务]
名称:“桌面图标”;描述:“{cm:CreateDesktopIcon}”;GroupDescription:“{cm:AdditionalIcons}”;
名称:“快速启动图标”;描述:“{cm:CreateQuickLaunchIcon}”;GroupDescription:“{cm:AdditionalIcons}”;旗帜:未选中;
姓名:DX,;说明:安装Microsoft DirectX
姓名:VC,;描述:安装微软Visual C++ ReDIST
[图标]
名称:“{group}\Play{#MyAppName}”;文件名:“{app}\{#MyAppExeName}”;检查:检查错误
名称:“{group}\{cm:UninstallProgram,{#MyAppName}}”;文件名:“{uninstallexe}”;检查:检查错误
名称:“{commondesktop}\Play{#MyAppName}”;文件名:“{app}\{#MyAppExeName}”;检查:检查错误;任务:桌面图标
名称:{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}”;文件名:“{app}\{#MyAppExeName}”;检查:检查错误;任务:快速启动图标
[档案]
#ifdef预编译
来源:include\facompress.dll;DestDir:{tmp};标志:dontcopy
来源:include\CLS-precomp.dll;DestDir:{tmp};标志:dontcopy
来源:include\packjpg_dll.dll;DestDir:{tmp};标志:dontcopy
来源:include\packjpg_dll1.dll;DestDir:{tmp};标志:dontcopy
来源:include\precomp.exe;DestDir:{tmp};标志:dontcopy
来源:include\zlib1.dll;DestDir:{tmp};标志:dontcopy
#恩迪夫
#ifdef SrepInside
来源:include\CLS-srep.dll;DestDir:{tmp};标志:dontcopy
来源:include\cls.ini;DestDir:{tmp};标志:dontcopy
#恩迪夫
#ifdef理学硕士
来源:include\CLS-MSC.dll;DestDir:{tmp};标志:dontcopy
#恩迪夫
来源:include\English.ini;DestDir:{tmp};标志:dontcopy
来源:include\unarc.dll;DestDir:{tmp};标志:dontcopy
来源:include\ISDone.dll;DestDir:{tmp};标志:dontcopy
来源:include\CallbackCtrl.dll;标志:dontcopy noencryption noencryption
来源:include\arc.ini;DestDir:{tmp};标志:dontcopy
来源:“Setup.ini”;标志:dontcopy solidbreak;
[定制信息]
默认值:ORE=h
默认值。MINUTI=min
默认值。秒=秒
default.RIMANENTE=剩余时间:
default.ESTRAZIONE=提取的文件:
default.TTime=总提取时间:
默认值。已用时间=已用时间:
[删除]
类型:文件和目录;名称:“{app}”
类型:dirifempty;名称:{pf}\{#MyAppPublisher}
[留言]
默认值。SetupWindowTitle=%1
[守则]
变量
ElapsedTimeLbl,TotalTimeLbl,Percentuale,//回滚,
RemainingTimeBL,LabelCurrFileName:TLabel;
ISDoneCancel:整数;
ISDoneError:布尔型;
取消按钮:t按钮;
PBOldProc:长;
标题:字符串;
时间,时间:德沃德;
类型
#ifdef UNICODE
PChar=泛斯卡尔;
#恩迪夫
TCallback=函数(OveralPct,CurrentPct:integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar):长单词;
TPBProc=函数(h:hWnd;Msg,wParam,lParam:Longint):Longint;
函数SetWindowLong(hWnd:hWnd;nIndex:Integer;dwNewLong:Longint):Longint;外部的SetWindowLongA@user32.dllstdcall';
函数CallBackProc(P:TPBProc;ParamCount:integer):长单词;外部的wrapcallbackaddr@files:CallbackCtrl.dll stdcall';
函数CallWindowProc(lpPrevWndFunc:Longint;hWnd:hWnd;Msg:UINT;wParam,lParam:Longint):Longint;外部的CallWindowProcA@user32.dllstdcall';
函数GetTickCount:DWORD;外部的GetTickCount@kernel32.dllstdcall';
函数WrapCallback(callback:TCallback;paramcount:integer):长单词;外部的wrapcallback@files:ISDone.dll stdcall delayload';
函数ISDoneInit(记录文件名:AnsiString;时间类型,Comp1,Comp2,COM3:基数;WinHandle,NeededMem:longint;回调:TCallback):布尔;外部的ISDoneInit@files:ISDone.dll stdcall';
函数ISArcExtract(CurComponent:Cardinal;pcToToToTotal:double;InName,OutPath,ExtractedPath:AnsiString;DeleteInFile:boolean;Password,CfgFile,WorkPath:AnsiString;ExtractPCF:boolean):布尔;外部的ISArcExtract@files:ISDone.dll stdcall delayload';
函数为7ZipExtract(CurComponent:Cardinal;pcToToToTotal:double;InName,OutPath:Anistring;DeleteInFile:boolean;Password:Anistring):boolean;外部的IS7zipExtract@files:ISDone.dll stdcall delayload';
函数IsAreExtract(CurComponent:Cardinal;pcToToToTotal:double;InName,OutPath:AnsiString;DeleteInFile:boolean;Password:AnsiString):boolean;外部的ISRarExtract@files:ISDone.dll stdcall delayload';
函数isprempextract(CurComponent:Cardinal;pctoffotal:double;InName,OutFile:AnsiString;deleteinfle:boolean):布尔;外部的ISPrecompExtract@files:ISDone.dll stdcall delayload';
函数IsRepExtract(CurComponent:Cardinal;pcToToToTotal:double;InName,OutFile:AnsiString;DeleteInFile:boolean):boo
; --- Generated by InnoSetup Script Joiner version 3.0, Jul 22 2009, (c) Bulat Ziganshin <Bulat.Ziganshin@gmail.com>. More info at http://issjoiner.codeplex.com/

; --- Source: 2.iss ------------------------------------------------------------
// Setup.ini internal

#define MyAppName "Game"
#define MyAppVersion "2.0.0.0"
#define MyAppPublisher "Dante1995"
#define MyAppExeName "MyProg.exe"
#define NeedSize "5000000"
// only Arc, Disable PrecompInside
;#Define PrecompInside  

[Setup]
WizardSmallImageFile=Include\WizModernSmallImage.bmp
WizardImageFile=Include\WizModernImage-IS.bmp
AppName={#MyAppName}
AppVerName={#MyAppName}
AppPublisher={#MyAppPublisher}
AppVersion={#MyAppVersion}
DefaultDirName={pf}\{#MyAppPublisher}\{#MyAppName}
OutputBaseFilename=Setup
OutputDir=Output
Compression=zip
InternalCompressLevel=Ultra64
SetupIconFile=include\icon.ico
UninstallDisplayIcon={uninstallexe}
VersionInfoCopyright={#MyAppPublisher}
#ifdef NeedSize
ExtraDiskSpaceRequired={#NeedSize}
#endif

DisableWelcomePage=False
DisableProgramGroupPage=yes

[Languages]
Name: "default"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked;

Name: DX; Description: Install Microsoft DirectX
Name: VC; Description: Install Microsoft Visual C++ Redist

[Icons]
Name: "{group}\Play {#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: CheckError
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"; Check: CheckError
Name: "{commondesktop}\Play {#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: CheckError; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: CheckError; Tasks: quicklaunchicon

[Files]

#ifdef PrecompInside
Source: include\facompress.dll; DestDir: {tmp}; Flags: dontcopy
Source: include\CLS-precomp.dll; DestDir: {tmp}; Flags: dontcopy
Source: include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: include\packjpg_dll1.dll; DestDir: {tmp}; Flags: dontcopy
Source: include\precomp.exe; DestDir: {tmp}; Flags: dontcopy
Source: include\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef SrepInside
Source: include\CLS-srep.dll; DestDir: {tmp}; Flags: dontcopy
Source: include\cls.ini; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef MSC
Source: include\CLS-MSC.dll; DestDir: {tmp}; Flags: dontcopy
#endif
Source: include\English.ini; DestDir: {tmp}; Flags: dontcopy
Source: include\unarc.dll; DestDir: {tmp}; Flags: dontcopy
Source: include\ISDone.dll; DestDir: {tmp}; Flags: dontcopy
Source: include\CallbackCtrl.dll; Flags: dontcopy noencryption noencryption
Source: include\arc.ini; DestDir: {tmp}; Flags: dontcopy

Source: "Setup.ini"; Flags: dontcopy solidbreak;

[CustomMessages]
default.ORE=h
default.MINUTI=min
default.SECONDI=sec
default.RIMANENTE=Remaining Time:
default.ESTRAZIONE=Extracted Files:
default.TTime=Total Extraction Time :
default.Elapsed=Elapsed Time:

[UninstallDelete]
Type: filesandordirs; Name: "{app}"
Type: dirifempty; Name: "{pf}\{#MyAppPublisher}"

[Messages]
default.SetupWindowTitle=%1

[Code]

var
ElapsedTimeLbl,TotalTimeLbl,Percentuale,//RollingBack,
RemainingTimeLbl,LabelCurrFileName: TLabel;
ISDoneCancel:integer;
ISDoneError:boolean;
CancelBtn: TButton;
PBOldProc     : Longint;
WFCaption     : string;
eTime, sTime  : DWORD;

type
#ifdef UNICODE
 PChar = PAnsiChar;
#endif
TCallback = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
TPBProc = function (h:hWnd;Msg,wParam,lParam:Longint):Longint;


function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall';
function CallBackProc(P:TPBProc;ParamCount:integer):LongWord; external 'wrapcallbackaddr@files:CallbackCtrl.dll stdcall';
function CallWindowProc(lpPrevWndFunc: Longint; hWnd: HWND; Msg: UINT; wParam, lParam: Longint): Longint; external 'CallWindowProcA@user32.dll stdcall';
function GetTickCount: DWORD; external 'GetTickCount@kernel32.dll stdcall';
function WrapCallback(callback:TCallback; paramcount:integer):longword;external 'wrapcallback@files:ISDone.dll stdcall delayload';
function ISDoneInit(RecordFileName:AnsiString; TimeType,Comp1,Comp2,Comp3:Cardinal; WinHandle, NeededMem:longint; callback:TCallback):boolean; external 'ISDoneInit@files:ISDone.dll stdcall';
function ISArcExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath, ExtractedPath: AnsiString; DeleteInFile:boolean; Password, CfgFile, WorkPath: AnsiString; ExtractPCF: boolean ):boolean; external 'ISArcExtract@files:ISDone.dll stdcall delayload';
function IS7ZipExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean; external 'IS7zipExtract@files:ISDone.dll stdcall delayload';
function ISRarExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean; external 'ISRarExtract@files:ISDone.dll stdcall delayload';
function ISPrecompExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISPrecompExtract@files:ISDone.dll stdcall delayload';
function ISSRepExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISSrepExtract@files:ISDone.dll stdcall delayload';
function ISxDeltaExtract(CurComponent:Cardinal; PctOfTotal:double; minRAM,maxRAM:integer; InName, DiffFile, OutFile: AnsiString; DeleteInFile, DeleteDiffFile:boolean):boolean; external 'ISxDeltaExtract@files:ISDone.dll stdcall delayload';
function ISPackZIP(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString;ComprLvl:integer; DeleteInFile:boolean):boolean; external 'ISPackZIP@files:ISDone.dll stdcall delayload';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):boolean; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall delayload';
function Exec2 (FileName, Param: PAnsiChar;Show:boolean):boolean; external 'Exec2@files:ISDone.dll stdcall delayload';
function ISFindFiles(CurComponent:Cardinal; FileMask:AnsiString; var ColFiles:integer):integer; external 'ISFindFiles@files:ISDone.dll stdcall delayload';
function ISPickFilename(FindHandle:integer; OutPath:AnsiString; var CurIndex:integer; DeleteInFile:boolean):boolean; external 'ISPickFilename@files:ISDone.dll stdcall delayload';
function ISGetName(TypeStr:integer):PAnsichar; external 'ISGetName@files:ISDone.dll stdcall delayload';
function ISFindFree(FindHandle:integer):boolean; external 'ISFindFree@files:ISDone.dll stdcall delayload';
function ISExec(CurComponent:Cardinal; PctOfTotal,SpecifiedProcessTime:double; ExeName,Parameters,TargetDir,OutputStr:AnsiString;Show:boolean):boolean; external 'ISExec@files:ISDone.dll stdcall delayload';
function SrepInit(TmpPath:PAnsiChar;VirtMem,MaxSave:Cardinal):boolean; external 'SrepInit@files:ISDone.dll stdcall delayload';
function PrecompInit(TmpPath:PAnsiChar;VirtMem:cardinal;PrecompVers:single):boolean; external 'PrecompInit@files:ISDone.dll stdcall delayload';
function FileSearchInit(RecursiveSubDir:boolean):boolean; external 'FileSearchInit@files:ISDone.dll stdcall delayload';
function ISDoneStop:boolean; external 'ISDoneStop@files:ISDone.dll stdcall';
function ChangeLanguage(Language:AnsiString):boolean; external 'ChangeLanguage@files:ISDone.dll stdcall delayload';
function SuspendProc:boolean; external 'SuspendProc@files:ISDone.dll stdcall';
function ResumeProc:boolean; external 'ResumeProc@files:ISDone.dll stdcall';

function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
begin
if OveralPct<=Wizardform.ProgressGauge.Max then
Wizardform.Progressgauge.Position := OveralPct;
Result := ISDoneCancel;
TotalTimeLbl.Caption:=ExpandConstant('{cm:TTime}')+TimeStr2;
with WizardForm.ProgressGauge do begin
LabelCurrFileName.Caption:=SetupMessage(msgStatusExtractFiles)+': '+MinimizePathName(CurrentFile, LabelCurrFileName.Font, LabelCurrFileName.Width-ScaleX(100));
end;
end;

function LongintToStringTime(t:Longint):string;
var
h,m,s:integer;
begin
h:=t div 3600;
t:=t-h*3600;
m:=t div 60;
s:=t-m*60;
Result:='';
if h>0 then Result:=Result+IntToStr(h)+ ExpandConstant(' {cm:ORE} ');
if (m>0) or (h>0) then Result:=Result+IntToStr(m)+ExpandConstant(' {cm:MINUTI} ');
if (m>0) or (h>0) or (s>0) then Result:=Result+IntToStr(s)+ExpandConstant(' {cm:SECONDI} ');
end;

function PBProc(h:hWnd;Msg,wParam,lParam:Longint):Longint;
var
R,A:Longint;
dt,at,pr,i1,i2:Extended;
p:string;
tc:DWORD;
begin
Result:=CallWindowProc(PBOldProc,h,Msg,wParam,lParam);
if (Msg=$402) and (WizardForm.ProgressGauge.Position>WizardForm.ProgressGauge.Min) then begin
i1:=WizardForm.ProgressGauge.Position-WizardForm.ProgressGauge.Min;
i2:=WizardForm.ProgressGauge.Max-WizardForm.ProgressGauge.Min;
tc:=GetTickCount;
if (tc-eTime)>=1000 then begin
dt:=(tc-sTime)/1000;
at:=i2*dt/i1;
R:=Round(at-dt)
A:=Round(dt)
RemainingTimeLbl.Caption:=ExpandConstant('{cm:RIMANENTE} ')+LongintToStringTime(R);
ElapsedTimeLbl.Caption:=ExpandConstant('{cm:Elapsed} ')+LongintToStringTime(A);
eTime:=tc;
end;
pr:=i1*100/i2;
p:=''+Format('%f',[pr])+'%';
StringChange(p,',','.');
Percentuale.Caption:=WFCaption+p;
end;
end;

procedure AllCancel;
begin
SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc);
Percentuale.Caption:=WFCaption;
end;

procedure CancelButtonOnClick(Sender: TObject);
begin
SuspendProc;
//RollingBack.Show;
if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then ISDoneCancel:=1;
ResumeProc;
//RollingBack.Hide;
end;

procedure HideControls;
begin
CancelBtn.Hide;
LabelCurrFileName.Hide;
RemainingTimeLbl.Hide;
ElapsedTimeLbl.Hide;
end;

procedure InitializeWizard1();
begin

WizardForm.ProgressGauge.Top := ScaleY(46);

ElapsedTimeLbl := TLabel.Create(WizardForm);
with ElapsedTimeLbl do begin
Parent := WizardForm.InstallingPage;
Font.Size:=10;
Font.Color:=clYellow;
Font.Style := [fsBold];
Font.Name:='calibri';
SetBounds(0,90,WizardForm.ClientWidth-40,14);
end;

RemainingTimeLbl:=TLabel.Create(WizardForm);
with RemainingTimeLbl do begin
Parent:=WizardForm.InstallingPage;
SetBounds(216,90,WizardForm.ClientWidth-40,14);
Font.Size:=10;
Font.Color:=clYellow;
Font.Style := [fsBold];
Font.Name:='calibri';
end;

Percentuale := TLabel.Create(WizardForm);
with Percentuale do begin
Parent:= WizardForm.InstallingPage;
SetBounds(150,130,WizardForm.ClientWidth-40,14);
Font.Size:=20;
Font.Color:=clYellow;
Font.Style := [fsBold];
Font.Name:='calibri';
end;

CancelBtn := TButton.Create(WizardForm);
with CancelBtn do begin
Name := 'Cancel';
Parent := WizardForm;
Left := WizardForm.CancelButton.Left;
Top := WizardForm.CancelButton.Top;
Width := WizardForm.CancelButton.Width;
Height := WizardForm.CancelButton.Height;
OnClick:=@CancelButtonOnClick;
Font.Size:=8;
Font.Name:='calibri';
end;

LabelCurrFileName := TLabel.Create(WizardForm);
with LabelCurrFileName do begin
Parent   := WizardForm.InstallingPage;
AutoSize := False;
Width    := WizardForm.ProgressGauge.Width+ScaleX(30);
Left     := ScaleX(0);
Top      := ScaleY(30);
Font.Size:=8;
Font.Color:=clYellow;
Font.Name:='calibri';
end;

TotalTimeLbl := TLabel.Create(WizardForm);
with TotalTimeLbl do begin
Parent   := WizardForm.FinishedPage;
AutoSize := False;
Width    := 300;
Left     := 180;
Top      := 200;
Font.Size:=14;
Font.Color:=clYellow;
Font.Style := [fsBold];
Font.Name:='calibri';
Height := 35;
end;
end;

procedure CurPageChanged1(CurPageID: integer);
begin
HideControls;
if CurPageID=wpWelcome then
begin
end;
if CurPageID=wpSelectDir then
begin
end;

if CurPageID=wpInstalling then
begin
CancelBtn.Show;
LabelCurrFileName.Show;
RemainingTimeLbl.Show;
ElapsedTimeLbl.Show;
end;

if CurPageID=wpFinished then
begin
RemainingTimeLbl.Hide;
AllCancel;
HideControls;
end;

if (CurPageID = wpFinished) and ISDoneError then
begin
WizardForm.Caption:= SetupMessage(msgErrorTitle);
WizardForm.FinishedLabel.Font.Color:= clRed;
WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted);
end;
end;

function CheckError:boolean;
begin
result:= not ISDoneError;
end;

procedure CurStepChanged1(CurStep: TSetupStep);
var
res, i, ResultCode: integer;
Arc1, Arc2: Array of String;
begin

If CurStep = ssInstall then begin
WizardForm.StatusLabel.Caption:='Installing The Game...';

sTime:=GetTickCount;
eTime:=sTime;
PBOldProc:=SetWindowLong(WizardForm.ProgressGauge.Handle,-4,CallBackProc(@PBProc,4));

#ifdef PrecompInside
ExtractTemporaryFile('CLS-precomp.dll');
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('packjpg_dll1.dll');
ExtractTemporaryFile('precomp.exe');
ExtractTemporaryFile('zlib1.dll');
ExtractTemporaryFile('facompress.dll');
#endif
#ifdef SrepInside
ExtractTemporaryFile('CLS-srep.dll');
#endif
#ifdef MSC
ExtractTemporaryFile('CLS-MSC.dll');
#endif
ExtractTemporaryFile('arc.ini');
ExtractTemporaryFile('unarc.dll');
ExtractTemporaryFile('English.ini');

ISDoneError:=false;
i:=1;
if (GetIniString('FreearcFile' + IntToStr(i),'Archive','',ExpandConstant('{tmp}\Setup.ini')) <> '') then
begin
WizardForm.ProgressGauge.Max:=0;
repeat
WizardForm.ProgressGauge.Max:= WizardForm.ProgressGauge.Max + 1000;
i:= i + 1;
until (GetIniString('FreearcFile' + IntToStr(i),'Archive','',ExpandConstant('{tmp}\Setup.ini')) = '');
end;
if ISDoneInit(ExpandConstant('{tmp}\records.inf'), $F777, 0,0,0, MainForm.Handle, 512, @ProgressCallback) then begin
repeat
ChangeLanguage('English');
if not SrepInit('',512,0) then ISDoneError := True;
if not PrecompInit('',128,0) then ISDoneError := True;
if not FileSearchInit(true) then ISDoneError := True;
i:=1;
if (GetIniString('FreearcFile' + IntToStr(i),'Archive','',ExpandConstant('{tmp}\Setup.ini')) <> '') then
begin
SetArrayLength(Arc1,4);
SetArrayLength(Arc2,4);
repeat
Arc1[0]:=ExpandConstant(GetIniString('FreearcFile' + IntToStr(i),'Archive','',ExpandConstant('{tmp}\Setup.ini')));
Arc1[1]:=ExpandConstant(GetIniString('FreearcFile' + IntToStr(i),'Output','',ExpandConstant('{tmp}\Setup.ini')));
Arc1[2]:=ExpandConstant(GetIniString('FreearcFile' + IntToStr(i),'Disk','1',ExpandConstant('{tmp}\Setup.ini')));
if Arc1[0] <> '' then
begin
if not FileExists(Arc1[0]) then
begin
if MsgBox(SetupMessage(msgChangeDiskTitle) +'  '+'( '+ Arc1[2]+' )', mbError, MB_OKCANCEL) = IDCANCEL then ISDoneError := True;
end else begin
if not ISArcExtract( 0, 0, Arc1[0], Arc1[1], '', false, Arc1[3], ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}'), False) then ISDoneError := True;
i:= i + 1;
end;
end;
until ((GetIniString('FreearcFile' + IntToStr(i),'Archive','',ExpandConstant('{tmp}\Setup.ini')) = '') or (ISDoneError = True));
end;
until true;
ISDoneStop;
end;
AllCancel;
HideControls;
WizardForm.ProgressGauge.Hide;
end;
if (CurStep=ssPostInstall) and ISDoneError then begin
WizardForm.StatusLabel.Caption:=SetupMessage(msgStatusRollback);
TotalTimeLbl.Caption:='';
Exec(ExpandConstant('{uninstallexe}'), '/VERYSILENT','', sw_Hide, ewWaitUntilTerminated, ResultCode);
end;
end;

function InitializeSetup1: Boolean;

var
Uninstall,Location: string;
ResultCode: Integer;
begin
if not FileExists(ExpandConstant('{tmp}\CallbackCtrl.dll')) then ExtractTemporaryFile('CallbackCtrl.dll');
ExtractTemporaryFile('Setup.ini');
if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppName}_is1','UninstallString', Uninstall) then
Uninstall:=RemoveQuotes(Uninstall);
begin
if not Exec(Uninstall, ' /SILENT', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppName}_is1','InstallLocation', Location);
end;
Result:=True;
end;








[Setup]


; --- Source: 3.iss ------------------------------------------------------------

[code]
var
  WelcomeLabel1, WelcomeLabel2, FinishedLabel, FinishedHeadingLabel: TLabel;
  PageNameLabel, PageDescriptionLabel: TLabel;

procedure InitializeWizard2();
begin
  WizardForm.WizardBitmapImage.Width := ScaleX(497);
  WizardForm.WizardBitmapImage2.Width := ScaleX(497);

  { WelcomeLabel1 }
  WizardForm.WelcomeLabel1.Hide;
  WelcomeLabel1 := TLabel.Create(WizardForm);
  with WizardForm.WelcomeLabel1 do
  begin
    WelcomeLabel1.Parent := Parent;
    WelcomeLabel1.SetBounds(Left, Top, Width, Height);
    WelcomeLabel1.AutoSize := AutoSize;
    WelcomeLabel1.Font := Font;
    WelcomeLabel1.Font.Color := clWhite;
    WelcomeLabel1.Transparent := True;
    WelcomeLabel1.WordWrap := WordWrap;
    WelcomeLabel1.Caption := Caption;
  end;

  { WelcomeLabel2 }
  WizardForm.WelcomeLabel2.Hide;
  WelcomeLabel2 := TLabel.Create(WizardForm);
  with WizardForm.WelcomeLabel2 do
  begin
    WelcomeLabel2.Parent := Parent;
    WelcomeLabel2.SetBounds(Left, Top, Width, Height);
    WelcomeLabel2.AutoSize := AutoSize;
    WelcomeLabel2.Font := Font;
    WelcomeLabel2.Font.Color := clWhite;
    WelcomeLabel2.Transparent := True;
    WelcomeLabel2.WordWrap := WordWrap;
    WelcomeLabel2.Caption := Caption;
  end;

  WizardForm.WizardSmallBitmapImage.SetBounds(ScaleX(0), ScaleY(0), WizardForm.MainPanel.Width, WizardForm.MainPanel.Height);

  { PageNameLabel }
  WizardForm.PageNameLabel.Hide;
  PageNameLabel := TLabel.Create(WizardForm);
  with WizardForm.PageNameLabel do
  begin
    PageNameLabel.Parent := Parent;
    PageNameLabel.SetBounds(Left, Top, Width, Height);
    PageNameLabel.AutoSize := AutoSize;
    PageNameLabel.Font := Font;
    PageNameLabel.Font.Color := clYellow;
    PageNameLabel.Transparent := True;
    PageNameLabel.WordWrap := WordWrap;
  end;

  { PageDescriptionLabel }
  WizardForm.PageDescriptionLabel.Hide;
  PageDescriptionLabel:= TLabel.Create(WizardForm);
  with WizardForm.PageDescriptionLabel do
  begin
    PageDescriptionLabel.Parent := Parent;
    PageDescriptionLabel.SetBounds(Left, Top, Width, Height);
    PageDescriptionLabel.AutoSize := AutoSize;
    PageDescriptionLabel.Font := Font;
    PageDescriptionLabel.Font.Color := clYellow;
    PageDescriptionLabel.Transparent := True;
    PageDescriptionLabel.WordWrap := WordWrap;
  end;

  { FinishedHeadingLabel }
  WizardForm.FinishedHeadingLabel.Hide;
  FinishedHeadingLabel := TLabel.Create(WizardForm);
  with WizardForm.FinishedHeadingLabel do
  begin
    FinishedHeadingLabel.Parent := Parent;
    FinishedHeadingLabel.SetBounds(Left, Top, Width, Height);
    FinishedHeadingLabel.AutoSize := AutoSize;
    FinishedHeadingLabel.Font := Font;
    FinishedHeadingLabel.Font.Color := clWhite;
    FinishedHeadingLabel.Transparent := True;
    FinishedHeadingLabel.WordWrap := WordWrap;
    FinishedHeadingLabel.Caption := Caption;
  end;

  { FinishedLabel }
  WizardForm.FinishedLabel.Hide;
  FinishedLabel := TLabel.Create(WizardForm);
  with WizardForm.FinishedLabel do
  begin
    FinishedLabel.Parent := Parent;
    FinishedLabel.SetBounds(Left, Top, Width, Height);
    FinishedLabel.AutoSize := AutoSize;
    FinishedLabel.Font := Font;
    FinishedLabel.Font.Color := clWhite;
    FinishedLabel.Transparent := True;
    FinishedLabel.WordWrap := WordWrap;
  end;
end;

procedure CurPageChanged2(CurPageID: Integer);
begin
  begin
    PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
    PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
    FinishedLabel.Caption := WizardForm.FinishedLabel.Caption;
  end;
  if (CurPageID = wpFinished) and ISDoneError then
  begin
  WizardForm.Caption:= SetupMessage(msgErrorTitle);
  WizardForm.FinishedLabel.Font.Color:= clRed;
  WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted);
  end;
end;
[Setup]


; --- Dispatching code ------------------------------------------------------------

[Code]

procedure InitializeWizard();
begin
  InitializeWizard1();
  InitializeWizard2();
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  CurPageChanged1(CurPageID);
  CurPageChanged2(CurPageID);
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  CurStepChanged1(CurStep);
end;

function InitializeSetup(): Boolean;
begin
  Result := InitializeSetup1(); if not Result then exit;
end;
with WizardForm.FinishedLabel do begin
    FinishedLabel.Parent:=WizardForm.FinishedPage;
    ....
end;
if (CurPageID = wpFinished) and ISDoneError then
begin
    WizardForm.Caption:= SetupMessage(msgErrorTitle);
    FinishedLabel.Font.Color:= clRed;
    WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted);
end;
procedure CurPageChanged2(CurPageID: Integer);
begin
  begin
    PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
    PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
    FinishedLabel.Caption := WizardForm.FinishedLabel.Caption;
  end;
  if (CurPageID = wpFinished) and ISDoneError then
  begin
  WizardForm.Caption:= SetupMessage(msgErrorTitle);
  FinishedLabel.Font.Color:= clRed; // changed
  FinishedHeadingLabel.Font.Color:= clRed; // changed
  WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted);
  end;
end;