Пользователь
Сообщения: 128
Благодарности: 22
|
Профиль
|
Отправить PM
| Цитировать
Привет всем, прогресс бар идет поверх "процентов" (Pct). как его сделать поверх прогресс бара
скрипт
читать дальше »
#define MyAppName "Battlefield 3"
#define NeedSize 23140
;#define records
[Setup]
AppName={#MyAppName}
DefaultDirName={pf}\Origin Games\{#MyAppName}
OutputBaseFilename=Touchup
Compression=lzma/ultra64
SolidCompression=true
DisableReadyPage=true
SetupIconFile=Files\app.ico
Uninstallable=false
CreateUninstallRegKey=false
UpdateUninstallLogAppName=false
VersionInfoVersion=1.6.0.0
AppVerName={#MyAppName}
UsePreviousGroup=false
AppendDefaultGroupName=false
DisableProgramGroupPage=true
VersionInfoCompany=Electronic Arts, Inc.
VersionInfoDescription=EA Installer Touchup
VersionInfoCopyright=(C) 2013 MaratRepack
InternalCompressLevel=ultra64
[Files]
Source: dll\b2p.dll; Flags: dontcopy
Source: dll\botva2.dll; Flags: dontcopy
Source: dll\gdiplus.dll; Flags: dontcopy
Source: Files\Button.png; Flags: dontcopy
Source: Files\dir.png; Flags: dontcopy
Source: Files\edit.png; Flags: dontcopy
Source: Files\exit.png; Flags: dontcopy
Source: Files\min.png; Flags: dontcopy
Source: Files\pb.png; Flags: dontcopy
Source: Files\pb1.png; Flags: dontcopy
Source: Files\2work1.jpg; Flags: dontcopy
Source: Files\2work2.jpg; Flags: dontcopy
Source: Files\2work5.jpg; Flags: dontcopy
Source: Files\2work6.jpg; Flags: dontcopy
Source: Files\2workerror.jpg; Flags: dontcopy
Source: ISDone\unarc.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone\ISDone.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone\facompress.dll; DestDir: {tmp}; Flags: dontcopy
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif
[Messages]
ButtonNext=Äàëåå
ButtonCancel=Îòìåíà
ButtonBack=Íàçàä
ButtonWizardBrowse=Èçìåíèòü
SetupAppTitle=EA Installer Touchup
ExitSetupMessage=Âûéòè èç ïðîãðàììû óñòàíîâêè ?
ConfirmUninstall=Óäàëèòü {#MyAppName} ?
[CustomMessages]
Welcome1=Âàñ ïðèâåòñòâóåò Ìàñòåð óñòàíîâêè èãðû %n«{#MyAppName}»
Welcome2=Ðåêîìåíäóåòñÿ çàêðûòü àíòèâèðóñíûå ïðîãðàììû, à òàêæå âñå ïðî÷èå ïðèëîæåíèÿ ïåðåä òåì, êàê ïðîäîëæèòü.%n%nÍàæìèòå «Äàëåå», ÷òîáû ïðîäîëæèòü, èëè «Îòìåíà», ÷òîáû âûéòè èç ïðîãðàììû óñòàíîâêè.
Dir1=Ïðîãðàììà óñòàíîâèò «{#MyAppName}» â ñëåäóþùóþ ïàïêó.
Dir2=Íàæìèòå «Äàëåå», ÷òîáû ïðîäîëæèòü. Åñëè Âû õîòèòå âûáðàòü äðóãóþ ïàïêó, íàæìèòå «Îáçîð».
FreeSpace=Äîñòóïíî ìåñòà íà äèñêå:.....
NeedSpace=Òðåáóåòñÿ ìåñòà äëÿ óñòàíîâêè:.....
AfterInstallSpace=Ïîñëå óñòàíîâêè èãðà çàéìåò:.....
Fin1=Óñòàíîâêà èãðû «{#MyAppName}» %nóñïåøíî çàâåðøåíà
Fin2=%n%nÄëÿ åå çàïóñêà âûáåðèòå ñîîòâåòñòâóþùèé ÿðëûê â ìåíþ "Ïóñê" %nèëè íà Ðàáî÷åì ñòîëå. %n%nÍàæìèòå "Çàâåðøèòü", ÷òîáû âûéòè èç ïðîãðàììû óñòàíîâêè.
ExtractedFile=Èçâëåêàåòñÿ ôàéë:
Extracted=Óñòàíîâêà...
Error=Îøèáêà ðàñïàêîâêè!
ElapsedTime=Ïðîøëî:
RemainingTime=Îñòàëîñü âðåìåíè:
rbc=Îòêàò óñòàíîâêè...
exit=Âûõîä
Error1=Óñòàíîâêà èãðû «{#MyAppName}» íå çàâåðøåíà.
Error2=%nÂî âðåìÿ óñòàíîâêè ïðîèçîøëà îøèáêà, ïîæàëóéñòà îòêëþ÷èòå ñòîðîííèå ïðîãðàììû è ïîâòîðèòå ïîïûòêó óñòàíîâêè. %n%nÍàæìèòå «Çàâåðøèòü», ÷òîáû âûéòè èç ïðîãðàììû óñòàíîâêè.
ready2=Èíôîðìàöèÿ:
ready3=Èãðà áóäåò óñòàíîâëåíà â
[Run]
Filename: {app}\__Installer\Touchup.exe; Parameters: " install -locale ru_RU -installPath ""{app}\"" -autologging -Opt:InstallPB -startmenuIcon=1 -desktopIcon=1"; WorkingDir: {app}\__Installer
[UninstallDelete]
Type: filesandordirs; Name: {app}
[_Code]
const
notPCFonFLY = false;
VK_ESCAPE = 27;
var
img1, img2: longint;
Cancel: Integer;
Error: Boolean;
ISDoneError: Boolean;
PCFVer: Double;
edit, dir, work1, work2, work5, work6, workerror, ready: Longint;
hCancelBtn, hNextBtn, hBackBtn, hDirBrowseBtn, Min, CloseBtn, CancelBtn, MinBtn: HWND;
WFButtonFont: TFont;
UpdBtn: TTimer;
WelcomeLabel1, MainLabel, WelcomeLabel2, dir1,
NeedSpaceLabel, Dir1Label, FreeSpaceLabel, Pct, CurrFileName, Time1, Time2, i, ready1, ready2, ready3, ready9 : TLabel;
FreeMB, TotalMB: Cardinal;
SizeInt: Longint;
Enabled: Boolean;
closebnt: HWND;
TimerID: LongWord;
CurrentPicture:integer;
PicList: TStringlist;
imgpanel: tpanel;
#include "AddIss\botva2.iss"
#include "AddIss\progressbar.iss"
var pb: TImgPB;
function ReleaseCapture: Longint; external 'ReleaseCapture@user32.dll stdcall';
type
TCallback = function (OveralPct, CurrentPct: Integer; CurrentFile, TimeStr1, TimeStr2, TimeStr3: PAnsiChar): longword;
type
TProc=procedure(HandleW, msg, idEvent, TimeSys: LongWord);
function GetKeyState(nVirtKey: Integer): ShortInt; external 'GetKeyState@user32 stdcall delayload';
function WrapCallback(callback: TCallback; paramcount: Integer): longword;external 'wrapcallback@files:ISDone.dll stdcall delayload';
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 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 FileSearchInit(RecursiveSubDir: Boolean): Boolean; external 'FileSearchInit@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 ISDoneStop: Boolean; external 'ISDoneStop@files:ISDone.dll stdcall';
function SuspendProc: Boolean; external 'SuspendProc@files:ISDone.dll stdcall';
function ResumeProc: Boolean; external 'ResumeProc@files:ISDone.dll stdcall';
procedure LabelOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
SendMessage(WizardForm.Handle,$0112,$F012,0)
end;
function ProgressCallback(OveralPct, CurrentPct: Integer; CurrentFile, TimeStr1, TimeStr2, TimeStr3: PAnsiChar): longword;
begin
if (GetKeyState(VK_ESCAPE) < 0) then begin if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then Cancel:= 1; end;
if OveralPct<=1000 then ImgPBSetPosition(pb, OveralPct);
Pct.Caption := IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
CurrFileName.Caption:=ExpandConstant('{cm:ExtractedFile} ')+MinimizePathName(CurrentFile, CurrFileName.Font, CurrFileName.Width-ScaleX(100));
Time1.Caption:=ExpandConstant('{cm:ElapsedTime} ')+TimeStr2;
Time2.Caption:=ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
Result := Cancel;
end;
procedure CancelButtonOnClick(h: HWND);
begin
SuspendProc;
if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then Cancel:= 1;
ResumeProc;
end;
function cm(s: PAnsiChar): String;
begin
Result:= ExpandConstant('{cm:'+s+'}');
end;
procedure HideControls;
begin
Pct.Hide; i.Hide; CurrFileName.Hide; Time1.Hide; Time2.Hide; ImgPBDelete(pb);
if Error then begin i.Show; i.Caption:= cm('rbc'); end;
end;
procedure CreateControls;
begin
Pct := TLabel.Create(WizardForm);
with Pct do begin
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Arial';
Font.Size:= 8
Font.Style := [fsBold];
Transparent:= true;
Font.Color:= $363636;
Parent:= WizardForm;
AutoSize:= false;
Left:= ScaleX(350);
Top:= ScaleY(439);
Width:= ScaleX(100);
Transparent:= true;
BringToFront;
end;
CurrFileName := TLabel.Create(WizardForm);
with CurrFileName do begin
Parent:= WizardForm;
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Arial';
Font.Size:= 8
Font.Style := [fsBold];
Transparent:= true;
Font.Color:= $363636;
AutoSize:= false;
Width:= ScaleX(300);
Left:= ScaleX(59);
Top:= ScaleY(375);
Transparent:= true;
end;
Time1 := TLabel.Create(WizardForm);
with Time1 do begin
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Arial';
Font.Size:= 8
Font.Style := [fsBold];
Transparent:= true;
Font.Color:= $363636;
Parent:= WizardForm;
AutoSize:= false;
Width:= ScaleX(200);
Left:= ScaleX(59);
Top:= ScaleY(390);
Transparent:= true;
end;
Time2 := TLabel.Create(WizardForm);
with Time2 do begin
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Arial';
Font.Size:= 8
Font.Style := [fsBold];
Transparent:= true;
Font.Color:= $363636;
Parent:= WizardForm;
AutoSize:= false;
Width:= Time1.Width+ScaleX(40);
Left:= ScaleX(59);
Top:= Time1.Top+ScaleY(15);
Transparent:= true;
end;
i := TLabel.Create(WizardForm);
with i do begin
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Arial';
Font.Size:= 8
Font.Style := [fsBold];
Transparent:= true;
Font.Color:= $363636;
Parent:= WizardForm;
AutoSize:= false;
Width:= Time1.Width+ScaleX(40);
Left:= ScaleX(59);
Top:= ScaleY(360);
Transparent:= true;
Caption:= cm('Extracted');
end;
end;
function CheckError: Boolean;
begin
Result:= not Error;
end;
///
procedure FrameMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
WizardForm.SetFocus;
ReleaseCapture;
SendMessage(WizardForm.Handle,$0112,$F012,0);
end;
function InitializeSetup:boolean;
begin
if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');
if not FileExists(ExpandConstant('{tmp}\b2p.dll')) then ExtractTemporaryFile('b2p.dll');
if not FileExists(ExpandConstant('{tmp}\gdiplus.dll')) then ExtractTemporaryFile('gdiplus.dll');
Result:=True;
end;
//************************************************ [Íà÷àëî - Çàãðóçêà èçîáðàæåíèé è ïîäãîòîâêà âèçàðäà] ***************************************************//
procedure CreateWizardImg;
begin
with WizardForm do begin
BorderStyle := bsNone;
ClientWidth:=ScaleX(733);
ClientHeight:=ScaleY(506);
InnerNotebook.Hide;
OuterNotebook.Hide;
Bevel.Hide;
Center;
Color:= $191919;
end;
work1:= ImgLoad(WizardForm.handle, ExpandConstant('2work1.jpg'), ScaleX(0), ScaleY(0), WizardForm.ClientWidth, WizardForm.ClientHeight, True, True);
work2:= ImgLoad(WizardForm.handle, ExpandConstant('2work2.jpg'), ScaleX(0), ScaleY(0), WizardForm.ClientWidth, WizardForm.ClientHeight, True, True);
work5:= ImgLoad(WizardForm.handle, ExpandConstant('2work5.jpg'), ScaleX(0), ScaleY(0), WizardForm.ClientWidth, WizardForm.ClientHeight, True, True);
work6:= ImgLoad(WizardForm.handle, ExpandConstant('2work6.jpg'), ScaleX(0), ScaleY(0), WizardForm.ClientWidth, WizardForm.ClientHeight, True, True);
workerror:= ImgLoad(WizardForm.handle, ExpandConstant('2workerror.jpg'), ScaleX(0), ScaleY(0), WizardForm.ClientWidth, WizardForm.ClientHeight, True, True);
edit:= ImgLoad(WizardForm.handle, ExpandConstant('edit.png'), ScaleX(145), ScaleY(380), ScaleX(328), ScaleY(24), True, True);
dir:= ImgLoad(WizardForm.handle, ExpandConstant('dir.png'), ScaleX(143), ScaleY(327), ScaleX(65), ScaleY(48), True, True);
ImgApplyChanges(WizardForm.Handle);
end;
//************************************************ [Êîíåö - Çàãðóçêà èçîáðàæåíèé è ïîäãîòîâêà âèçàðäà] ***************************************************//
//************************************************ [Íà÷àëî - Òåêñòóðû êíîïîê] ***************************************************//
procedure SetStateNewButtons;
begin
with WizardForm.BackButton do begin
BtnSetText(hBackBtn,PAnsiChar(Caption));
BtnSetVisibility(hBackBtn,Visible);
BtnSetEnabled(hBackBtn,Enabled);
BtnRefresh(hBackBtn);
end;
with WizardForm.NextButton do begin
BtnSetText(hNextBtn,PAnsiChar(Caption));
BtnSetVisibility(hNextBtn,Visible);
BtnSetEnabled(hNextBtn,Enabled);
BtnRefresh(hNextBtn);
end;
with WizardForm.CancelButton do begin
BtnSetText(hCancelBtn, PAnsiChar(cm('exit')));
BtnSetVisibility(hCancelBtn,Visible);
BtnSetEnabled(hCancelBtn,Enabled);
BtnRefresh(hCancelBtn);
end;
BtnSetText(hDirBrowseBtn,PAnsiChar(WizardForm.DirBrowseButton.Caption));
end;
procedure TimerRefreshBtn(S: TObject);
begin
BtnRefresh(hBackBtn);
BtnRefresh(hNextBtn);
BtnRefresh(hCancelBtn);
BtnRefresh(hDirBrowseBtn);
end;
procedure WizardFormBtnClick(hBtn: HWND);
var
Btn:TButton;
begin
case hBtn of
hCancelBtn: Btn:=WizardForm.CancelButton;
hNextBtn: Btn:=WizardForm.NextButton;
hBackBtn: Btn:=WizardForm.BackButton;
hDirBrowseBtn: Btn:=WizardForm.DirBrowseButton;
end;
Btn.OnClick(Btn);
SetStateNewButtons;
BtnRefresh(hBtn);
end;
procedure MinimizeBtnClick(h: HWND);
begin
WizardForm.SetFocus;
ReleaseCapture;
SendMessage(WizardForm.Handle,$112,61472,0);
end;
procedure CancelBtnClick(h: HWND);
begin
WizardForm.CancelButton.OnClick(WizardForm.CancelButton);
end;
procedure ButtonsTextures;
begin
WFButtonFont:=TFont.Create;
WFButtonFont.Name:= 'Arial';
WFButtonFont.Height := -13;
WFButtonFont.Color:= $FFFFFF;
WFButtonFont.Style := [fsBold];
with WizardForm.NextButton do begin
hNextBtn:=BtnCreate(WizardForm.Handle, ScaleX(500), ScaleY(470), ScaleX(93), ScaleY(33), 'button.png', 5, False);
BtnSetEvent(hNextBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hNextBtn,WFButtonFont.Handle);
BtnSetFontColor(hNextBtn, $FFFFFF, $FFFFFF, $FFFFFF, $FFFFFF)
Width:=0;
Height:=0;
end;
with WizardForm.BackButton do begin
hBackBtn:=BtnCreate(WizardForm.Handle, ScaleX(400), ScaleY(470), ScaleX(93), ScaleY(33), ExpandConstant('button.png'), 1, False);
BtnSetEvent(hBackBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hBackBtn,WFButtonFont.Handle);
BtnSetFontColor(hBackBtn, $FFFFFF, $FFFFFF, $FFFFFF, $FFFFFF);
Width:=0;
Height:=0;
end;
with WizardForm.CancelButton do begin
hCancelBtn:=BtnCreate(WizardForm.Handle, ScaleX(620), ScaleY(470), ScaleX(93), ScaleY(33), ExpandConstant('button.png'), 1, False);
BtnSetEvent(hCancelBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hCancelBtn,WFButtonFont.Handle);
BtnSetFontColor(hCancelBtn, $FFFFFF, $FFFFFF, $FFFFFF, $FFFFFF);
Width:=0;
Height:=0;
end;
CancelBtn:=BtnCreate(WizardForm.Handle, ScaleX(717), ScaleY(0), ScaleX(11), ScaleY(33), ExpandConstant('exit.png'), 1, False);
BtnSetEvent(CancelBtn, BtnClickEventID,WrapBtnCallback(@CancelBtnClick,1));
BtnSetFont(CancelBtn, WFButtonFont.Handle);
BtnSetText(CancelBtn,'');
MinBtn:=BtnCreate(WizardForm.Handle, ScaleX(704), ScaleY(4), ScaleX(8), ScaleY(33), ExpandConstant('min.png'), 1, false);
BtnSetEvent(MinBtn, BtnClickEventID,WrapBtnCallback(@MinimizeBtnClick,1));
with WizardForm.DirBrowseButton do begin
hDirBrowseBtn:=BtnCreate(WizardForm.Handle, ScaleX(502), ScaleY(375), ScaleX(93), ScaleY(33), ExpandConstant('button.png'), 1, False);
BtnSetEvent(hDirBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hDirBrowseBtn,WFButtonFont.Handle);
BtnSetFontColor(hDirBrowseBtn, $FFFFFF, $FFFFFF, $FFFFFF, $FFFFFF);
Width:=0;
Height:=0;
end;
end;
//************************************************ [Êîíåö - Òåêñòóðû êíîïîê] ***************************************************//
//************************************************[Íà÷àëî - Ïðîâåðêà ìåñòà íà äèñêå]*************************************************************//
Function NumToStr(Float: Extended): String;
Begin
Result:= Format('%.2n', [Float]); StringChange(Result, ',', ',');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = ',')) and (Pos(',', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;
function CompareNum(FirstNum, SecondNum: Integer): Boolean;
begin
if FirstNum < SecondNum then Result:= False else Result:= True;
end;
Function MbOrTb(Byte: Extended): AnsiString;
begin
if Byte < 1024 then Result:= NumToStr(Byte) + ' MB' else
if Byte/1024 < 1024 then Result:= NumToStr(round(Byte/1024*100)/100) + ' GB' else
Result:= NumToStr(round((Byte/(1024*1024))*100)/100) + ' TB'
end;
procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: AnsiString; gsod: Boolean;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
gsod:= GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if gsod then begin
FreeSpaceLabel.Caption:= ExpandConstant('{cm:FreeSpace} ') + MbOrTB(FreeMb) + ' (' + IntToStr((FreeMb*100) div TotalMB) + ' %)';
NeedSpaceLabel.Caption := ExpandConstant('{cm:NeedSpace} ') + MbOrTb(SizeInt);
BtnSetEnabled(hNextBtn, true);
WizardForm.NextButton.Enabled:= true;
end else
if not gsod then begin
FreeSpaceLabel.Caption:= ExpandConstant('{cm:FreeSpace} 0 MB');
NeedSpaceLabel.Caption := ExpandConstant('{cm:NeedSpace} ') + MbOrTb(SizeInt)
BtnSetEnabled(hNextBtn, false);
WizardForm.NextButton.Enabled:= false;
Exit;
end;
ready2.Caption:=ready2.Caption + ': ' + WizardForm.DirEdit.Text;
end;
procedure NeedSpace;
begin
SizeInt:= {#NeedSize}
FreeSpaceLabel := TLabel.Create(WizardForm);
FreeSpaceLabel.SetBounds(ScaleX(145), ScaleY(410), ScaleX(209), ScaleY(13))
FreeSpaceLabel.Parent := WizardForm;
FreeSpaceLabel.Font.Name:='Arial';
FreeSpaceLabel.Font.Size:= 8;
FreeSpaceLabel.Font.Color:= $363636;
FreeSpaceLabel.Transparent:=true;
FreeSpaceLabel.Font.Style := [fsBold];
NeedSpaceLabel := TLabel.Create(WizardForm);
NeedSpaceLabel.SetBounds(ScaleX(145), ScaleY(430), ScaleX(209), ScaleY(13))
NeedSpaceLabel.Parent := WizardForm;
NeedSpaceLabel.Font.Name:='Arial';
NeedSpaceLabel.Font.Size:= 8;
NeedSpaceLabel.Font.Color:= $363636;
NeedSpaceLabel.Transparent:=true;
NeedSpaceLabel.Font.Style:= [fsBold];
WizardForm.DirEdit.OnChange:= @GetFreeSpaceCaption;
WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text + #0;
end;
//************************************************[Êîíåö - Ïðîâåðêà ìåñòà íà äèñêå]*************************************************************//
//************************************************ [Íà÷àëî - Ñîçäàíèå ëåáåëîâ] ***************************************************//
procedure CreateLabel;
begin
UpdBtn:= TTimer.Create(nil);
UpdBtn.Interval:= 1;
UpdBtn.OnTimer:= @TimerRefreshBtn;
MainLabel:= TLabel.Create(WizardForm);
with MainLabel do begin
Left:= ScaleX(0);
Top:= ScaleY(7);
Width:= ScaleX(752);
Height:= ScaleY(34);
AutoSize:= false;
Transparent:= true;
WordWrap:= true;
Font.Name:='Corbel';
Alignment:= taCenter;
Font.Size:= 10;
Font.Color:= $aeacac;
Font.Style := [fsBold];
Parent:= WizardForm;
OnMouseDown:=@LabelOnMouseDown;
Caption:= WizardForm.Caption;
end;
WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do begin
Left:= ScaleX(140);
Top:= ScaleY(330);
Width:= ScaleX(450);
Height:= ScaleY(65);
AutoSize:= false;
Transparent:= true;
WordWrap:= true;
Font.Name:='Arial';
Font.Size:= 10;
Font.Color:=$363636;
Font.Style := [fsBold];
Alignment := taCenter;
Parent:= WizardForm;
Caption:= cm('Welcome1');
end;
WelcomeLabel2:=TLabel.Create(WizardForm);
with WelcomeLabel2 do begin
Left:= ScaleX(140);
Top:= ScaleY(370);;
Width:= ScaleX(450);
Height:= ScaleY(200);
AutoSize:= false;
WordWrap:= true;
Font.Name:='Arial';
Font.Size:= 9;
Font.Color:=$363636;
Alignment := taCenter;
Font.Style := [fsBold];
Transparent:= true;
Parent:= WizardForm;
Caption:= cm('Welcome2');
end;
with WizardForm.DirEdit do begin
Parent:= WizardForm;
Left:= ScaleX(148);
Top:= ScaleY(384);
BorderStyle:= bsNone;
Color:= $ffffff;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:= $363636;
Width:= ScaleX(324);
Height:= ScaleY(18);
end;
dir1:=TLabel.Create(WizardForm);
with dir1 do begin
Left:= ScaleX(300);
Top:= ScaleY(480);
Width:= ScaleX(450);
Height:= ScaleY(200);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Arial';
Font.Size:= 8
Font.Style := [fsBold];
Transparent:= true;
Font.Color:= $363636;
Parent:= WizardForm;
Caption:= cm('dir1');
end;
ready1:=TLabel.Create(WizardForm);
with ready1 do begin
Left:= ScaleX(143);
Top:= ScaleY(370);
Width:= ScaleX(550);
Height:= ScaleY(200);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Arial';
Font.Size:= 8;
Font.Style := [fsBold];
Transparent:= true;
Font.Color:=$363636;
Parent:= WizardForm;
Caption:= cm('ready2')
end;
ready2:=TLabel.Create(WizardForm);
with ready2 do begin
Left:= ScaleX(160);
Top:= ScaleY(385);
Width:= ScaleX(460);
Height:= ScaleY(200);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Arial';
Font.Size:= 8;
Font.Style := [fsBold];
Transparent:= true;
Font.Color:=$363636;
Parent:= WizardForm;
Caption:= cm('ready3');
end;
end;
//************************************************ [Êîíåö - Ñîçäàíèå ëåáåëîâ] ***************************************************//
procedure InitializeWizard;
begin
Enabled:= true;
CreateWizardImg;
CreateLabel;
ButtonsTextures;
NeedSpace;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
SetStateNewButtons;
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
BtnSetVisibility(hDirBrowseBtn, false);
ImgSetVisibility(edit, false);
ImgSetVisibility(dir, false);
ImgSetVisibility(work1, false);
ImgSetVisibility(work2, false);
ImgSetVisibility(work5, false);
ImgSetVisibility(work6, false);
ImgSetVisibility(ready, false);
ImgSetVisibility(workerror, false);
WizardForm.DirEdit.Hide;
dir1.Hide;
FreeSpaceLabel.Hide;
NeedSpaceLabel.Hide;
ready1.Hide;
ready2.Hide;
if CurPageID = wpWelcome then
begin
WelcomeLabel1.Show;
WelcomeLabel2.Show;
ImgSetVisibility(work1, true);
ImgSetVisibility(img1, true);
end;
if CurPageID = wpSelectDir then
begin
BtnSetVisibility(hDirBrowseBtn, true);
ImgSetVisibility(edit, true);
ImgSetVisibility(dir, true);
WizardForm.DirEdit.Show;
FreeSpaceLabel.Show;
NeedSpaceLabel.Show;
dir1.Show;
dir1.Caption:= cm('dir1');
dir1.Left:= ScaleX(220);
dir1.Top:= ScaleX(343);
ImgSetVisibility(work2, true);
ImgSetVisibility(img2, true);
end;
if CurPageID = wpInstalling then
begin
ImgSetVisibility(work5, true);
end;
if CurPageID = wpFinished then
begin
ImgSetVisibility(work6, true);
WelcomeLabel1.Caption:= cm('Fin1');
WelcomeLabel2.Caption:= cm('Fin2');
WelcomeLabel2.Top:= WelcomeLabel2.Top-ScaleY(23);
WelcomeLabel1.Show;
WelcomeLabel2.Show;
i.Hide;
end;
if (CurPageID = wpFinished) and Error then
begin
WelcomeLabel1.Caption:= cm('Error1');
WelcomeLabel2.Caption:= cm('Error2')
ImgSetVisibility(workerror, true);
end;
ImgApplyChanges(WizardForm.Handle);
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then begin
CreateControls;
pb:= ImgPBCreate(WizardForm.Handle, 'pb1.png','pb.png', ScaleX(59), ScaleY(437), ScaleX(620), ScaleY(19));
BtnSetEvent(hCancelBtn, BtnClickEventID, WrapBtnCallback(@CancelButtonOnClick, 1));
WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
Cancel:=0;
ExtractTemporaryFile('unarc.dll');
ExtractTemporaryFile('facompress.dll');
#ifdef records
ExtractTemporaryFile('records.inf');
#endif
Error:=true;
if ISDoneInit(ExpandConstant('{src}\records.inf'), $F777, 0,0,0, 0, 512, @ProgressCallback) then begin
repeat
if not FileSearchInit(true) then break;
// if not ISArcExtract ( 0, 0, ExpandConstant('{src}\disk-1.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY) then break;
// if not ShowChangeDiskWindow ('Ïîæàëóéñòà, âñòàâüòå âòîðîé äèñê è äîæäèòåñü åãî èíèöèàëèçàöèè.', ExpandConstant('{src}'),'disk-2.bin') then break;
// if not ISArcExtract ( 0, 0, ExpandConstant('{src}\disk-2.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY) then break;
// if not ShowChangeDiskWindow ('Ïîæàëóéñòà, âñòàâüòå òðåòèé äèñê è äîæäèòåñü åãî èíèöèàëèçàöèè.', ExpandConstant('{src}'),'disk-3.bin') then break;
// if not ISArcExtract ( 0, 0, ExpandConstant('{src}\disk-3.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY) then break;
// if not ShowChangeDiskWindow ('Ïîæàëóéñòà, âñòàâüòå ÷åòâåðòûé äèñê è äîæäèòåñü åãî èíèöèàëèçàöèè.', ExpandConstant('{src}'),'disk-4.bin') then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\disk-4.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY) then break;
Error:=false;
until true;
ISDoneStop;
end;
HideControls;
end;
if (CurStep=ssPostInstall) and Error then begin
Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
end;
end;
procedure DeinitializeSetup;
begin
if Enabled then gdipShutdown;
end;
|