frontlines45
Новичок
Приветствую уважаемые форумчане. Проблемка возникла при компиляции, выдает вот такую ошибку
Код:
#define MyAppName "Hitman 2 Silent Assassin"
#define NeedSize 623616
#define AfterSize 624640
#define NeedMem 512
;#define records
;#define PrecompInside
;#define SrepInside
;#define facompress
;#define precomp "0.4"
;#define unrar
;#define XDelta
;#define PackZIP
#define icon "Files/icon.ico"
#define Font "AGHelvetica.ttf"
#define FontName "AG_Helvetica"
#define Splash
#define Music
#define Slides
[Setup]
AppName={#MyAppName}
AppVersion=1.0.0.271
AppPublisher=dvd4el
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
DirExistsWarning=no
OutputBaseFilename=setup
Compression=lzma2/ultra64
SolidCompression=true
SetupIconFile={#icon}
[Files]
////////////////////////////Бибиотеки (нужны для работы инсталлятора)!//////////////////////////////////////////
Source: dll\botva2.dll; DestDir: {tmp}; Flags: dontcopy;
Source: dll\b2p.dll; DestDir: {tmp}; Flags: dontcopy;
Source: dll\CallbackCtrl.dll; DestDir: {tmp}; Flags: dontcopy;
Source: dll\Tools.dll; DestDir: {tmp}; Flags: dontcopy;
////////////////////////////Файлы изображений/////////////////////////////////////////
Source: Files\fon.jpg; DestDir: {tmp}; Flags: dontcopy
#ifdef Splash
Source: Splash\splash.png; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: Splash\isgsg.dll; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
#endif
#ifdef Slides
Source: Slides\isSlideShow.dll; DestDir: {tmp}; Flags: dontcopy
Source: Slides\01.jpg; DestDir: {tmp}; Flags: dontcopy
Source: Slides\02.jpg; DestDir: {tmp}; Flags: dontcopy
Source: Slides\03.jpg; DestDir: {tmp}; Flags: dontcopy
Source: Slides\04.jpg; DestDir: {tmp}; Flags: dontcopy
Source: Slides\05.jpg; DestDir: {tmp}; Flags: dontcopy
Source: Slides\06.jpg; DestDir: {tmp}; Flags: dontcopy
Source: Slides\07.jpg; DestDir: {tmp}; Flags: dontcopy
Source: Slides\08.jpg; DestDir: {tmp}; Flags: dontcopy
Source: Slides\09.jpg; DestDir: {tmp}; Flags: dontcopy
Source: Slides\10.jpg; DestDir: {tmp}; Flags: dontcopy
Source: Slides\11.jpg; DestDir: {tmp}; Flags: dontcopy
Source: Slides\12.jpg; DestDir: {tmp}; Flags: dontcopy
Source: Slides\13.jpg; DestDir: {tmp}; Flags: dontcopy
Source: Slides\14.jpg; DestDir: {tmp}; Flags: dontcopy
Source: Slides\15.jpg; DestDir: {tmp}; Flags: dontcopy
Source: Slides\InnoCallback.dll; DestDir: {tmp}; Flags: dontcopy
#endif
Source: Files\{#Font}; Flags: dontcopy;
#ifdef Music
Source: Music\*; DestDir: {tmp}; Flags: dontcopy
#endif
Source: Files\ready.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\space.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\Edit.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\work.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\work1.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\work2.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\work3.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\work4.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\work5.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\work6.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\off.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\min.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\error.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\button.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\CheckBox.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\pb.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\pbback.png; DestDir: {tmp}; Flags: dontcopy
////////////////////////////Файлы для распаковки архивов (ISDone)/////////////////////////////////////////
Source: ISDone\russian.ini; DestDir: {tmp}; Flags: dontcopy
Source: ISDone\unarc.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone\ISDone.dll; DestDir: {tmp}; Flags: dontcopy
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef PrecompInside
Source: ISDone\CLS-precomp.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone\packjpg_dll1.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone\precomp.exe; DestDir: {tmp}; Flags: dontcopy
Source: ISDone\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef SrepInside
Source: ISDone\CLS-srep.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef facompress
Source: ISDone\facompress.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp
#if precomp == "0.38"
Source: ISDone\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
#else
#if precomp == "0.4"
Source: ISDone\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
#else
#if precomp == "0.41"
Source: ISDone\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
#else
Source: ISDone\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
Source: ISDone\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
Source: ISDone\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
#endif
#endif
#endif
#endif
#ifdef unrar
Source: ISDone\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef XDelta
Source: ISDone\XDelta3.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef PackZIP
Source: ISDone\7z.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone\packZIP.exe; DestDir: {tmp}; Flags: dontcopy
#endif
[Icons]
Name: "{userdesktop}\{#MyAppName}"; Filename: {app}\hitman2.exe; WorkingDir: "{app}"; IconFilename: {app}\hitman2.exe;
Name: "{group}\{#MyAppName}"; Filename: {app}\hitman2.exe; WorkingDir: "{app}"; IconFilename: {app}\hitman2.exe;
Name: "{group}\{cm:UninstallProgram}"; Filename: "{uninstallexe}"; IconFilename: {app}\cnruninstall.ico;
[Tasks]
Name: DPO; Description: Дополнительное програмное обеспечение:;
Name: DPO/VC; Description: Установить Microsoft Visual C++ 2005 Redist;
Name: DPO/DirectX; Description: Установить DirectX;
[Run]
Filename: {src}\Soft\DirectX\dxwebsetup.exe; WorkingDir: {src}\Soft\DirectX\; Flags: waituntilterminated; Check: DirectX and CheckError;
Filename: {src}\Soft\Redist\vcredist_x86.exe; WorkingDir: {src}\Soft\Redist\; Parameters: /Q; Flags: waituntilterminated; Check: VC and not IsWin64 and CheckError;
Filename: {src}\Soft\Redist\vcredist_x64.exe; WorkingDir: {src}\Soft\Redist\; Parameters: /Q; Flags: waituntilterminated; Check: VC and IsWin64 and CheckError;
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[Messages]
rus.ExitSetupMessage=Вы действительно хотите отменить установку игры {#MyAppName}?
[CustomMessages]
rus.Main=
rus.Welcome1=Нажмите «Далее», чтобы продолжить.
rus.Welcome2=Нажмите «Далее», чтобы продолжить.
rus.Finished1=Установка игры «{#MyAppName}» успешно завершена.
rus.Finished2=Игра «{#MyAppName}» была успешно установлена на Ваш компьютер. %n%nДля ее запуска выберите соответствующий значек в меню «Пуск» или ярлык на Рабочем столе. %n%nНажмите «Завершить», чтобы выйти из программы установки.
rus.SelectDir1=Программа установит «{#MyAppName}» в следующую папку.
rus.SelectDir2=Нажмите «Далее», чтобы продолжить. Если Вы хотите выбрать другую папку, нажмите «Обзор».
rus.FreeSpace=Доступно места на диске:
rus.NeedSpace=Требуется места на диске:
rus.AfterInstallSpace=После установки игра займет:
rus.SelectGroup1=Программа создаст ярлыки в следующей папке меню «Пуск».
rus.IconsCheck=Создать ярлык в меню «Пуск»
rus.DPO=Дополнительное программное обеспечения:
rus.DirectX=Обновить DirectX (требуется интернет-соединения)
rus.VC=Установить Microsoft Visual C++
rus.SelectTasks=Выберите дополнительные задачи, которые должны выполниться при установке «{#MyAppName}», после этого нажмите «Далее»:
rus.Extracted=Распаковка файлов...
rus.Error=Ошибка распаковки!
[Code]
procedure ShowSplashScreen(p1:HWND;p2:string;p3,p4,p5,p6,p7:integer;p8:boolean;p9:Cardinal;p10:integer); external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';
const
A1='А';
Z1='Я';
A2='а';
Z2='я';
X1='ё';
X2='Ё';
type
TPBProc = function (h:hWnd;Msg,wParam,lParam:Longint):Longint;
TProc=procedure(HandleW, msg, idEvent, TimeSys: LongWord);
var
IsCustomFontInstalled: boolean;
FontName: string;
fon: Longint;
bwork, dir, group, work, work1, work2, work3, work4, work5, work6: Longint;
WerInctall1, WerInstall2, DesktopLabel,DesktopLabel1, DesktopLabel2, DPOLabel, DirectXLabel, VCLabel, SelectTasks, MainLabel, ReadyLabel1, ReadyLabel2, ReadyLabel3, WelcomeLabel1, WelcomeLabel2, SelectDirPage1, SelectDirPage2, SelectProgramGroupPage1, SelectProgramGroupPage2, NoIconsLabel: TLabel;
DPOCheck, DesktopCheck, DirectXCheck, VCCheck, NoIconsCheck, CancelBtn, MinBtn, CancelBtn, MusicButton, hCancelBtn, hNextBtn, hBackBtn, hDirBrowseBtn, hGroupBrowseBtn, hCancelUninstBtn: HWND;
WFButtonFont: TFont;
NeedSpaceLabel, AfterSpaceLabel,FreeSpaceLabel,DirEditLabel, GroupEditLabel: TLabel;
FreeMB, TotalMB: Cardinal;
SizeStr: AnsiString;
SizeInt, AfterInt, Edit, Space, Ready: Longint;
SymbolNumber: Longint;
TimerID: LongWord;
CurrentPicture:integer;
PicList: TStringlist;
//****************//Подключение модулей//*********************//
#include "Modules\botva2.iss"
#include "Modules\progressbar.iss"
#include "Modules\ISDone.iss"
#ifdef Music
#include "Modules\BASS_Module.iss"
#endif
//****************//Подключение модулей//*********************//
function InitializeSetup:boolean;
begin
if not FileExists(ExpandConstant('{tmp}\b2p.dll')) then ExtractTemporaryFile('b2p.dll');
if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');
Result:=True;
end;
function ReleaseCapture(): Longint; external 'ReleaseCapture@user32.dll stdcall';
function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall';
function SetLayeredWindowAttributes(hwnd: hWnd; crKey: TColor; bAlpha: byte; dwFlags: DWORD): Boolean; external 'SetLayeredWindowAttributes@user32.dll stdcall';
function GetWindowLong(Wnd: HWnd; Index: Integer): Longint; external 'GetWindowLongA@user32.dll stdcall';
function CreateNewFont(Height, Width: Integer; thickness: DWORD; FontName: PChar): HWND; external 'CreateNewFont@files:Tools.dll stdcall';
function AddFontResource(FileName: PAnsiChar): Integer; external 'AddFontResourceA@gdi32.dll stdcall';
function RemoveFontResource(FileName: PAnsiChar): BOOL; external 'RemoveFontResourceA@gdi32.dll stdcall';
#ifdef Slides
function WrapTimerProc(callback:TProc; paramcount:integer):longword; external 'wrapcallback@files:InnoCallback.dll stdcall';
function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): LongWord; external 'SetTimer@user32.dll stdcall';
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@user32.dll stdcall';
function GetSystemMetrics(nIndex:Integer):Integer; external 'GetSystemMetrics@user32.dll stdcall';
procedure InitializeSlideShow(Hwnd:Thandle; l,t,w,h:integer;Animate:boolean; Stretch:integer); external 'InitializeSlideShow@files:isslideshow.dll stdcall';
procedure DeinitializeSlideShow; external 'DeinitializeSlideShow@files:isslideshow.dll stdcall';
procedure ShowImage(ipath:PAnsiChar; Effect:integer); external 'ShowImage@files:isslideshow.dll stdcall';
#endif
procedure LabelOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
SendMessage(WizardForm.Handle,$0112,$F012,0)
end;
//************************************************[Начало - Загрузка изображений]*************************************************************//
procedure CreateWizardImage;
begin
with WizardForm do begin
BorderStyle := bsNone;
ClientWidth:=ScaleX(700);
ClientHeight:=ScaleY(416);
InnerNotebook.Hide;
OuterNotebook.Hide;
Bevel.Hide;
Center;
end;
fon:=ImgLoad(WizardForm.Handle, ExpandConstant('fon.jpg'), ScaleX(0), ScaleY(0), WizardForm.ClientWidth, WizardForm.ClientHeight,True,True);
work:= ImgLoad(WizardForm.Handle,ExpandConstant('work.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
work1:=ImgLoad(WizardForm.Handle,ExpandConstant('work1.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
work2:=ImgLoad(WizardForm.Handle,ExpandConstant('work2.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
work3:=ImgLoad(WizardForm.Handle,ExpandConstant('work3.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
work4:=ImgLoad(WizardForm.Handle,ExpandConstant('work4.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
work5:=ImgLoad(WizardForm.Handle,ExpandConstant('work5.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
work6:=ImgLoad(WizardForm.Handle,ExpandConstant('work6.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
Edit:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Edit.png'),ScaleX(140), ScaleY(200),ScaleX(328),ScaleY(24),True,True);
Space:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\space.png'),ScaleX(140), ScaleY(240),ScaleX(306),ScaleY(65),True,True);
Ready:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\ready.png'),ScaleX(108), ScaleY(210),ScaleX(325),ScaleY(135),True,True);
ImgApplyChanges(WizardForm.Handle);
end;
//************************************************[Конец - Загрузка изображений]*************************************************************//
//************************************************ [Начало - Текстуры кнопок] ***************************************************//
procedure MinimizeBtnClick(h:HWND);
begin
GetMinimizeAnimation;
SetMinimizeAnimation(true);
SendMessage(WizardForm.Handle,$112,61472,0);
end;
procedure CancelBtnClick(h:HWND);
begin
WizardForm.CancelButton.OnClick(WizardForm.CancelButton);
end;
procedure SetStateNewButtons;
begin
with WizardForm.BackButton do begin
BtnSetText(hBackBtn,PAnsiChar(Caption));
BtnSetVisibility(hBackBtn,Visible);
BtnSetEnabled(hBackBtn,Enabled);
end;
with WizardForm.NextButton do begin
BtnSetText(hNextBtn,PAnsiChar(Caption));
BtnSetVisibility(hNextBtn,Visible);
BtnSetEnabled(hNextBtn,Enabled);
end;
with WizardForm.CancelButton do begin
BtnSetText(hCancelBtn,PAnsiChar(Caption));
BtnSetVisibility(hCancelBtn,Visible);
BtnSetEnabled(hCancelBtn,Enabled);
end;
BtnSetText(hDirBrowseBtn,PAnsiChar(WizardForm.DirBrowseButton.Caption));
BtnSetText(hGroupBrowseBtn,PAnsiChar(WizardForm.GroupBrowseButton.Caption));
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;
hGroupBrowseBtn: Btn:=WizardForm.GroupBrowseButton;
end;
Btn.OnClick(Btn);
SetStateNewButtons;
BtnRefresh(hBtn);
end;
function NoIcons: Boolean;
begin
Result:= BtnGetEnabled(hGroupBrowseBtn);
end;
function Redist: Boolean;
begin
Result:= BtnGetChecked(DPOCheck);
end;
function DirectX: Boolean;
begin
Result:= BtnGetChecked(DirectXCheck);
end;
function VC: Boolean;
begin
Result:= BtnGetChecked(VCCheck);
end;
procedure NoIconsClick(hBtn:HWND);
var
Check:boolean;
begin
Check:=BtnGetChecked(hBtn);
BtnSetEnabled(hGroupBrowseBtn, Check);
WizardForm.GroupEdit.Enabled:=Check;
end;
procedure NoIconsLabelClick(Sender:TObject);
begin
BtnSetChecked(NoIconsCheck, not BtnGetChecked(NoIconsCheck));
NoIconsClick(NoIconsCheck);
end;
procedure DesktopClick(hBtn:HWND);
begin
end;
procedure DirChange(Sender: TObject);
var
CurrentDisk: String;
begin
CurrentDisk:=ExtractFileDrive(WizardForm.DirEdit.Text);
DirEditLabel.Caption:=MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
end;
procedure DesktopLabelClick(Sender:TObject);
begin
BtnSetChecked(DesktopCheck, not BtnGetChecked(DesktopCheck));
DesktopClick(DesktopCheck);
end;
procedure DirectXClick(hBtn:HWND);
var
Check:boolean;
begin
Check:=BtnGetChecked(hBtn);
if (BtnGetChecked(VCCheck)=false) and (Check = false) then begin BtnSetChecked(DPOCheck, false); end;
if (BtnGetChecked(VCCheck)=true) and (Check = true) then begin BtnSetChecked(DPOCheck, true); end;
if (BtnGetChecked(VCCheck)=true) and (Check = false) then begin BtnSetChecked(DPOCheck, true); end;
if (BtnGetChecked(VCCheck)=false) and (Check = true) then begin BtnSetChecked(DPOCheck, true); end;
end;
procedure VCClick(hBtn:HWND);
var
Check:boolean;
begin
Check:=BtnGetChecked(hBtn);
if (BtnGetChecked(DirectXCheck)=false) and (Check = false) then begin BtnSetChecked(DPOCheck, false); end;
if (BtnGetChecked(DirectXCheck)=true) and (Check = true) then begin BtnSetChecked(DPOCheck, true); end;
if (BtnGetChecked(DirectXCheck)=true) and (Check = false) then begin BtnSetChecked(DPOCheck, true); end;
if (BtnGetChecked(DirectXCheck)=false) and (Check = true) then begin BtnSetChecked(DPOCheck, true); end;
end;
procedure DPOClick(hBtn:HWND);
var
Check:boolean;
begin
Check:=BtnGetChecked(hBtn);
if BtnGetChecked(VCCheck) = false and BtnGetChecked(DirectXCheck) = false then BtnSetChecked(DPOCheck, false);
if BtnGetChecked(DPOCheck) then BtnSetChecked(DirectXCheck, True) else BtnSetChecked(DirectXCheck, False);
if BtnGetChecked(DPOCheck) then BtnSetChecked(VCCheck, True) else BtnSetChecked(VCCheck, False);
end;
procedure ButtonsTextures;
begin
WFButtonFont:=TFont.Create;
WFButtonFont.Name:='AGHelvetica';
WFButtonFont.Size:=10;
with WizardForm.NextButton do begin
hNextBtn:=BtnCreate(WizardForm.Handle,Left+145,Top+38,Width+31,Height+16,ExpandConstant('{tmp}\button.png'),18,False);
BtnSetEvent(hNextBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hNextBtn,WFButtonFont.Handle);
BtnSetFontColor(hNextBtn,clblack,clblack,clblack,clblack);
Width:=0;
Height:=0;
end;
with WizardForm.BackButton do begin
hBackBtn:=BtnCreate(WizardForm.Handle,Left+120,Top+38,Width+31,Height+16,ExpandConstant('{tmp}\button.png'),18,False);
BtnSetEvent(hBackBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hBackBtn,WFButtonFont.Handle);
BtnSetFontColor(hBackBtn,clblack,clblack,clblack,clblack);
Width:=0;
Height:=0;
end;
with WizardForm.CancelButton do begin
hCancelBtn:=BtnCreate(WizardForm.Handle,Left+166,Top+38,Width+31,Height+16,ExpandConstant('{tmp}\button.png'),18,False);
BtnSetEvent(hCancelBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hCancelBtn,WFButtonFont.Handle);
BtnSetFontColor(hCancelBtn,clblack,clblack,clblack,clblack);
Width:=0;
Height:=0;
end;
MinBtn:=BtnCreate(WizardForm.Handle,642, -3, 25, 25,PAnsiChar(ExpandConstant('{tmp}\min.png')), 1, false);
BtnSetEvent(MinBtn, BtnClickEventID,WrapBtnCallback(@MinimizeBtnClick,1));
CancelBtn:=BtnCreate(WizardForm.Handle,668, -3, 25, 25,PAnsiChar(ExpandConstant('{tmp}\off.png')), 1, False);
BtnSetEvent(CancelBtn, BtnClickEventID,WrapBtnCallback(@CancelBtnClick,1));
BtnSetFont(CancelBtn, WFButtonFont.Handle);
BtnSetText(CancelBtn,'');
with WizardForm.DirBrowseButton do begin
hDirBrowseBtn:=BtnCreate(WizardForm.Handle,Left+130,Top+110,Width+31,Height+16,ExpandConstant('{tmp}\button.png'),18,False);
BtnSetEvent(hDirBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hDirBrowseBtn,WFButtonFont.Handle);
BtnSetFontColor(hDirBrowseBtn,clblack,clblack,clblack,clblack);
Width:=0;
Height:=0;
end;
with WizardForm.GroupBrowseButton do begin
hGroupBrowseBtn:=BtnCreate(WizardForm.Handle,Left+130,Top+110,Width+31,Height+16,ExpandConstant('{tmp}\button.png'),18,False);
BtnSetEvent(hGroupBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hGroupBrowseBtn,WFButtonFont.Handle);
BtnSetFontColor(hGroupBrowseBtn,clblack,clblack,clblack,clblack);
Width:=0;
Height:=0;
end;
NoIconsCheck:=BtnCreate(WizardForm.Handle,ScaleX(140),ScaleY(240),ScaleX(20),ScaleY(20), ExpandConstant('CheckBox.png'),8,True);
BtnSetEvent(NoIconsCheck,BtnClickEventID,WrapBtnCallback(@NoIconsClick,1));
BtnSetChecked(NoIconsCheck, true);
DirectXCheck:=BtnCreate(WizardForm.Handle, ScaleX(160), ScaleY(230), ScaleX(20), ScaleY(20), ExpandConstant('CheckBox.png'), 8, True);
BtnSetChecked(DirectXCheck, true);
BtnSetEvent(DirectXCheck,BtnClickEventID,WrapBtnCallback(@DirectXClick,1));
VCCheck:=BtnCreate(WizardForm.Handle, ScaleX(160), ScaleY(255), ScaleX(20), ScaleY(20), ExpandConstant('CheckBox.png'), 8, True);
BtnSetChecked(VCCheck, true);
BtnSetEvent(VCCheck,BtnClickEventID,WrapBtnCallback(@VCClick,1));
DesktopCheck:=BtnCreate(WizardForm.Handle, ScaleX(160), ScaleY(300), ScaleX(20), ScaleY(20), ExpandConstant('CheckBox.png'), 8, True);
BtnSetChecked(DesktopCheck, true);
BtnSetEvent(DesktopCheck,BtnClickEventID,WrapBtnCallback(@DesktopClick,1));
end;
//************************************************ [Конец - Текстуры кнопок] ***************************************************//
//************************************************[Начало - Проверка места на диске]*************************************************************//
Function NumToStr(Float: Extended): AnsiString;
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) + ' Мб' else
if Byte/1024 < 1024 then Result:= NumToStr(round(Byte/1024*100)/100) + ' Гб' else
Result:= NumToStr(round((Byte/(1024*1024))*100)/100) + ' Тб'
end;
procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: AnsiString;
CurrentDisk: String;
i:integer;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
CurrentDisk:=ExtractFileDrive(WizardForm.DirEdit.Text);
DirEditLabel.Caption:=MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
FreeSpaceLabel.Caption:= ExpandConstant('{cm:FreeSpace} ') + MbOrTB(FreeMb) + ' (' + IntToStr((FreeMb*100) div TotalMB) + ' %)';
NeedSpaceLabel.Caption := ExpandConstant('{cm:NeedSpace} ') + MbOrTb(SizeInt)
AfterSpaceLabel.Caption := ExpandConstant('{cm:AfterInstallSpace} ') + MbOrTb(AfterInt)
ReadyLabel1.Caption:= ExpandConstant('Папка установки:'+#13+WizardForm.DirEdit.Text);
if WizardForm.CurPageID = wpSelectDir then begin
WizardForm.NextButton.Enabled:= CompareNum(FreeMB, SizeInt)
end;
end;
procedure GroupChange (Sender: TObject);
begin
GroupEditLabel.Caption := MinimizePathName(WizardForm.GroupEdit.Text, GroupEditLabel.Font, GroupEditLabel.Width);
end;
procedure NeedSpace;
begin
WizardForm.DiskSpaceLabel.Hide;
AfterInt:= {#AfterSize}
SizeInt:= {#NeedSize}
NeedSpaceLabel := TLabel.Create(WizardForm);
NeedSpaceLabel.SetBounds(ScaleX(145), ScaleY(245), ScaleX(209), ScaleY(13))
NeedSpaceLabel.Parent := WizardForm;
NeedSpaceLabel.Font.Name:='AG_Helvetica';
NeedSpaceLabel.Font.Size:= 10;
NeedSpaceLabel.Font.Color:=$000000;
NeedSpaceLabel.Transparent:=true;
FreeSpaceLabel := TLabel.Create(WizardForm);
FreeSpaceLabel.SetBounds(ScaleX(145), ScaleY(262), ScaleX(209), ScaleY(13))
FreeSpaceLabel.Parent := WizardForm;
FreeSpaceLabel.Font.Name:='AG_Helvetica';
FreeSpaceLabel.Font.Size:= 10;
FreeSpaceLabel.Font.Color:=$000000;
FreeSpaceLabel.Transparent:=true;
AfterSpaceLabel := TLabel.Create(WizardForm);
AfterSpaceLabel.SetBounds(ScaleX(145), ScaleY(280), ScaleX(209), ScaleY(13))
AfterSpaceLabel.Parent := WizardForm;
AfterSpaceLabel.Font.Name:='AG_Helvetica';
AfterSpaceLabel.Font.Size:= 10;
AfterSpaceLabel.Font.Color:=$000000;
AfterSpaceLabel.Transparent:=true;
WizardForm.DirEdit.OnChange:= @GetFreeSpaceCaption;
//WizardForm.GroupEdit.OnChange:= @GroupA;
WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text + #0;
end;
//************************************************[Конец - Проверка места на диске]*************************************************************//
//************************************************[Начало - Компоненты странниц]*************************************************************//
procedure CreateWizard;
begin
MainLabel:= TLabel.Create(WizardForm);
with MainLabel do
begin
Left:= ScaleX(0);
Top:= ScaleY(0);
Width:= ScaleX(700);
Height:= ScaleY(30);
AutoSize:= false;
Transparent:= true;
WordWrap:= true;
Font.Name:='Corbel';
Font.Size:= 8;
Font.Color:=clwhite;
Font.Style := [fsBold];
Parent:= WizardForm;
OnMouseDown:=@LabelOnMouseDown;
Caption:= ExpandConstant('{cm:Main}');
end;
///////////////////////SelectDirPage////////////////////////
SelectDirPage1:=TLabel.Create(WizardForm);
with SelectDirPage1 do
begin
Top:= ScaleY(80);
Left:= ScaleX(130);
Width:= ScaleX(450);
Height:= ScaleY(200);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'AG_Helvetica';
Font.Size:= 10
Alignment := taCenter;
Font.Color:=clwhite;
Font.Style := [fsBold];
Transparent:= true;
Parent:= WizardForm;
Caption:= ExpandConstant('{cm:SelectDir1}');
end;
SelectDirPage2:=TLabel.Create(WizardForm);
with SelectDirPage2 do
begin
Top:= ScaleY(110);
Left:= ScaleX(130);
Width:= ScaleX(450);
Height:= ScaleY(200);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'AG_Helvetica';
Font.Size:= 10
Alignment := taCenter;
Font.Color:=clwhite;
Font.Style := [fsBold];
Transparent:= true;
Parent:= WizardForm;
Caption:= ExpandConstant('{cm:SelectDir2}');
end;
DirEditLabel := TLabel.Create(WizardForm);
with DirEditLabel do begin
AutoSize:=False;
SetBounds(ScaleX(145), ScaleY(203), ScaleX(446), ScaleY(15));
WordWrap:= True;
ShowAccelChar := False;
Transparent:=True;
Font.Name:= 'AG_Helvetica'
Font.Size:= 9;
Font.Color:=$000000;
Caption := MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
Parent := WizardForm;
end;
///////////////////////SelectProgrammGroupPage////////////////////////
SelectProgramGroupPage1:=TLabel.Create(WizardForm);
with SelectProgramGroupPage1 do
begin
Top:= ScaleY(150);
Left:= ScaleX(130);
Width:= ScaleX(450);
Height:= ScaleY(200);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'AG_Helvetica';
Font.Size:= 10
Alignment := taCenter;
Font.Color:=clwhite;
Font.Style:=[fsBold];
Transparent:= true;
Parent:= WizardForm;
Caption:= ExpandConstant('{cm:SelectGroup1}');
end;
NoIconsLabel:=TLabel.Create(WizardForm);
with NoIconsLabel do
begin
Top:= ScaleY(240);
Left:= ScaleX(165);
Width:= ScaleX(300);
Height:= ScaleY(15);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'AG_Helvetica';
Font.Size:= 10
Font.Color:=$000000;
Transparent:= true;
Parent:= WizardForm;
OnClick:=@NoIconsLabelClick;
Caption:= ExpandConstant('{cm:IconsCheck}');
end;
GroupEditLabel := TLabel.Create(WizardForm);
with GroupEditLabel do begin
AutoSize:=False;
SetBounds(ScaleX(145), ScaleY(205), ScaleX(446), ScaleY(15));
WordWrap:= True;
ShowAccelChar := False;
Transparent:=True;
Font.Name:= 'AG_Helvetica'
Font.Size:= 9;
Font.Color:=$000000;
Caption := MinimizePathName(WizardForm.GroupEdit.Text, GroupEditLabel.Font, GroupEditLabel.Width);
Parent := WizardForm;
end;
WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text;
WizardForm.GroupEdit.OnChange := @GroupChange;
/////////////////////////////SelectTasksPage/////////////////////////////
DPOLabel:=TLabel.Create(WizardForm);
with DPOLabel do
begin
Top:= ScaleY(210);
Left:= ScaleX(150);
Width:= ScaleX(300);
Height:= ScaleY(15);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'AG_Helvetica';
Font.Size:= 10
Font.Color:=$000000;
Transparent:= true;
Parent:= WizardForm;
Caption:= ExpandConstant('{cm:DPO}');
end;
DirectXLabel:=TLabel.Create(WizardForm);
with DirectXLabel do
begin
Top:= ScaleY(233);
Left:= ScaleX(190);
Width:= ScaleX(400);
Height:= ScaleY(15);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'AG_Helvetica';
Font.Size:= 10
Font.Color:=$000000;
Transparent:= true;
Parent:= WizardForm;
Caption:= ExpandConstant('{cm:DirectX}');
end;
VCLabel:=TLabel.Create(WizardForm);
with VCLabel do
begin
Top:= ScaleY(258);
Left:= ScaleX(190);
Width:= ScaleX(300);
Height:= ScaleY(15);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'AG_Helvetica';
Font.Size:= 10
Font.Color:=$000000;
Transparent:= true;
Parent:= WizardForm;
Caption:= ExpandConstant('{cm:VC}');
end;
SelectTasks:=TLabel.Create(WizardForm);
with SelectTasks do
begin
Top:= ScaleY(100);
Left:= ScaleX(130);
Width:= ScaleX(450);
Height:= ScaleY(200);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'AG_Helvetica';
Font.Size:= 10
Alignment := taCenter;
Font.Style := [fsBold];
Font.Color:=clWhite;
Transparent:= true;
Parent:= WizardForm;
Caption:= ExpandConstant('{cm:SelectTasks}');
end;
DesktopLabel:=TLabel.Create(WizardForm);
with DesktopLabel do
begin
Top:= ScaleY(303);
Left:= ScaleX(190);
Width:= ScaleX(370);
Height:= ScaleY(45);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'AG_Helvetica';
Font.Size:= 10
Font.Color:=$000000;
Transparent:= true;
Parent:= WizardForm;
Caption:= ExpandConstant('Создать значок на рабочем столе');
end;
DesktopLabel1:=TLabel.Create(WizardForm);
with DesktopLabel1 do
begin
Top:= ScaleY(280);
Left:= ScaleX(150);
Width:= ScaleX(370);
Height:= ScaleY(45);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'AG_Helvetica';
Font.Size:= 10
Font.Color:=$000000;
Transparent:= true;
Parent:= WizardForm;
Caption:= ExpandConstant('Дополнительные значки:');
end;
LabelStatus := TLabel.Create(WizardForm);
with LabelStatus do begin
AutoSize:=False;
SetBounds(ScaleX(130), ScaleY(180), ScaleX(414), ScaleY(17));
Transparent:=True;
Font.Name:= 'AG_Helvetica';
Font.Size:= 10;
Font.Color:=$000000;
Caption:= 'Распаковка файлов...';
Parent := WizardForm;
Hide;
end;
/////////////////////ReadyPage///////////////////////////
ReadyLabel1:=TLabel.Create(WizardForm);
with ReadyLabel1 do
begin
Top:= ScaleY(280);
Left:= ScaleX(120);
Width:= ScaleX(370);
Height:= ScaleY(45);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'AG_Helvetica';
Font.Size:= 10
Font.Color:=$000000;
Transparent:= true;
Parent:= WizardForm;
Caption:= ExpandConstant('Папка установки:'+#13+WizardForm.DirEdit.Text);
end;
ReadyLabel2:=TLabel.Create(WizardForm);
with ReadyLabel2 do
begin
Top:= ScaleY(220);
Left:= ScaleX(120);
Width:= ScaleX(370);
Height:= ScaleY(45);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'AG_Helvetica';
Font.Size:= 10
Font.Color:=$000000;
Transparent:= true;
Parent:= WizardForm;
Caption:= ExpandConstant('Папка в меню «Пуск»:'+#13+WizardForm.GroupEdit.Text);
end;
ReadyLabel3:=TLabel.Create(WizardForm);
with ReadyLabel3 do
begin
Top:= ScaleY(230);
Left:= ScaleX(230);
Width:= ScaleX(370);
Height:= ScaleY(45);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'AG_Helvetica';
Font.Size:= 10
Font.Color:=$000000;
Transparent:= true;
Parent:= WizardForm;
end;
WerInctall1:=TLabel.Create(WizardForm);
with WerInctall1 do
begin
Top:= ScaleY(30);
Left:= ScaleX(30);
Width:= ScaleX(370);
Height:= ScaleY(45);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Corbel';
Font.Size:= 9
Font.Style := [fsBold];
Font.Color:=ClWhite;
Transparent:= true;
Parent:= WizardForm;
Caption:= ExpandConstant('Выбор папки установки');
end;
WerInstall2:=TLabel.Create(WizardForm);
with WerInstall2 do
begin
Top:= ScaleY(50);
Left:= ScaleX(30);
Width:= ScaleX(44444425);
Height:= ScaleY(11145);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Corbel';
Font.Size:= 9
Font.Style := [fsBold];
Font.Color:=ClWhite;
Transparent:= true;
Parent:= WizardForm;
Caption:= ExpandConstant('В какую папку Вы хотите установить'+' «{#MyAppName}»?');
end;
end;
//************************************************[Конец - Компоненты странниц]*************************************************************//
//************************************************[Начало руссофобия]*************************************************************//
function NextButtonClick(CurPageID: Integer): Boolean;
var
i: Longint;
c: Char;
begin
Result := True;
if CurPageID = wpSelectDir then begin
for i:=1 to length(WizardForm.DirEdit.text) do begin
c:=WizardForm.DirEdit.text[i];
if (c>=A1)and(c<=Z1) or (c>=A2)and(c<=Z2) or (c=X1) or (c=X2) then begin
MsgBox( 'В пути установки присутствуют русские буквы, что недопустимо'#13#13'Пожалуйста, повторите ввод.', mbError, mb_Ok);
Result := False;
break;
exit;
end;
end;
end;
end;
//************************************************[Конец руссофобия]*************************************************************//
procedure InitializeWizard;
begin
CreateWizardImage;
CreateWizard;
ButtonsTextures;
NeedSpace;
#ifdef Splash
begin
ExtractTemporaryFile('splash.png');
ExtractTemporaryFile('isgsg.dll');
ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}')+'\splash.png',1000,3000,1000,0,255,False,$FFFFFF,10);
end;
#endif
#ifdef Music
begin
ExtractTemporaryFile('BASS.dll');
ExtractTemporaryFile('MusicButton.png');
ExtractTemporaryFile('Music.mp3');
BASS_Init(ExpandConstant('{tmp}\Music.mp3'))
BASS_CreateOnOffButton(ExpandConstant('{tmp}\MusicButton.png'), 25, 375, 20, 20, 4)
end;
#endif
#ifdef Slides
begin
PicList:=tstringlist.Create;
ExtractTemporaryFile('01.jpg');
ExtractTemporaryFile('02.jpg');
ExtractTemporaryFile('03.jpg');
ExtractTemporaryFile('04.jpg');
ExtractTemporaryFile('05.jpg');
ExtractTemporaryFile('06.jpg');
ExtractTemporaryFile('07.jpg');
ExtractTemporaryFile('08.jpg');
ExtractTemporaryFile('09.jpg');
ExtractTemporaryFile('10.jpg');
ExtractTemporaryFile('11.jpg');
ExtractTemporaryFile('12.jpg');
ExtractTemporaryFile('13.jpg');
ExtractTemporaryFile('14.jpg');
ExtractTemporaryFile('15.jpg');
piclist.add(ExpandConstant('{tmp}') + '\01.jpg');
piclist.add(ExpandConstant('{tmp}') + '\02.jpg');
piclist.add(ExpandConstant('{tmp}') + '\03.jpg');
piclist.add(ExpandConstant('{tmp}') + '\04.jpg');
piclist.add(ExpandConstant('{tmp}') + '\05.jpg');
piclist.add(ExpandConstant('{tmp}') + '\06.jpg');
piclist.add(ExpandConstant('{tmp}') + '\07.jpg');
piclist.add(ExpandConstant('{tmp}') + '\08.jpg');
piclist.add(ExpandConstant('{tmp}') + '\09.jpg');
piclist.add(ExpandConstant('{tmp}') + '\10.jpg');
piclist.add(ExpandConstant('{tmp}') + '\11.jpg');
piclist.add(ExpandConstant('{tmp}') + '\12.jpg');
piclist.add(ExpandConstant('{tmp}') + '\13.jpg');
piclist.add(ExpandConstant('{tmp}') + '\14.jpg');
piclist.add(ExpandConstant('{tmp}') + '\15.jpg');
end;
#endif
end;
#ifdef Slides
procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
begin
CurrentPicture:=CurrentPicture+1;
if CurrentPicture=piclist.count+1 then CurrentPicture:=1;
ShowImage(piclist.strings[CurrentPicture - 1], 1);
end;
#endif
procedure Hide;
begin
ImgSetVisibility(Edit,False);
ImgSetVisibility(Space,False);
ImgSetVisibility(Ready,False);
ImgSetVisibility(work,False);
ImgSetVisibility(work1,False);
ImgSetVisibility(work2,False);
ImgSetVisibility(work5,False);
ImgSetVisibility(work4,False);
ImgSetVisibility(work3,False);
ImgSetVisibility(work6,False);
WizardForm.DirEdit.Hide;
WizardForm.GroupEdit.Hide;
DirEditLabel.Hide;
GroupEditLabel.Hide;
BtnSetVisibility(hDirBrowseBtn, false);
BtnSetVisibility(hGroupBrowseBtn, false);
ImgSetVisibility(dir, false);
ImgSetVisibility(group, false);
SelectDirPage1.Hide;
SelectDirPage2.Hide;
NeedSpaceLabel.Hide;
FreeSpaceLabel.Hide;
AfterSpaceLabel.Hide;
SelectProgramGroupPage1.Hide;
BtnSetVisibility(NoIconsCheck, false);
NoIconsLabel.Hide;
DPOLabel.Hide;
DirectXLabel.Hide;
VCLabel.Hide;
SelectTasks.Hide;
DesktopLabel.Hide;
BtnSetVisibility(DPOCheck, false);
BtnSetVisibility(DirectXCheck, false);
BtnSetVisibility(VCCheck, false);
WizardForm.ReadyMemo.Hide;
ReadyLabel1.Hide;
ReadyLabel2.Hide;
ReadyLabel3.Hide;
DesktopLabel1.Hide;
BtnSetVisibility(DesktopCheck, false);
end;
procedure CurPageChanged(CurPageID: Integer);
begin
SetStateNewButtons;
Hide;
case CurPageID of
wpWelcome:
begin
WerInctall1.Hide;
WerInstall2.Hide;
ImgSetVisibility(bwork, false);
ImgSetVisibility(work,True);
end;
wpSelectDir:
begin
ImgSetVisibility(work1,True)
ImgSetVisibility(bwork, true);
AfterSpaceLabel.Show;
NeedSpaceLabel.Show;
FreeSpaceLabel.Show;
GetFreeSpaceCaption(nil);
SelectDirPage2.Show;
SelectDirPage1.Show;
ImgSetVisibility(dir, true);
BtnSetVisibility(hDirBrowseBtn, true);
WizardForm.DirEdit.Show;
;
DirEditLabel.Show;
ImgSetVisibility(Edit,True);
ImgSetVisibility(Space,True);
end;
wpSelectProgramGroup:
begin
ImgSetVisibility(Edit,True);
NoIconsLabel.Show;
BtnSetVisibility(NoIconsCheck, True);
GroupEditLabel.Show;
SelectDirPage2.Show;
SelectProgramGroupPage1.Show;
ImgSetVisibility(group, true);
WizardForm.GroupEdit.Show;
BtnSetVisibility(hGroupBrowseBtn, true);
ImgSetVisibility(work2,True);
end;
wpSelectTasks:
begin
BtnSetVisibility(DesktopCheck, true);
if BtnGetChecked(VCCheck)=false then BtnSetChecked(DPOCheck, false);
if BtnGetChecked(VCCheck)=true then BtnSetChecked(DPOCheck, true);
if BtnGetChecked(DirectXCheck)=true then BtnSetChecked(DPOCheck, true);
if BtnGetChecked(DirectXCheck)=false then BtnSetChecked(DPOCheck, false);
SelectTasks.Show;
VCLabel.Show;
DirectXLabel.Show;
DesktopLabel1.Show;
DesktopLabel.Show;
BtnSetVisibility(DPOCheck, true);
BtnSetVisibility(DirectXCheck, true);
BtnSetVisibility(VCCheck, true);
DPOLabel.Show;
ImgSetVisibility(work3,True);
end;
wpReady:
begin
WerInctall1.Caption:='Всё готово к установке';
WerInstall2.Caption:='Программа установки готова начать установку «{#MyAppName}» на Ваш компьютер.';
ImgSetVisibility(work4,True);
ImgSetVisibility(Ready,True);
ReadyLabel1.Show;
ReadyLabel2.Show;
ReadyLabel3.Show;
end;
wpInstalling:
begin
LabelStatus.Show;
ImgSetVisibility(work5,True);
#ifdef Slides
InitializeSlideShow(WizardForm.Handle, 0, 65, scaleX(700), ScaleY(292), true, 2);
CurrentPicture:=1;
ShowImage(piclist.strings[CurrentPicture-1], 1);
TimerID:=SetTimer(0, 0, 5000, WrapTimerProc(@OnTimer, 4));
WizardForm.ProgressGauge.parent:=WizardForm;
WizardForm.ProgressGauge.setbounds(ScaleX(10), ScaleY(300), ScaleX(385), WizardForm.ProgressGauge.height);
WizardForm.CancelButton.Left:=ScaleX(405);
WizardForm.CancelButton.Top:=ScaleY(325);
#endif
end;
wpFinished:
begin
LabelStatus.Hide;
WerInctall1.Hide;
WerInstall2.Hide;
ImgSetVisibility(bwork, false);
#ifdef Slides
WizardForm.ProgressGauge.visible:=false;
DeinitializeSlideShow;
KillTimer(0, TimerID);
#endif
if not ISDoneError then ImgSetVisibility(work6,True);
end;
end;
if (CurPageID = wpFinished) and ISDoneError then
begin
ImgSetVisibility(work6,False);
ImgLoad(WizardForm.Handle,ExpandConstant('error.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
end;
WizardForm.ProgressGauge.Hide;
ImgApplyChanges(WizardForm.Handle);
end;
procedure AllCancel;
begin
SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc);
ImgPBDelete(NewPB);
ImgPBDelete(NewPB2);
ImgApplyChanges(WizardForm.Handle);
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
ISDoneExtract(CurStep);
case CurStep of
ssInstall: begin
ImgApplyChanges(WizardForm.Handle);
PBOldProc:=SetWindowLong(WizardForm.ProgressGauge.Handle,-4,CallBackProc(@PBProc,4));
end;
ssPostInstall: AllCancel;
end;
end;
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
if CurPageID=wpInstalling then begin
Confirm:=False;
Cancel:=ExitSetupMsgBox;
if Cancel then AllCancel;
end;
end;
procedure DeinitializeSetup;
begin
gdipShutDown;
if IsCustomFontInstalled then
if RemoveFontResource(PAnsiChar(ExpandConstant('{tmp}')+'\{#Font}')) then SendMessage(HWND_BROADCAST,$1D,0,0);
#ifdef Music
begin
BASS_DeInit;
gdipShutdown
end;
#endif
#ifdef Slides
begin
DeinitializeSlideShow;
KillTimer(0, TimerID);
end;
#endif
end;
Последнее редактирование модератором:

