Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Компьютеры » Программы » Inno Setup (создание инсталяционных пакетов)

Модерирует : gyra, Maz

Widok (23-11-2010 10:55): лимит страниц. продолжаем здесь  Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

   

skitonline

Junior Member
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору

Код:
#define MyAppName            "Call of Duty Black Ops"
#define AppName              "Call of Duty Black Ops"
 
;********** системные требования ************
;необходимое место на диске (МБ)
#define NeedSize             = 7600;
;необходимое место для распаковки
#define TNeedSize            = 15200;
;необходимая частота процессора (МГц)
#define Processor            = 3200;
;необходимый объем оперативной памяти (МБ)
#define RAM                  = 2048;
;необходимый объем памяти видеокарты (МБ)
#define VideoCard            = 256;
;минимальная версия винды - в примере WinXP SP2
#define WinVerMajor          = 5;
#define WinVerMinor          = 1;
#define ServicePack          = 3;
 
; Указать, где находятся файлы FreeArc и с каким расширением.
; Только если используется модуль FreeArc. Для ISDone прописывать файлы в модуле ISDone.iss.
#define ArcLocation "{src}\bin\*.bin";
 
; Если нужны дополнительные компоненты. Если нет - закомментировать.
;#define Components
 
; Если нужен FreeArc. Если нет - закомментировать. Если используется, закомментировать ISDone.
//#define FreeArc
; Если нужен ISDone. Если нет - закомментировать. Если используется, закомментировать FreeArc.
#define ISDone
 
; Только в ISDone.
; Не трогать.
#ifdef ISDone
; Сколько нужно оперативной памяти для распаковки FreeArc-а в мегабайтах.
#define NeedMem 512
; Если не нужен второй прогресс бар - закомментировать.
#define SecondProgressBar
; Для правильного распределения прогресс бара и оставшегося времени. Для тестового прогона - закомментировать. Файл records.inf переместить
; из папки с установочным файлом в папку со скриптом. Дальше раскомментировать и скомпиллировать инсталлятор.
//#define records
; Если используется precomp04. Если нет - закомментировать. Если используется, закомментировать precomp038.
#define precomp04
; Если используется precomp038. Если нет - закомментировать. Если используется, закомментировать precomp04.
//#define precomp038
; Если используется unrar. Если нет - закомментировать.
//#define unrar
#endif
 
[Setup]
AppId={2E58CA28-4694-479D-A7FD-AB7C4738D371}
AppName={#AppName}
AppVerName={#MyAppName}
DefaultDirName={pf}\Call of Duty Black Ops
DefaultGroupName=R.G Games\Call of Duty Black Ops
; Для 2-х язычного инсталла. Для автоматического выбора языка (русский, английский) - ShowLanguageDialog=auto
ShowLanguageDialog=yes
DirExistsWarning=no
OutputBaseFilename=setup
SetupIconFile=InstallFiles\xenus2.ico
VersionInfoCopyright=nik1967
; Что бы быстрей запускался - закомментировать. Что бы был меньше размер инсталлятора - раскомментировать.
;InternalCompressLevel=ultra64
;Compression=lzma/ultra64
;SolidCompression=true
DisableReadyPage=True
DiskSpanning=true
DiskSliceSize=1063004405
SlicesPerDisk=3
 
#include "Messages.iss"
 
#ifdef Components
[Components]
Name: text; Description: {cm:Languageofsubtitles}; Types: full custom; Flags: fixed
Name: text\rus; Description: {cm:Russian}; Types: full; Flags: exclusive; ExtraDiskSpaceRequired: 100000000
Name: text\eng; Description: {cm:English}; Types: custom; Flags: exclusive; ExtraDiskSpaceRequired: 200000000
Name: voice; Description: {cm:LanguageofVoice}; Types: full compact custom; Flags: fixed
Name: voice\rus; Description: {cm:Russian}; Types: full; Flags: exclusive; ExtraDiskSpaceRequired: 500000000
Name: voice\eng; Description: {cm:English}; Types: custom; Flags: exclusive; ExtraDiskSpaceRequired: 600000000
#endif
 
[Files]
Source: InstallFiles\*; Flags: dontcopy;
Source: InstallFiles\5.ico; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system;
Source: InstallFiles\xenus2.ico; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system;
Source: InstallFiles\ISSkin.dll; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system;
Source: InstallFiles\botva2.dll; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system;
Source: InstallFiles\InnoCallback.dll; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system;
Source: InstallFiles\Grey&Black.cjstyles; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system;
Source: {win}\help\*; DestDir: {app}\Files; Flags: external recursesubdirs createallsubdirs; Check: not Install;
 
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp04
Source: InstallFiles\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: InstallFiles\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: InstallFiles\precomp04.exe; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp038
Source: InstallFiles\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: InstallFiles\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: InstallFiles\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
Source: InstallFiles\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef unrar
Source: InstallFiles\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#endif
 
[Run]
Filename: {src}\Redist\DirectX\DXSETUP.exe; WorkingDir: {src}\Redist\DirectX\; Parameters: /silent; Flags: waituntilterminated; Check: DirectX and not Install; BeforeInstall: DirectXProgress;
Filename: {src}\Redist\VisualC++\vcredist_x86.exe; WorkingDir: {src}\Redist\VisualC++\; Parameters: /Q; Flags: waituntilterminated; Check: visualc and not IsWin64 and not Install; BeforeInstall: visualcProgress;
Filename: {src}\Redist\VisualC++\vcredist_x64.exe; WorkingDir: {src}\Redist\VisualC++\; Parameters: /Q; Flags: waituntilterminated; Check: visualc and IsWin64 and not Install; BeforeInstall: visualcProgress;
Filename: {src}\Redist\PhysX\PhysX.exe; WorkingDir: {src}\Redist\PhysX\; Parameters: /verysilent; Flags: waituntilterminated; Check: PhysX and not Install; BeforeInstall: PhysXProgress;
;Filename: msiexec.exe; Parameters: "-i ""{src}\Redist\PhysX\PhysX.msi"" -qn"; WorkingDir: "{src}\Redist\PhysX"; Flags: runminimized waituntilterminated; Check: PhysX; BeforeInstall: PhysXProgress;
 
 
[Icons]
Name: {group}\{#GameName}; Filename: {app}\BlackOps.exe; WorkingDir: {app}; Comment: Call of Duty Black Ops; Check: NoIcons
Name: {group}\{#GameName}; Filename: {app}\BlackOpsMP.exe; WorkingDir: {app}; Comment: Запустить мультиплеер; Check: NoIcons
Name: {group}\Открыть файл ReadMe; Filename: {app}\RedMe !!!.txt; WorkingDir: {app}; IconFilename: {app}\1.ico; Comment: Просмотреть файл ReadMe.txt; Check: NoIcons
Name: {group}\{cm:UninstallProgram,Prince Of Persia The Sands of Time}; Filename: {uninstallexe}
Name: {userdesktop}\{#GameName}; Filename: {app}\BlackOps.exe; WorkingDir: {app}; Check: Desktop
Name: {userdesktop}\Call of Duty Black Ops MP; Filename: {app}\BlackOpsMP.exe; WorkingDir: {app}; Check: Desktop
 
[Registry]
Windows Registry Editor Version 5.00
 
HKEY_CURRENT{DC1DA7F1-1934-4635-A30F-E09C3E0540E7}_USER\Software\Classes\CLSID\{CA666908-7A23-4D40-96AF-AB4C002013DE}
HKEY_CURRENT_USER\Software\Classes\CLSID\{6D7596F1- 4AB0-4E35-A9EE-450EA9DD0CF4}
 
[UninstallDelete]
Type: filesandordirs; Name: {app};
 
[Code]
const
    WFDiskTimerID        = 1;
    WFSysReqTimerID      = 2;
    ARTitleTimerID       = 2;
    BASS_ACTIVE_PAUSED   = 3;
    BASS_SAMPLE_LOOP     = 4;
 
type
    TTimerProc = procedure (h: Longword; msg: Longword; idevent: Longword; dwTime: Longword);
    TPBProc = function  (h:hWnd;Msg,wParam,lParam:Longint):Longint;
    TALabel = array of TLabel;
 
var
SystemPage, SelectTasksPage, SelectComponentsPage: TWizardPage;
WizardImg, Workspace, WizardSmallImage, WizardFinishImage, RedistCheck, logo,
Line, Edit, DirFolder, GroupFolder, HardDrivePanel, HDD, RequirementsPanel: Longint;
AppDir, unins, mp3Name, OldDisk: string;
ResultCode, ErrorCode: integer;
MusicButton,mp3Handle, hCancelBtn, hNextBtn, hBackBtn, hDirBrowseBtn, hGroupBrowseBtn, hCancelUninstBtn,
DesktopCheck, QuickLaunchCheck, DirectXCheck, PhysXCheck, NoIconsCheck, visualcCheck: HWND;
WelcomeLabel1, WelcomeLabel2, RequirementsLbl, ProcessorLbl, VideoCardLbl, SoundCardLbl, RAMLbl, SystemLbl, FinishedLabel,
ProcessorNameLbl, VideoCardNameLbl, SoundCardNameLbl, RAMTotalLbl, SystemNameLbl, NextLbl, FinishedHeadingLabel, PhysXLabel,
PageNameLabel,PageDescriptionLabel, WelcomeLabel1, WelcomeLabel2, SelectDirBrowseLabel, DirEditLabel, TotalSpaceLabel,
NeedSpaceLabel, FreeSpaceLabel, SelectTasksLabel, SelectStartMenuFolderBrowseLabel, GroupEditLabel, NoIconsLabel, SelectDirLabel,
NeedSpaceTLabel, SelectStartMenuFolderLabel, DesktopLabel, DirectXLabel, visualcLabel, RedistLabel, LogoLabel, SelectComponentsLabel: TLabel;
WFButtonFont, UPFButtonFont: TFont;
LogoPanel: TPanel;
LogoImage: TBitmapImage;
FreeMB, TotalMB: Cardinal;
ASysReq, ADisk: TALabel;
Keys: TArrayOfString;
Components, ComponentsList, ProgressInfoLabel2: TLabel;
#ifndef ISDone
  MyError: boolean;
  PB2Img, PBBkg1Img: Longint;
#endif
#ifndef FreeArc
  UnPackError: Integer;
#endif
 
function sndPlaySound(lpszSoundName: AnsiString; uFlags: cardinal):integer; external 'sndPlaySoundA@winmm.dll stdcall';
function WrapTimerProc(callback:TTimerProc; paramcount:integer):longword; external 'wrapcallback@files:innocallback.dll stdcall';
function SetTimer(hWnd: LongWord; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord): LongWord; external 'SetTimer@user32.dll stdcall';
function KillTimer(hWnd: LongWord; nIDEvent: LongWord): LongWord; external 'KillTimer@user32.dll stdcall';
function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall';
function CallBackProc(P:TPBProc;ParamCount:integer):LongWord; external 'wrapcallback@{tmp}\innocallback.dll stdcall delayload';
procedure InitProgressBar(hwnd:thandle; l,t,w,h,speed:integer; clFore, clBack: integer); external 'InitProgressBar@files:IsProgressBar.dll stdcall';
procedure DeinitProgressBar; external 'DeinitProgressBar@files:IsProgressBar.dll stdcall';
 
//******************************************* [Начало - Тема] ***************************************************//
 
procedure LoadSkin(lpszPath: string; lpszIniFileName: string ); external 'LoadSkin@files:isskin.dll stdcall delayload setuponly';
procedure LoadSkinUninst(lpszPath: string; lpszIniFileName: string ); external 'LoadSkin@{tmp}\isskin.dll stdcall delayload uninstallonly';
procedure UnloadSkin(); external 'UnloadSkin@files:isskin.dll stdcall delayload setuponly';
procedure UnloadSkinUninst(); external 'UnloadSkin@{tmp}\isskin.dll stdcall delayload uninstallonly';
function ShowWindow(hWnd: Integer; uType: Integer): Integer; external 'ShowWindow@user32.dll stdcall';
 
//******************************************* [Конец - Тема] ***************************************************//
 
procedure ReadEntries();  // читаем реестр
begin
    RegQueryStringValue(HKCU, 'Software\Russobit\start\Xenus. White Gold', 'path', AppDir);  // данные реестра
end;
 
function InitializeSetup: Boolean;
begin
    if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');
    if not FileExists(ExpandConstant('{tmp}\innocallback.dll')) then ExtractTemporaryFile('innocallback.dll');
    if not FileExists(ExpandConstant('{tmp}\BASS.dll')) then ExtractTemporaryFile('BASS.dll');
    if not FileExists(ExpandConstant('{tmp}\MusicButton.png')) then ExtractTemporaryFile('MusicButton.png');
    if not FileExists(ExpandConstant('{tmp}\Music.mp3')) then ExtractTemporaryFile('Music.mp3');
    if not FileExists(ExpandConstant('{tmp}\Grey&Black.cjstyles')) then ExtractTemporaryFile('Grey&Black.cjstyles');
 
  LoadSkin(ExpandConstant('{tmp}\Grey&Black.cjstyles'), '');
 
begin
  unins:='unins000.exe';   // исполняемый файл деинсталляции
  ReadEntries;
  if not (RegValueExists(HKCU, 'Software\Russobit\start\Xenus. White Gold', 'path')) then  // если находим в реестре нужное значение
 Result:=True else
  case MsgBox(ExpandConstant('{cm:Game} ') + ExpandConstant('{#AppName} ') + ExpandConstant('{cm:MsgBox1}'), mbInformation, MB_YESNOCANCEL or MB_DEFBUTTON3) of
    idYes:
    Result:=True;
    idNo:
  if (FileExists(AddBackslash(AppDir) + unins)) then begin
    Exec(AddBackslash(AppDir) + unins, '', ExtractFilePath(AddBackslash(AppDir) + unins), SW_SHOW, ewNoWait, ResultCode);
    end else begin
    MsgBox(ExpandConstant('{cm:MsgBox2} ') + ExpandConstant('{#AppName}, ') +#13#10+ ExpandConstant('{cm:MsgBox3}'), mbCriticalError, MB_OK or MB_DEFBUTTON1);
    Result:=False;
   end;
  end;
 end;
end;
 
//************************************************ [Начало - Вставка изображений] ***************************************************//
 
//================== Подключение модулей ==================//
 
#include "botva2.iss"
#include "PB.iss"
 
#ifdef FreeArc
 #include "FreeArc.iss"
#endif
 
#ifdef ISDone
 #include "ISDone.iss"
#endif
 
//================== Подключение модулей ==================//
 
procedure CreateWizardImage;
var
  i: integer;
begin
    with WizardForm do begin
    InnerNotebook.Hide;
    OuterNotebook.Hide;
    Center;
    Color:= $282828;  // Общий цвет инсталлятора  $282828 - серый
  end;
 
  ExtractTemporaryFile('Workspace.png');
  ExtractTemporaryFile('WizardImg.png');
  ExtractTemporaryFile('1.png');
  ExtractTemporaryFile('WizardSmallImage.png');
  ExtractTemporaryFile('Line.png');
  ExtractTemporaryFile('Edit.png');
  ExtractTemporaryFile('button.png');
  ExtractTemporaryFile('WFEnter.wav');
  ExtractTemporaryFile('Check.wav');
  ExtractTemporaryFile('Click.wav');
  ExtractTemporaryFile('DirFolder.png');
  ExtractTemporaryFile('GroupFolder.png');
  ExtractTemporaryFile('CheckBox.png');
  ExtractTemporaryFile('HardDrivePanel.png');
  ExtractTemporaryFile('HDD.png');
  ExtractTemporaryFile('RequirementsPanel.png');
  ExtractTemporaryFile('ProgressBackground.png');
  ExtractTemporaryFile('ProgressBackground2.png');
  ExtractTemporaryFile('ProgressImg.png');
 
  WizardImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\WizardImg.png'),ScaleX(0), ScaleY(0),ScaleX(497),ScaleY(313),True,True);
  WizardFinishImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\1.png'),ScaleX(0), ScaleY(0),ScaleX(497),ScaleY(313),True,True);
  Workspace:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Workspace.png'),ScaleX(30), ScaleY(30),ScaleX(437),ScaleY(253),True,True);
  WizardSmallImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\WizardSmallImage.png'),ScaleX(20), ScaleY(0),ScaleX(73),ScaleY(55),True,True);
  Line:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Line.png'),ScaleX(0), ScaleY(58),ScaleX(497),ScaleY(5),True,True);
  Edit:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Edit.png'),ScaleX(40), ScaleY(157),ScaleX(330),ScaleY(20),True,True);
  DirFolder:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\DirFolder.png'),ScaleX(40), ScaleY(70),ScaleX(30),ScaleY(40),True,True);
  GroupFolder:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\GroupFolder.png'),ScaleX(40), ScaleY(70),ScaleX(30),ScaleY(40),True,True);
  HardDrivePanel:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\HardDrivePanel.png'),ScaleX(90), ScaleY(203),ScaleX(280),ScaleY(90),True,True);
  HDD:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\HDD.png'),ScaleX(30), ScaleY(223),ScaleX(50),ScaleY(50),True,True);
  RequirementsPanel:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\RequirementsPanel.png'),ScaleX(10), ScaleY(110),ScaleX(477),ScaleY(146),True,True);
 
  ImgApplyChanges(WizardForm.Handle);
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
  sndPlaySound(ExpandConstant('{tmp}\Click.wav'),$0001);
  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;
 
procedure WFBtnEnter(hBtn:HWND);
begin
  sndPlaySound(ExpandConstant('{tmp}\WFEnter.wav'),$0001);
end;
 
procedure ButtonsTextures;
begin
  WFButtonFont:=TFont.Create;
  WFButtonFont.Style:=[fsBold];
 
  with WizardForm.BackButton do begin
    hBackBtn:=BtnCreate(WizardForm.Handle,237,297,80,80,ExpandConstant('{tmp}\button.png'),10,False);
    BtnSetEvent(hBackBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
    BtnSetEvent(hBackBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
    BtnSetFont(hBackBtn,WFButtonFont.Handle);
    BtnSetFontColor(hBackBtn,$ffffff,$000000,$ffffff,$B6B6B6);
    BtnSetCursor(hBackBtn,GetSysCursorHandle(32649));
    Width:=0;
    Height:=0;
  end;
 
  with WizardForm.NextButton do begin
    hNextBtn:=BtnCreate(WizardForm.Handle,317,297,80,80,ExpandConstant('{tmp}\button.png'),3,False);
    BtnSetEvent(hNextBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
    BtnSetEvent(hNextBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
    BtnSetFont(hNextBtn,WFButtonFont.Handle);
    BtnSetFontColor(hNextBtn,$ffffff,$000000,$ffffff,$B6B6B6);
    BtnSetCursor(hNextBtn,GetSysCursorHandle(32649));
    Width:=0;
    Height:=0;
  end;
 
  with WizardForm.CancelButton do begin
    hCancelBtn:=BtnCreate(WizardForm.Handle,408,297,80,80,ExpandConstant('{tmp}\button.png'),10,False);
    BtnSetEvent(hCancelBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
    BtnSetEvent(hCancelBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
    BtnSetFont(hCancelBtn,WFButtonFont.Handle);
    BtnSetFontColor(hCancelBtn,$ffffff,$000000,$ffffff,$B6B6B6);
    BtnSetCursor(hCancelBtn,GetSysCursorHandle(32649));
    Width:=0;
    Height:=0;
  end;
 
  with WizardForm.DirBrowseButton do begin
    hDirBrowseBtn:=BtnCreate(WizardForm.Handle,380,126,76,80,ExpandConstant('{tmp}\button.png'),10,False);
    BtnSetEvent(hDirBrowseBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
    BtnSetEvent(hDirBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
    BtnSetFont(hDirBrowseBtn,WFButtonFont.Handle);
    BtnSetFontColor(hDirBrowseBtn,$ffffff,$000000,$ffffff,$B6B6B6);
    BtnSetCursor(hDirBrowseBtn,GetSysCursorHandle(32649));
    Width:=0;
    Height:=0;
  end;
 
  with WizardForm.GroupBrowseButton do begin
    hGroupBrowseBtn:=BtnCreate(WizardForm.Handle,380,126,76,80,ExpandConstant('{tmp}\button.png'),10,False);
    BtnSetEvent(hGroupBrowseBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
    BtnSetEvent(hGroupBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
    BtnSetFont(hGroupBrowseBtn,WFButtonFont.Handle);
    BtnSetFontColor(hGroupBrowseBtn,$ffffff,$000000,$ffffff,$B6B6B6);
    BtnSetCursor(hGroupBrowseBtn,GetSysCursorHandle(32649));
    Width:=0;
    Height:=0;
  end;
end;
 
//************************************************ [Конец - Текстуры кнопок] ***************************************************//
 
//************************************************ [Начало - Музыка] ***************************************************//
 
function BASS_Init(device: Integer; freq, flags: DWORD; win: hwnd; CLSID: Integer): Boolean; external 'BASS_Init@files:BASS.dll stdcall delayload';
function BASS_StreamCreateFile(mem: BOOL; f: PAnsiChar; offset: DWORD; length: DWORD; flags: DWORD): DWORD; external 'BASS_StreamCreateFile@files:BASS.dll stdcall delayload';
function BASS_Start: Boolean; external 'BASS_Start@files:BASS.dll stdcall delayload';
function BASS_ChannelPlay(handle: DWORD; restart: BOOL): Boolean; external 'BASS_ChannelPlay@files:BASS.dll stdcall delayload';
function BASS_ChannelIsActive(handle: DWORD): Integer; external 'BASS_ChannelIsActive@files:BASS.dll stdcall delayload';
function BASS_ChannelPause(handle: DWORD): Boolean; external 'BASS_ChannelPause@files:BASS.dll stdcall delayload';
function BASS_Pause: Boolean; external 'BASS_Pause@files:BASS.dll stdcall delayload';
function BASS_Stop: Boolean; external 'BASS_Stop@files:BASS.dll stdcall delayload';
function BASS_Free: Boolean; external 'BASS_Free@files:BASS.dll stdcall delayload';
 
procedure MusicButtonClick(hBtn:HWND);
begin
  sndPlaySound(ExpandConstant('{tmp}\Click.wav'), $0001);
  if BtnGetChecked(MusicButton) then BASS_ChannelPause(mp3Handle)
    else if BASS_ChannelIsActive(mp3Handle)=BASS_ACTIVE_PAUSED then BASS_ChannelPlay(mp3Handle, False);
end;
 
procedure InsertMusic;
begin
  MusicButton:=BtnCreate(WizardForm.Handle,ScaleX(470),ScaleY(70),ScaleX(20),ScaleY(20),ExpandConstant('{tmp}\MusicButton.png'),0,True);
  BtnSetEvent(MusicButton,BtnClickEventID,WrapBtnCallback(@MusicButtonClick,1));
  BtnSetEvent(MusicButton,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
  BtnSetCursor(MusicButton,GetSysCursorHandle(32649));
 
  mp3Name:=ExpandConstant('{tmp}\Music.mp3');
  BASS_Init(-1,44100,0,0,0);
  mp3Handle:=BASS_StreamCreateFile(FALSE,PAnsiChar(mp3Name),0,0,BASS_SAMPLE_LOOP);
  BASS_Start;
  BASS_ChannelPlay(mp3Handle,False);
end;
 
//************************************************ [Конец - Музыка] ***************************************************//
 
//************************************************ [Начало - Компоненты страниц] ***************************************************//
 
function DetectHardware: Integer; external 'hwc_DetectHardware@files:get_hw_caps.dll stdcall';
function GetProcessorName: PAnsiChar; external 'hwc_GetProcessorName@files:get_hw_caps.dll stdcall';
function GetProcessorFreq: Integer; external 'hwc_GetProcessorFreq@files:get_hw_caps.dll stdcall';
function GetVideoCardName: PAnsiChar; external 'hwc_GetVideoCardName@files:get_hw_caps.dll stdcall';
function GetVidMemLocal: Integer; external 'hwc_GetVidMemLocal@files:get_hw_caps.dll stdcall';
function GetPdmWidth: Integer; external 'hwc_GetPdmWidth@files:get_hw_caps.dll stdcall';
function GetPdmHeight: Integer; external 'hwc_GetPdmHeight@files:get_hw_caps.dll stdcall';
function GetSoundCards: Integer; external 'hwc_GetSoundCards@files:get_hw_caps.dll stdcall';
function GetSoundCardName: PAnsiChar; external 'hwc_GetSoundCardName@files:get_hw_caps.dll stdcall';
function GetSystemPhys: Integer; external 'hwc_GetSystemPhys@files:get_hw_caps.dll stdcall';
function GetWindowsName: PAnsiChar; external 'hwc_GetWindowsName@files:get_hw_caps.dll stdcall';
 
function DelSp(s: string): string;
begin
  while Pos('  ',s)>0 do StringChange(s,'  ',' ');
  Result:=Trim(s);
end;
 
procedure GroupChange(Sender: TObject);
begin
  GroupEditLabel.Caption := MinimizePathName(WizardForm.GroupEdit.Text, GroupEditLabel.Font, GroupEditLabel.Width);
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 MbOrTB(Float: Extended): string;
begin
  if Float<1024 then Result:=NumToStr(Float)+' MB'
    else if (Float/1024)<1024 then Result:=NumToStr(Float/1024)+' GB'
           else if (Float/(1024*1024))<1024 then Result:=NumToStr(Float/(1024*1024))+' TB';
end;
 
procedure SysReqFlashing(h: Longword; msg: Longword; idevent: Longword; dwTime: Longword);
var
  i:integer;
begin
  for i:= 0 to GetArrayLength(ASysReq)-1 do
    if ASysReq[i].Font.Color=clLime then ASysReq[i].Font.Color:=$0000FF else ASysReq[i].Font.Color:=clLime;
end;
 
procedure DiskFlashing(h: Longword; msg: Longword; idevent: Longword; dwTime: Longword);
var
  i:integer;
begin
  for i:= 0 to GetArrayLength(ADisk)-1 do
    if ADisk[i].Font.Color=$FFFFFF then ADisk[i].Font.Color:=$0000FF else ADisk[i].Font.Color:=$FFFFFF;
end;
 
function GetElementIndex(a:TALabel; lbl:TLabel):integer;
var
  i:integer;
  f:boolean;
begin
  Result:=-1;
  f:=False;
  for i:=0 to GetArrayLength(a)-1 do
    if a[i]=lbl then begin
      f:=True;
      Break;
    end;
  if f then Result:=i;
end;
 
procedure AddLabelToArray(var a:TALabel; lbl:TLabel);
begin
  if GetElementIndex(a,lbl)=-1 then begin
    SetArrayLength(a,GetArrayLength(a)+1);
    a[GetArrayLength(a)-1]:=lbl;
  end;
end;
 
procedure DeleteLabelFromArray(var a:TALabel; lbl:integer);
var
  Last,i:integer;
begin
  if lbl<>-1 then begin
    Last:=GetArrayLength(a)-1;
    if lbl<Last then
      for i:=lbl to Last-1 do a[i]:=a[i+1];
    SetArrayLength(a,Last);
  end;
end;
 
procedure GetFreeSpaceCaption(Sender: TObject);
var
  CurrentDisk: String;
  i:integer;
begin
  CurrentDisk:=ExtractFileDrive(WizardForm.DirEdit.Text);
  DirEditLabel.Caption:=MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
  if not GetSpaceOnDisk(CurrentDisk,True,FreeMB,TotalMB) then begin
    KillTimer(WizardForm.Handle,WFDiskTimerID);
    SetArrayLength(ADisk,0);
    TotalSpaceLabel.Visible:=False;
    FreeSpaceLabel.Visible:=False;
    BtnSetEnabled(hNextBtn,False);
    WizardForm.NextButton.Enabled:=False;
    OldDisk:=CurrentDisk;
    Exit;
  end;
 
  TotalSpaceLabel.Visible:=True;
  FreeSpaceLabel.Visible:=True;
 
  if CurrentDisk<>OldDisk then begin
    OldDisk:=CurrentDisk;
    TotalSpaceLabel.Caption := ExpandConstant('{cm:TotalSpace} ') + MbOrTB(TotalMb);
    FreeSpaceLabel.Caption := ExpandConstant('{cm:FreeSpace} ') + MbOrTB(FreeMb) + ' (' + IntToStr((FreeMb*100) div TotalMB) + ' %)';
 
    if WizardForm.CurPageID = wpSelectDir then begin
      if FreeMB>={#TNeedSize} then begin
        i:=GetElementIndex(ADisk,FreeSpaceLabel);
        if i<>-1 then begin
          DeleteLabelFromArray(ADisk,i);
          FreeSpaceLabel.Font.Color:=$FFFFFF;
          if GetArrayLength(ADisk)=0 then KillTimer(WizardForm.Handle,WFDiskTimerID);
        end;
      end
      else AddLabelToArray(ADisk,FreeSpaceLabel);
 
      if TotalMb>={#TNeedSize} then begin
        i:=GetElementIndex(ADisk,TotalSpaceLabel);
        if i<>-1 then begin
          DeleteLabelFromArray(ADisk,i);
          TotalSpaceLabel.Font.Color:=$FFFFFF;
          if GetArrayLength(ADisk)=0 then KillTimer(WizardForm.Handle,WFDiskTimerID);
        end;
      end
      else AddLabelToArray(ADisk,TotalSpaceLabel);
 
      if GetArrayLength(ADisk)>0 then SetTimer(WizardForm.Handle,WFDiskTimerID,1000,WrapTimerProc(@DiskFlashing,4));
      BtnSetEnabled(hNextBtn,not (GetArrayLength(ADisk)>0));
      WizardForm.NextButton.Enabled:=not (GetArrayLength(ADisk)>0);
    end;
  end;
end;
 
function Install: Boolean;
begin
  if MyError or (UnPackError <> 0) then
    Result:= True;
end;
 
function NoIcons: Boolean;
begin
  Result:= BtnGetEnabled(hGroupBrowseBtn);
end;
 
function Desktop: Boolean;
begin
  Result:= BtnGetChecked(DesktopCheck);
end;
 
function Redist: Boolean;
begin
  Result:= BtnGetChecked(RedistCheck);
end;
 
function DirectX: Boolean;
begin
  ProgressInfoLabel.Visible:=False;
  Result:= BtnGetChecked(DirectXCheck);
end;
 
function visualc: Boolean;
begin
  ProgressInfoLabel.Visible:=False;
  Result:= BtnGetChecked(visualcCheck);
end;
 
function PhysX: Boolean;
begin
  ProgressInfoLabel.Visible:=False;
  Result:= BtnGetChecked(PhysXCheck);
end;
 
procedure NoIconsClick(hBtn:HWND);
var
  Check:boolean;
begin
  sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001);
  Check:=BtnGetChecked(hBtn);
  BtnSetEnabled(hGroupBrowseBtn, not Check);
  GroupEditLabel.Enabled:=not Check;
  if Check then NoIconsLabel.Font.Color:=$00FFFF else NoIconsLabel.Font.Color:=$FFFFFF;
end;
 
procedure NoIconsLabelClick(Sender:TObject);
begin
  BtnSetChecked(NoIconsCheck, not BtnGetChecked(NoIconsCheck));
  NoIconsClick(NoIconsCheck);
end;
 
procedure DesktopClick(hBtn:HWND);
begin
  sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001);
  if BtnGetChecked(hBtn) then DesktopLabel.Font.Color:=$00FFFF else DesktopLabel.Font.Color:=$FFFFFF;
end;
 
procedure DesktopLabelClick(Sender:TObject);
begin
  BtnSetChecked(DesktopCheck, not BtnGetChecked(DesktopCheck));
  DesktopClick(DesktopCheck);
end;
 
procedure RedistClick(hBtn:HWND);
begin
  if BtnGetChecked(RedistCheck) then BtnSetChecked(DirectXCheck, True) else BtnSetChecked(DirectXCheck, False);
  if BtnGetChecked(RedistCheck) then BtnSetChecked(visualcCheck, True) else BtnSetChecked(visualcCheck, False);
  if BtnGetChecked(RedistCheck) then BtnSetChecked(PhysXCheck, True) else BtnSetChecked(PhysXCheck, False);
  if BtnGetChecked(RedistCheck) then DirectXLabel.Font.Color:=$00FFFF else DirectXLabel.Font.Color:=$FFFFFF;
  if BtnGetChecked(RedistCheck) then visualcLabel.Font.Color:=$00FFFF else visualcLabel.Font.Color:=$FFFFFF;
  if BtnGetChecked(RedistCheck) then PhysXLabel.Font.Color:=$00FFFF else PhysXLabel.Font.Color:=$FFFFFF;
  sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001);
  if BtnGetChecked(hBtn) then RedistLabel.Font.Color:=$00FFFF else RedistLabel.Font.Color:=$FFFFFF;
end;
 
procedure RedistLabelClick(Sender:TObject);
begin
  BtnSetChecked(RedistCheck, not BtnGetChecked(RedistCheck));
  RedistClick(RedistCheck);
end;
 
procedure DirectXClick(hBtn:HWND);
begin
  if BtnGetChecked(DirectXCheck) or BtnGetChecked(visualcCheck) or BtnGetChecked(PhysXCheck) then BtnSetChecked(RedistCheck, True) else BtnSetChecked(RedistCheck, False);
  if BtnGetChecked(DirectXCheck) or BtnGetChecked(visualcCheck) or BtnGetChecked(PhysXCheck) then RedistLabel.Font.Color:=$00FFFF else RedistLabel.Font.Color:=$FFFFFF;
  sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001);
  if BtnGetChecked(hBtn) then DirectXLabel.Font.Color:=$00FFFF else DirectXLabel.Font.Color:=$FFFFFF;
end;
 
procedure DirectXLabelClick(Sender:TObject);
begin
  BtnSetChecked(DirectXCheck, not BtnGetChecked(DirectXCheck));
  DirectXClick(DirectXCheck);
end;
 
procedure DirectXProgress;
begin
  StatusLabel.Caption:=ExpandConstant('{cm:DirectX}');
  FilenameLabel.Caption:=ExpandConstant('{cm:DirectXInstall}');
  ImgSetVisibility(PBImg,False);
  ImgSetVisibility(PBBkgImg,False);
  ImgSetVisibility(PB2Img,False);
  ImgSetVisibility(PBBkg1Img,False);
  ImgApplyChanges(WizardForm.Handle);
  ProgressInfoLabel2.Hide;
  InitProgressBar(WizardForm.Handle, 41, 130, 413, 20, 210, $82FE7A, $282828);
end;
 
procedure visualcClick(hBtn:HWND);
begin
  if BtnGetChecked(visualcCheck) or BtnGetChecked(DirectXCheck) or BtnGetChecked(PhysXCheck) then BtnSetChecked(RedistCheck, True) else BtnSetChecked(RedistCheck, False);
  if BtnGetChecked(visualcCheck) or BtnGetChecked(DirectXCheck) or BtnGetChecked(PhysXCheck) then RedistLabel.Font.Color:=$00FFFF else RedistLabel.Font.Color:=$FFFFFF;
  sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001);
  if BtnGetChecked(hBtn) then visualcLabel.Font.Color:=$00FFFF else visualcLabel.Font.Color:=$FFFFFF;
end;
 
procedure visualcLabelClick(Sender:TObject);
begin
  BtnSetChecked(visualcCheck, not BtnGetChecked(visualcCheck));
  visualcClick(visualcCheck);
end;
 
procedure visualcProgress;
begin
  StatusLabel.Caption:=ExpandConstant('{cm:visualc}');
  FilenameLabel.Caption:=ExpandConstant('{cm:visualcInstall}');
  ImgSetVisibility(PBImg,False);
  ImgSetVisibility(PBBkgImg,False);
  ImgSetVisibility(PB2Img,False);
  ImgSetVisibility(PBBkg1Img,False);
  ProgressInfoLabel2.Hide;
  ImgApplyChanges(WizardForm.Handle);
  DeinitProgressBar;
  InitProgressBar(WizardForm.Handle, 41, 130, 413, 20, 70, $82FE7A, $282828);
end;
 
procedure PhysXClick(hBtn:HWND);
begin
  if BtnGetChecked(PhysXCheck) or BtnGetChecked(DirectXCheck) or BtnGetChecked(visualcCheck) then BtnSetChecked(RedistCheck, True) else BtnSetChecked(RedistCheck, False);
  if BtnGetChecked(PhysXCheck) or BtnGetChecked(DirectXCheck) or BtnGetChecked(visualcCheck) then RedistLabel.Font.Color:=$00FFFF else RedistLabel.Font.Color:=$FFFFFF;
  sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001);
  if BtnGetChecked(hBtn) then PhysXLabel.Font.Color:=$00FFFF else PhysXLabel.Font.Color:=$FFFFFF;
end;
 
procedure PhysXLabelClick(Sender:TObject);
begin
  BtnSetChecked(PhysXCheck, not BtnGetChecked(PhysXCheck));
  PhysXClick(PhysXCheck);
end;
 
procedure PhysXProgress;
begin
  StatusLabel.Caption:=ExpandConstant('{cm:PhysX}');
  FilenameLabel.Caption:=ExpandConstant('{cm:PhysXInstall}');
  ImgSetVisibility(PBImg,False);
  ImgSetVisibility(PBBkgImg,False);
  ImgSetVisibility(PB2Img,False);
  ImgSetVisibility(PBBkg1Img,False);
  ImgApplyChanges(WizardForm.Handle);
  ProgressInfoLabel2.Hide;
  DeinitProgressBar;
  InitProgressBar(WizardForm.Handle, 41, 130, 413, 20, 30, $82FE7A, $282828);
end;
 
procedure CreatePageComponents;
var
  Pdm       : string;
  vr,VidRam : Longint;
  Version   : TWindowsVersion;
begin
  PageNameLabel:=TLabel.Create(WizardForm);
  with PageNameLabel do begin
    AutoSize:= False;
    WordWrap:= True;
    SetBounds(ScaleX(110), ScaleY(10), ScaleX(370), ScaleY(14));
    Transparent:=True;
    Font.Name:= 'Georgia';
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsBold, fsItalic];
    Parent:=WizardForm;
  end;
  PageDescriptionLabel:=TLabel.Create(WizardForm);
  with PageDescriptionLabel do begin
    AutoSize:= False;
    SetBounds(ScaleX(130), ScaleY(25), ScaleX(330), ScaleY(30));
    Wordwrap:= True;
    Transparent:=True;
    Font.Name:= 'Georgia';
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Parent:=WizardForm;
end;
 
//************************************************ [Конец - Компоненты страниц] ***************************************************//
 
  ////////////////////// begin WelcomePage //////////////////////
 
  WelcomeLabel1:= TLabel.Create(WizardForm);
  with WelcomeLabel1 do begin
    AutoSize:=False
    SetBounds(ScaleX(75), ScaleY(50), ScaleX(350), ScaleY(65));
    WordWrap:=True
    Alignment := taCenter;
    Transparent:=True
    Font.Name:='Georgia';
    Font.Size:= 13;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsBold]
    Caption:= ExpandConstant('{cm:Welcome1}')+#13#10+('{#MyAppName}');
    Parent:=WizardForm;
  end;
 
  WelcomeLabel2:=TLabel.Create(WizardForm);
  with WelcomeLabel2 do begin
    AutoSize:=False
    SetBounds(ScaleX(25), ScaleY(130), ScaleX(450), ScaleY(200));
    WordWrap:=True
    Alignment := taCenter;
    Transparent:=True
    Font.Name:='Georgia';
    Font.Size:= 10;
    Font.Color:=$FFFFFF;
    Font.Style := [fsBold, fsItalic];
    Caption:= ExpandConstant('{cm:Welcome2}');
    Parent:=WizardForm;
end;
 
  ////////////////////// end WelcomePage //////////////////////
 
  ////////////////////// SystemPage //////////////////////
 
  SystemPage:=CreateCustomPage(wpLicense, ExpandConstant('{cm:Requirements1}'), ExpandConstant('{cm:Requirements2}'));
 
  RequirementsLbl := TLabel.Create(WizardForm);
  with RequirementsLbl do begin
    AutoSize:=False;
    SetBounds(ScaleX(-50), ScaleY(75), ScaleX(605), ScaleY(50));
    Alignment:= taCenter;
    Transparent:=True;
    Font.Name:= 'Georgia';
    Font.Size:= 8;
    Font.Color:=clLime;
    Font.Style:=[fsBold, fsItalic];
    Caption := ExpandConstant('{cm:Requirements3}');
    Parent:=WizardForm;
  end;
 
  NextLbl := TLabel.Create(WizardForm);
  with NextLbl do begin
    AutoSize:=False;
    SetBounds(ScaleX(-50), ScaleY(280), ScaleX(605), ScaleY(50));
    Alignment:= taCenter;
    Transparent:=True;
    Font.Name:= 'Georgia';
    Font.Size:= 8;
    Font.Color:=$ffffff;
    Font.Style:=[fsBold, fsItalic];
    Caption := ExpandConstant('{cm:NextLbl}');
    Parent:=WizardForm;
  end;
 
  //================= Начало - Процессор =================//
 
  ProcessorLbl := TLabel.Create(WizardForm);
  with ProcessorLbl do begin
    AutoSize:=False;
    SetBounds(ScaleX(15), ScaleY(113), ScaleX(150), ScaleY(22));
    Transparent:=True;
    Font.Name:= 'Arial';
    Font.Size:= 8;
    Font.Color:=$ffffff;
    Font.Style:=[fsBold];
    Caption := ExpandConstant('{cm:Processor}');
    Parent := WizardForm;
  end;
 
  ProcessorNameLbl := TLabel.Create(WizardForm);
  with ProcessorNameLbl do begin
    AutoSize:=False;
    SetBounds(ScaleX(150), ScaleY(113), ScaleX(350), ScaleY(22));
    Transparent:=True;
    Font.Name:= 'Arial';
    Font.Size:= 8;
    Font.Color:=clLime;
    Font.Style:=[fsBold];
    Caption := DelSP(GetProcessorName) + ' @' + IntToStr(GetProcessorFreq) + ' MHz';
    Parent := WizardForm;
  end;
 
  RegGetSubkeyNames(HKLM, 'Hardware\Description\System\CentralProcessor', Keys)
 
  if (GetProcessorFreq*GetArrayLength(Keys)) < {#Processor} then
  begin
    RequirementsLbl.Caption := ExpandConstant('{cm:Requirements4}');
    RequirementsLbl.Font.Color := clRed;
    AddLabelToArray(AsysReq,ProcessorNameLbl);
  end;
 
//================= Конец - Процессор =================//
 
//================= Начало - Видеоадаптер =================//
 
  VideoCardLbl := TLabel.Create(WizardForm);
  with VideoCardLbl do begin
    AutoSize:=False;
    SetBounds(ScaleX(15), ScaleY(144), ScaleX(150), ScaleY(22));
    Transparent:=True;
    Font.Name:= 'Arial';
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsBold];
    Caption := ExpandConstant('{cm:VideoCard}');
    Parent := WizardForm;
  end;
 
  VideoCardNameLbl := TLabel.Create(WizardForm);
  with VideoCardNameLbl do begin
    AutoSize:=False;
    SetBounds(ScaleX(150), ScaleY(144), ScaleX(350), ScaleY(22));
    Transparent:=True;
    Font.Name:= 'Arial';
    Font.Size:= 8;
    Font.Color:=clLime;
    Font.Style:=[fsBold];
    Caption := GetVideoCardName;
    Parent := WizardForm;
  end;
 
  Pdm:=' ['+IntToStr(GetPdmWidth)+'x'+IntToStr(GetPdmHeight)+']';
 
  VidRam:=GetVidMemLocal/1000000;
  if (VidRam<63) or (VidRam>1100) then vr:=VidRam
  else if VidRam<100 then vr:=64
  else if VidRam<200 then vr:=128
  else if VidRam<300 then vr:=256
  else if VidRam<400 then vr:=384
  else if VidRam<600 then vr:=512
  else if VidRam<800 then vr:=792
  else if VidRam>800 then vr:=1024;
 
  if VidRam=0 then VideoCardNameLbl.Caption:=ExpandConstant('{cm:DeviceDriver}')
    else VideoCardNameLbl.Caption:=DelSp(VideoCardNameLbl.Caption)+' ~'+IntToStr(vr)+' MB'+Pdm;
  if vr<{#VideoCard} then begin
    RequirementsLbl.Caption:=ExpandConstant('{cm:Requirements4}');
    RequirementsLbl.Font.Color := clRed;
    AddLabelToArray(ASysReq,VideoCardNameLbl);
  end;
 
//================= Конец - Видеоадаптер =================//
 
//================= Начало - Звуковая карта =================//
 
  SoundCardLbl := TLabel.Create(WizardForm);
  with SoundCardLbl do begin
    AutoSize:=False;
    SetBounds(ScaleX(15), ScaleY(175), ScaleX(150), ScaleY(22));
    Transparent:=True;
    Font.Name:= 'Arial';
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsBold];
    Caption := ExpandConstant('{cm:SoundCard}');
    Parent := WizardForm;
  end;
 
  SoundCardNameLbl := TLabel.Create(WizardForm);
  with SoundCardNameLbl do begin
    AutoSize:=False;
    SetBounds(ScaleX(150), ScaleY(175), ScaleX(350), ScaleY(22));
    Transparent:=True;
    Font.Name:= 'Arial';
    Font.Size:= 8;
    Font.Color:=clLime;
    Font.Style:=[fsBold];
    Caption := GetSoundCardName;
    Parent := WizardForm;
  end;
 
  if GetSoundCards = 0 then begin
    RequirementsLbl.Caption:= ExpandConstant('{cm:Requirements4}');
    RequirementsLbl.Font.Color := clRed;
    SoundCardNameLbl.Caption:= ExpandConstant('{cm:DeviceDriver}');
    AddLabelToArray(ASysReq,SoundCardNameLbl);
  end;
 
//================= Конец - Звуковая карта =================//
 
//================= Начало - ОЗУ =================//
 
  RAMLbl := TLabel.Create(WizardForm);
  with RAMLbl do begin
    AutoSize:=False;
    SetBounds(ScaleX(15), ScaleY(206), ScaleX(150), ScaleY(22));
    Transparent:=True;
    Font.Name:= 'Arial';
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsBold];
    Caption := ExpandConstant('{cm:RAM}');
    Parent := WizardForm;
  end;
 
  RAMTotalLbl := TLabel.Create(WizardForm);
  with RAMTotalLbl do begin
    AutoSize:=False;
    SetBounds(ScaleX(150), ScaleY(206), ScaleX(350), ScaleY(22));
    Transparent:=True;
    Font.Name:= 'Arial';
    Font.Size:= 8;
    Font.Color:=clLime;
    Font.Style:=[fsBold];
    Caption := IntToStr(GetSystemPhys + 1) + ' MB';
    Parent := WizardForm;
  end;
 
  if (GetSystemPhys+1)<{#RAM} then begin
    RequirementsLbl.Caption := ExpandConstant('{cm:Requirements4}');
    RequirementsLbl.Font.Color := clRed;
    AddLabelToArray(ASysReq,RAMTotalLbl);
  end;
 
//================= Конец - ОЗУ =================//
 
//================= Начало - Операционная система =================//
 
  SystemLbl := TLabel.Create(WizardForm);
  with SystemLbl do begin
    AutoSize:=False;
    SetBounds(ScaleX(15), ScaleY(237), ScaleX(150), ScaleY(22));
    Transparent:=True;
    Font.Name:= 'Arial';
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsBold];
    Caption := ExpandConstant('{cm:OperationSystem}');
    Parent := WizardForm;
  end;
 
  SystemNameLbl := TLabel.Create(WizardForm);
  with SystemNameLbl do begin
    AutoSize:=False;
    SetBounds(ScaleX(150), ScaleY(237), ScaleX(350), ScaleY(22));
    Transparent:=True;
    Font.Name:= 'Arial';
    Font.Size:= 8;
    Font.Color:=clLime;
    Font.Style:=[fsBold];
    Caption := GetWindowsName;
    Parent := WizardForm;
  end;
 
  GetWindowsVersionEx(Version);
 
  if not Version.NTPlatform or
    (Version.NTPlatform and (Version.Major<{#WinVerMajor})) or
    (Version.NTPlatform and (Version.Major={#WinVerMajor}) and (Version.Minor<{#WinVerMinor})) or
    (Version.NTPlatform and (Version.Major={#WinVerMajor}) and (Version.Minor={#WinVerMinor}) and (Version.ServicePackMajor<{#ServicePack})) then begin
    RequirementsLbl.Caption := ExpandConstant('{cm:Requirements4}');
    RequirementsLbl.Font.Color := clRed;
    AddLabelToArray(ASysReq,SystemNameLbl);
  end;
 
//================= Конец - Операционная система =================//
 
////////////////////// SystemPage //////////////////////
 
  ////////////////////// begin SelectDirPage //////////////////////
 
  SelectDirLabel := TLabel.Create(WizardForm);
  with SelectDirLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(85), ScaleY(85), ScaleX(400), ScaleY(50));
    WordWrap:= True;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Caption:= WizardForm.SelectDirLabel.Caption;
    Parent := WizardForm;
  end;
 
  SelectDirBrowseLabel := TLabel.Create(WizardForm);
  with SelectDirBrowseLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(40), ScaleY(120), ScaleX(400), ScaleY(50));
    WordWrap:= True;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Caption:= WizardForm.SelectDirBrowseLabel.Caption;
    Parent := WizardForm;
  end;
 
  DirEditLabel := TLabel.Create(WizardForm);
  with DirEditLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(50), ScaleY(160), ScaleX(446), ScaleY(15));
    WordWrap:= True;
    ShowAccelChar := False;
    Transparent:=True;
    Font.Name:= 'Arial'
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsBold];
    Caption := MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
    Parent := WizardForm;
  end;
 
  TotalSpaceLabel := TLabel.Create(WizardForm);
  with TotalSpaceLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(100), ScaleY(210), ScaleX(446), ScaleY(17));
    Transparent:=True;
    Font.Name:= 'Georgia';
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Parent := WizardForm;
  end;
 
  FreeSpaceLabel := TLabel.Create(WizardForm);
  with FreeSpaceLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(100), ScaleY(230), ScaleX(500), ScaleY(17));
    Transparent:=True;
    Font.Name:= 'Georgia';
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Parent := WizardForm;
  end;
 
  NeedSpaceLabel := TLabel.Create(WizardForm);
  with NeedSpaceLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(100), ScaleY(250), ScaleX(500), ScaleY(17));
    Transparent:=True;
    Font.Name:= 'Georgia';
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Caption := ExpandConstant('{cm:NeedSpace} ') + MbOrTB({#NeedSize});
    Parent := WizardForm;
end;
 
NeedSpaceTLabel := TLabel.Create(WizardForm);
  with NeedSpaceTLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(100), ScaleY(270), ScaleX(500), ScaleY(17));
    Transparent:=True;
    Font.Name:= 'Georgia';
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Caption := ExpandConstant('{cm:TNeedSpace} ') + MbOrTB({#TNeedSize});
    Parent := WizardForm;
end;
 
  ////////////////////// end SelectDirPage //////////////////////
 
  ////////////////////// begin SelectProgramGroupPage //////////////////////
 
  SelectStartMenuFolderLabel := TLabel.Create(WizardForm);
  with SelectStartMenuFolderLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(85), ScaleY(85), ScaleX(400), ScaleY(50));
    WordWrap:= True;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Caption:= WizardForm.SelectStartMenuFolderLabel.Caption;
    Parent := WizardForm;
  end;
 
  SelectStartMenuFolderBrowseLabel := TLabel.Create(WizardForm);
  with SelectStartMenuFolderBrowseLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(40), ScaleY(120), ScaleX(400), ScaleY(50));
    WordWrap:= True;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Caption:= WizardForm.SelectStartMenuFolderBrowseLabel.Caption;
    Parent := WizardForm;
  end;
 
  GroupEditLabel := TLabel.Create(WizardForm);
  with GroupEditLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(50), ScaleY(160), ScaleX(446), ScaleY(15));
    WordWrap:= True;
    ShowAccelChar := False;
    Transparent:=True;
    Font.Name:= 'Arial'
    Font.Size:= 9;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsBold];
    Caption := MinimizePathName(WizardForm.GroupEdit.Text, GroupEditLabel.Font, GroupEditLabel.Width);
    Parent := WizardForm;
  end;
 
  NoIconsCheck:=BtnCreate(WizardForm.Handle,ScaleX(40),ScaleY(280),ScaleX(25),ScaleY(25),ExpandConstant('{tmp}\CheckBox.png'),8,True);
  BtnSetEvent(NoIconsCheck,BtnClickEventID,WrapBtnCallback(@NoIconsClick,1));
  BtnSetEvent(NoIconsCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
  BtnSetCursor(NoIconsCheck,GetSysCursorHandle(32649));
 
  NoIconsLabel := TLabel.Create(WizardForm);
  with NoIconsLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(75), ScaleY(285), ScaleX(275), ScaleY(17));
    OnClick:= @NoIconsLabelClick;
    Cursor:= CrHand;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Caption := WizardForm.NoIconsCheck.Caption;
    Parent := WizardForm;
  end;
 
  WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
  WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text;
  WizardForm.GroupEdit.OnChange := @GroupChange;
//end;
 
////////////////////// end SelectProgramGroupPage //////////////////////
 
////////////////////// begin SelectComponentsPage //////////////////////
 
#ifdef Components
ComponentsList := TLabel.Create(WizardForm);
with ComponentsList do begin
    WizardForm.ComponentsList.Left:= ScaleX(50)///положение панели
    WizardForm.ComponentsList.Top:= ScaleY(150);
    WizardForm.ComponentsList.Width:= ScaleX(400)///размер панели
    WizardForm.ComponentsList.Height:= ScaleY(120)
    WizardForm.ComponentsList.Color:= $272727;///цвет фона в панели страници компонентов
    WizardForm.ComponentsList.Font.Color:= ClWhite;///цвет текста в панели страници компонентов
    WizardForm.ComponentsList.Font.Style:= [fsBold];
    WizardForm.ComponentsList.Font.Size:= 8;
    WizardForm.ComponentsList.Font.Name:= 'Arial'
    WizardForm.ComponentsList.Parent:= WizardForm;
    WizardForm.SelectComponentsPage;
  end;
  SelectComponentsLabel := TLabel.Create(WizardForm);
with SelectComponentsLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(50), ScaleY(75), ScaleX(400), ScaleY(70));
    WordWrap:= True;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Caption:= ExpandConstant('{cm:SelectComponentsLabel}');
    Parent := WizardForm;
  end;
#endif
 
////////////////////// end  SelectComponentsPage //////////////////////
 
////////////////////// begin SelectTasksPade //////////////////////
 
  SelectTasksPage := CreateCustomPage(wpSelectProgramGroup, ExpandConstant('{cm:TasksName}'), ExpandConstant('{cm:TasksDescription}'));
  SelectTasksLabel := TLabel.Create(WizardForm);
  with SelectTasksLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(40), ScaleY(75), ScaleX(440), ScaleY(50));
    WordWrap:= True;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Caption:= ExpandConstant('{cm:SelectTasksLabel}');
    Parent := WizardForm;
  end;
 
  DesktopCheck:=BtnCreate(WizardForm.Handle,ScaleX(40),ScaleY(110),ScaleX(25),ScaleY(25),ExpandConstant('{tmp}\CheckBox.png'),8,True);
  BtnSetEvent(DesktopCheck,BtnClickEventID,WrapBtnCallback(@DesktopClick,1));
  BtnSetEvent(DesktopCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
  BtnSetCursor(DesktopCheck,GetSysCursorHandle(32649));
  BtnSetChecked(DesktopCheck,True);
 
  DesktopLabel := TLabel.Create(WizardForm);
  with DesktopLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(75), ScaleY(116), ScaleX(265), ScaleY(17));
    OnClick:= @DesktopLabelClick;
    Cursor:= CrHand;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 8;
    Font.Color:=$00FFFF;
    Font.Style:=[fsItalic];
    Caption := ExpandConstant('{cm:Desktop}');
    Parent := WizardForm;
  end;
 
  RedistCheck:=BtnCreate(WizardForm.Handle,ScaleX(40),ScaleY(135),ScaleX(25),ScaleY(25),ExpandConstant('{tmp}\CheckBox.png'),8,True);
  BtnSetEvent(RedistCheck,BtnClickEventID,WrapBtnCallback(@RedistClick,1));
  BtnSetEvent(RedistCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
  BtnSetCursor(RedistCheck,GetSysCursorHandle(32649));
  BtnSetChecked(RedistCheck, False);
 
  RedistLabel := TLabel.Create(WizardForm);
  with RedistLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(75), ScaleY(141), ScaleX(265), ScaleY(17));
    OnClick:= @RedistLabelClick;
    Cursor:= CrHand;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Caption := ExpandConstant('{cm:Redist}');
    Parent := WizardForm;
  end;
 
  DirectXCheck:=BtnCreate(WizardForm.Handle,ScaleX(70),ScaleY(160),ScaleX(25),ScaleY(25),ExpandConstant('{tmp}\CheckBox.png'),8,True);
  BtnSetEvent(DirectXCheck,BtnClickEventID,WrapBtnCallback(@DirectXClick,1));
  BtnSetEvent(DirectXCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
  BtnSetCursor(DirectXCheck,GetSysCursorHandle(32649));
  BtnSetChecked(DirectXCheck, False);
 
  DirectXLabel := TLabel.Create(WizardForm);
  with DirectXLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(100), ScaleY(166), ScaleX(195), ScaleY(17));
    OnClick:= @DirectXLabelClick;
    Cursor:= CrHand;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Caption := ExpandConstant('{cm:DirectX}');
    Parent := WizardForm;
  end;
 
  VisualCCheck:=BtnCreate(WizardForm.Handle,ScaleX(70),ScaleY(185),ScaleX(25),ScaleY(25),ExpandConstant('{tmp}\CheckBox.png'),8,True);
  BtnSetEvent(VisualCCheck,BtnClickEventID,WrapBtnCallback(@VisualCClick,1));
  BtnSetEvent(VisualCCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
  BtnSetCursor(VisualCCheck,GetSysCursorHandle(32649));
  BtnSetChecked(VisualCCheck, False);
 
  VisualCLabel := TLabel.Create(WizardForm);
  with VisualCLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(100), ScaleY(191), ScaleX(195), ScaleY(17));
    OnClick:= @VisualCLabelClick;
    Cursor:= CrHand;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Caption := ExpandConstant('{cm:VisualC}');
    Parent := WizardForm;
  end;
   
  PhysXCheck:=BtnCreate(WizardForm.Handle,ScaleX(70),ScaleY(210),ScaleX(25),ScaleY(25),ExpandConstant('{tmp}\CheckBox.png'),8,True);
  BtnSetEvent(PhysXCheck,BtnClickEventID,WrapBtnCallback(@PhysXClick,1));
  BtnSetEvent(PhysXCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
  BtnSetCursor(PhysXCheck,GetSysCursorHandle(32649));
  BtnSetChecked(PhysXCheck, False);
 
  PhysXLabel := TLabel.Create(WizardForm);
  with PhysXLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(100), ScaleY(216), ScaleX(195), ScaleY(17));
    OnClick:= @PhysXLabelClick;
    Cursor:= CrHand;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Caption := ExpandConstant('{cm:PhysX}');
    Parent := WizardForm;
  end;
 
////////////////////// end SelectTasksPade //////////////////////
 
////////////////////// begin InstallingPage //////////////////////
 
  StatusLabel := TLabel.Create(WizardForm);
  with StatusLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(40), ScaleY(80), ScaleX(400), ScaleY(17));
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsBold,fsItalic];
    Parent := WizardForm;
  end;
 
  FilenameLabel := TLabel.Create(WizardForm);
  with FilenameLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(40), ScaleY(100), ScaleX(417), ScaleY(17));
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Parent := WizardForm;
  end;
 
  ProgressInfoLabel := TLabel.Create(WizardForm);
  with ProgressInfoLabel do
  begin
    AutoSize:=False;
#ifdef ISDone
    SetBounds (420, 132, ScaleX(638), ScaleY(50));
#else
    SetBounds (-70, 165, ScaleX(638), ScaleY(50));
    Alignment := taCenter;
#endif
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Parent := WizardForm;
  end;
   
  ProgressInfoLabel2 := TLabel.Create(WizardForm);
  with ProgressInfoLabel2 do
  begin
    AutoSize:=False;
#ifdef ISDone
    SetBounds (-70, 200, ScaleX(638), ScaleY(50));
#else
    SetBounds (-70, 190, ScaleX(638), ScaleY(50));
#endif
    Alignment := taCenter;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 8;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsItalic];
    Parent := WizardForm;
  end;
 
////////////////////// end InstallingPage //////////////////////
 
////////////////////// begin FinishedPage //////////////////////
 
  FinishedHeadingLabel:= TLabel.Create(WizardForm);
  with FinishedHeadingLabel do begin
    AutoSize:=False
    SetBounds(ScaleX(75), ScaleY(60), ScaleX(350), ScaleY(65));
    WordWrap:=True
    Alignment := taCenter;
    Transparent:=True
    Font.Name:='Georgia';
    Font.Size:= 13;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsBold]
    Caption:= ExpandConstant('{cm:FinishedHeading}');
    Parent:=WizardForm;
  end;
 
  FinishedLabel:=TLabel.Create(WizardForm);
  with FinishedLabel do begin
    AutoSize:=False
    SetBounds(ScaleX(75), ScaleY(125), ScaleX(348), ScaleY(200));
    WordWrap:=True
    Transparent:=True
    Font.Name:='Georgia';
    Font.Size:= 10;
    Font.Color:=$FFFFFF;
    Font.Style := [fsBold, fsItalic];
    Caption:= ExpandConstant('{cm:FinishedLabel}')+#13#13+ExpandConstant('{cm:FinishedLabel2}');
    Parent:=WizardForm;
  end;
end;
 
////////////////////// end FinishedPage //////////////////////
 
function InitializeUninstall(): Boolean;
begin
  FileCopy(ExpandConstant('{app}\isskin.dll'), ExpandConstant('{tmp}\isskin.dll'), False);
  FileCopy(ExpandConstant('{app}\Grey&Black.cjstyles'), ExpandConstant('{tmp}\Grey&Black.cjstyles'), False);
  FileCopy(ExpandConstant('{app}\InnoCallback.dll'), ExpandConstant('{tmp}\InnoCallback.dll'), False);
  LoadSkinUninst(ExpandConstant('{tmp}\Grey&Black.cjstyles'), '');
  Result := True;
end;
 
//================== Удаление сохранений ==================//
 
procedure DeleteSavedGames(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep=usUninstall then
  if DirExists(ExpandConstant('{commondocs}')+'\White Gold') then
  if MsgBox(ExpandConstant('{cm:DeleteSave}'), mbInformation, MB_YESNO) = idYes then
  DelTree(ExpandConstant('{commondocs}')+'\White Gold', True, True, True);
end;
 
//================== Удаление сохранений ==================//
 
procedure HideComponents;
begin
  WelcomeLabel1.Hide;
  WelcomeLabel2.Hide;
  SelectDirLabel.Hide;
  SelectDirBrowseLabel.Hide;
  DirEditLabel.Hide;
  TotalSpaceLabel.Hide;
  FreeSpaceLabel.Hide;
  NeedSpaceLabel.Hide;
  NeedSpaceTLabel.Hide;
  NoIconsLabel.Hide;
  SelectStartMenuFolderLabel.Hide;
  SelectStartMenuFolderBrowseLabel.Hide;
  GroupEditLabel.Hide;
  RequirementsLbl.Hide;
  NextLbl.Hide;
  ProcessorLbl.Hide;
  ProcessorNameLbl.Hide;
  VideoCardLbl.Hide;
  VideoCardNameLbl.Hide;
  SoundCardLbl.Hide;
  SoundCardNameLbl.Hide;
  RAMLbl.Hide;
  RAMTotalLbl.Hide;
  SystemLbl.Hide;
  SystemNameLbl.Hide;
  SelectTasksLabel.Hide;
  DesktopLabel.Hide;
  RedistLabel.Hide;
  DirectXLabel.Hide;
  VisualCLabel.Hide;
  PhysXLabel.Hide;
  StatusLabel.Hide;
  FilenameLabel.Hide;
  FinishedHeadingLabel.Hide;
  FinishedLabel.Hide;
  ProgressInfoLabel.Hide;
  ProgressInfoLabel2.Hide;
#ifdef Components
  WizardForm.ComponentsList.Hide;
  SelectComponentsLabel.Hide;
#endif
#ifdef FreeArc
  LabelStatusRollback.Hide;
  LabelStatus.Hide;
#endif
#ifdef ISDone
  LabelStatusRollback.Hide;
  LabelStatus.Hide;
  LabelTime1.Hide;
  LabelTime2.Hide;
  LabelTime3.Hide;
  ImgSetVisibility(PBBkg1Img,False);
  ImgSetVisibility(PB2Img,False);
#endif
end;
 
procedure ShowComponents(CurPageID: Integer);
begin
  PageNameLabel.Caption:=WizardForm.PageNameLabel.Caption
  PageDescriptionLabel.Caption:=WizardForm.PageDescriptionLabel.Caption
    if CurPageID > wpWelcome then
    if CurPageID < wpFinished then ImgSetVisibility(WizardSmallImage,True);
    if CurPageID > wpWelcome then
    if CurPageID < wpFinished then ImgSetVisibility(Line,True);
    if CurPageID > wpWelcome then
    if CurPageID < wpFinished then BtnSetVisibility(MusicButton,True);
case CurPageID of
    wpWelcome: begin
    ImgSetVisibility(WizardImg,True);
    ImgSetVisibility(Workspace,True);
    WelcomeLabel1.Show
    WelcomeLabel2.Show
  end;
    SystemPage.ID: begin
    ImgSetVisibility(RequirementsPanel,True);
    RequirementsLbl.Show;
    NextLbl.Show;
    ProcessorLbl.Show;
    ProcessorNameLbl.Show;
    VideoCardLbl.Show;
    VideoCardNameLbl.Show;
    SoundCardLbl.Show;
    SoundCardNameLbl.Show;
    RAMLbl.Show;
    RAMTotalLbl.Show;
    SystemLbl.Show;
    SystemNameLbl.Show;
    BtnSetVisibility(MusicButton,True);
    ImgSetVisibility(WizardSmallImage,True);
    ImgSetVisibility(Line,True);
  end;
    wpSelectDir: begin
    ImgSetVisibility(Edit,True);
    ImgSetVisibility(DirFolder,True);
    ImgSetVisibility(HardDrivePanel,True)
    ImgSetPosition(HardDrivePanel, 90, 203, 280, 90);
    ImgSetVisibility(HDD,True);
    SelectDirLabel.Show
    SelectDirBrowseLabel.Show
    DirEditLabel.Show;
    TotalSpaceLabel.Show;
    FreeSpaceLabel.Show;
    NeedSpaceLabel.Show;
    NeedSpaceTLabel.Show;
    BtnSetVisibility(hDirBrowseBtn,True);
  end;
#ifdef Components
    wpSelectComponents: begin
    WizardForm.ComponentsList.Show;
    ImgSetVisibility(HardDrivePanel,True);
    ImgSetPosition(HardDrivePanel, 49, 149, 402, 122);
    SelectComponentsLabel.Show;
  end;
#endif
    wpSelectProgramGroup: begin
    ImgSetVisibility(GroupFolder,True);
    ImgSetVisibility(Edit,True);
    BtnSetVisibility(hGroupBrowseBtn,True);
    BtnSetVisibility(NoIconsCheck,True);
    SelectStartMenuFolderLabel.Show;
    SelectStartMenuFolderBrowseLabel.Show;
    WizardForm.GroupBrowseButton.Show;
    GroupEditLabel.Show;
    NoIconsLabel.Show;
  end;
    SelectTasksPage.ID: begin
    BtnSetVisibility(DesktopCheck,True);
    BtnSetVisibility(RedistCheck,True);
    BtnSetVisibility(DirectXCheck,True);
    BtnSetVisibility(VisualCCheck,True);
    BtnSetVisibility(PhysXCheck,True);
    SelectTasksLabel.Show;
    DesktopLabel.Show;
    RedistLabel.Show;
    DirectXLabel.Show;
    VisualCLabel.Show;
    PhysXLabel.Show;
    BtnSetVisibility(MusicButton,True);
    ImgSetVisibility(WizardSmallImage,True);
    ImgSetVisibility(Line,True);
    WizardForm.NextButton.Caption:=SetupMessage(msgButtonInstall);
  end;
    wpInstalling: begin
    StatusLabel.Show;
    FilenameLabel.Show;
    ProgressInfoLabel.Show;
    ProgressInfoLabel2.Show;
#ifdef ISDone
    LabelTime1.Show;
    LabelTime2.Show;
#endif
  end;
    wpFinished: begin
    ImgSetVisibility(WizardFinishImage,True);
    ImgSetVisibility(Workspace,True);
    FinishedHeadingLabel.Show;
    FinishedLabel.Show;
#ifdef ISDone
    LabelTime3.Show;
#endif
  end;
 end;
end;
 
//************************************************ [Конец - Компоненты страниц] ***************************************************//
 
//************************************************ [Начало - ПрогрессБары] ***************************************************//
 
procedure AllCancel;
begin
  SetWindowLong(WizardForm.ProgressGauge.Handle, -4, PBOldProc);
  ImgSetVisibility(PBImg,False);
  ImgSetVisibility(PBBkgImg,False);
  ImgApplyChanges(WizardForm.Handle);
end;
 
procedure CurStepChanged(CurStep: TSetupStep);
begin
#ifdef FreeArc
  UnpackingArc(CurStep);
#endif
#ifdef ISDone
  UnpackingISDone(CurStep);
#endif
  case CurStep of
    ssInstall: begin
      if GetArrayLength(ADisk)>0 then begin
        KillTimer(WizardForm.Handle,WFDiskTimerID);
           SetArrayLength(ADisk,0);
      end;
      if GetArrayLength(ASysReq)>0 then begin
        KillTimer(WizardForm.Handle,WFSysReqTimerID);
          SetArrayLength(ASysReq,0);
      end;
#ifdef ISDone
      if MyError = true or (Cancel <> 0) then
      begin
      WizardForm.StatusLabel.Hide;
      LabelStatusRollback.Show;
      FilenameLabel.Hide;
      LabelPct.Hide;
#ifdef SecondProgressBar
      Label2Pct.Hide;
#endif
      ProgressInfoLabel.Hide;
      ProgressInfoLabel2.Hide;
      LabelCurrFileName.Hide;
      LabelStatus.Hide;
      PageNameLabel.Hide;
      PageDescriptionLabel.Hide;
      LabelTime1.Hide;
      LabelTime2.Hide;
      LabelTime3.Hide;
      BtnSetEnabled(CancelUnpackingBtn, False);
      BtnSetEnabled(hCancelBtn, False);
      SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc);
      ImgSetVisibility(PBImg,False);
      ImgSetVisibility(PB1Img,False);
      ImgSetVisibility(PB2Img,False);
      ImgSetVisibility(PBBkgImg,False);
      ImgSetVisibility(PBBkg1Img,False);
      ImgApplyChanges(WizardForm.Handle);
   end;
#endif
#ifdef FreeArc
      if (UnPackError <> 0) then
      begin
      WizardForm.StatusLabel.Hide;
      LabelStatusRollback.Show;
      FilenameLabel.Hide;
      LabelStatus.Hide;
      ProgressInfoLabel.Hide;
      ProgressInfoLabel2.Hide;
      PageNameLabel.Hide;
      PageDescriptionLabel.Hide;
      BtnSetEnabled(CancelUnpackingBtn, False);
      BtnSetEnabled(hCancelBtn, False);
      SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc);
      ImgSetVisibility(PBImg,False);
      ImgSetVisibility(PB1Img,False);
      ImgSetVisibility(PBBkgImg,False);
      ImgApplyChanges(WizardForm.Handle);
   end;
#endif
      WizardForm.ProgressGauge.Visible:=False;
#ifndef ISDone
#ifndef FreeArc
      // Прогрессбары создаются в скрипте
      PBBkgImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\ProgressBackground.png'),41,130,413,20,True,True);
      PBImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\ProgressImg.png'),43,132,0,16,True,True);
      ImgApplyChanges(WizardForm.Handle);
      PBOldProc:=SetWindowLong(WizardForm.ProgressGauge.Handle,-4,WndProcCallBack(@PBProc,4));
#endif
#endif
        sTime:=GetTickCount;
      eTime:=sTime;
    end;
    ssPostInstall: AllCancel;
  end;
end;
 
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  DeleteSavedGames(CurUninstallStep);
end;
 
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
  if CurPageID=wpInstalling then begin
    Confirm:=False;
    Cancel:=ExitSetupMsgBox;
    if Cancel then begin
      AllCancel;
      StatusLabel.Caption:=SetupMessage(msgStatusRollback);
      FilenameLabel.Hide;
      ProgressInfoLabel.Hide;
      ProgressInfoLabel2.Hide;
      PageNameLabel.Hide;
      PageDescriptionLabel.Hide;
      WizardForm.CancelButton.Enabled:=False;
    end;
  end;
end;
 
//************************************************ [Конец - ПрогрессБары] ***************************************************//
 
//******************************************* [ logo - Лого как ссылка внизу слева ] ***************************************************//
 
procedure LogoLabelOnClick(Sender: TObject);
var
  ErrorCode: Integer;
  begin
  ShellExec('open', 'http://forum.ru-board.com/topic.cgi?forum=5&topic=33457&start=0', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode)
end;
 
procedure LogoCreate;
begin
  LogoPanel := TPanel.Create(WizardForm);
  with LogoPanel do
begin
  Parent := WizardForm;
  Left := ScaleX(7);
  Top := ScaleY(319);
  Width := ScaleX(170);
  Height := ScaleY(35);
  BevelOuter := bvNone;
 
  LogoImage := TBitmapImage.Create(WizardForm);
with LogoImage do
begin
  Parent := LogoPanel;
  Left := ScaleX(0);
  Top := ScaleY(0);
  AutoSize:=true;
  ReplaceColor:=clFuchsia;
  ReplaceWithColor:=clBtnFace;
  ExtractTemporaryFile('logo.bmp');
  Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
 
  LogoLabel := TLabel.Create(WizardForm);
with LogoLabel do
begin
  Parent := LogoPanel;
  Width := LogoPanel.Width;
  Height := LogoPanel.Height;
  Transparent:=True;
  Cursor := crHand;
  OnClick:=@LogoLabelOnClick;
  end;
 end;
end
end;
 
procedure InitializeWizard;
begin
  InsertMusic;
  CreateWizardImage;
  ButtonsTextures;
  CreatePageComponents;
  LogoCreate;
   
  //ShellExec('', ExpandConstant('{src}\Redist\PhysX\PhysX.msi'),'/qn', '', SW_SHOW, ewWaitUntilTerminated, ErrorCode);
   
#ifdef FreeArc
  CreateArcComponents;
#endif
 
#ifdef ISDone
  CreateISDoneComponents;
#endif
 
end;
 
//******************************************* [ конец logo - Лого как ссылка внизу слева  ] ***************************************************//
 
procedure CurPageChanged(CurPageID: Integer);
begin
  SetStateNewButtons;
  HideComponents;
  BtnSetVisibility(MusicButton,False);
  BtnSetVisibility(hDirBrowseBtn,False);
  BtnSetVisibility(hGroupBrowseBtn,False);
  ImgSetVisibility(WizardImg,False);
  ImgSetVisibility(Workspace,False);
  ImgSetVisibility(WizardSmallImage,False);
  ImgSetVisibility(Line,False);
  ImgSetVisibility(WizardFinishImage,False);
  ImgSetVisibility(Edit,False);
  ImgSetVisibility(DirFolder,False);
  ImgSetVisibility(GroupFolder,False);
  ImgSetVisibility(HardDrivePanel,False);
  ImgSetVisibility(HDD,False);
  ImgSetVisibility(PBImg,False);
  ImgSetVisibility(PBBkgImg,False);
  BtnSetVisibility(NoIconsCheck,False);
  ImgSetVisibility(RequirementsPanel,False);
  BtnSetVisibility(DesktopCheck,False);
  BtnSetVisibility(RedistCheck,False);
  BtnSetVisibility(DirectXCheck,False);
  BtnSetVisibility(VisualCCheck,False);
  BtnSetVisibility(PhysXCheck,False);
 
  ShowComponents(CurPageID);
 
#ifdef FreeArc
  UnpackingArcFinished(CurPageID);
#endif
 
#ifdef ISDone
  UnpackingISDoneFinished(CurPageID);
#endif
 
  ImgApplyChanges(WizardForm.Handle);
 
  if GetArrayLength(ASysReq)>0 then
    if CurPageID=SystemPage.ID then SetTimer(WizardForm.Handle,WFSysReqTimerID,1000,WrapTimerProc(@SysReqFlashing,4))
      else KillTimer(WizardForm.Handle,WFSysReqTimerID);
       
  if CurPageID=wpSelectDir then begin
    OldDisk:='';
    GetFreeSpaceCaption(nil);
  end else if GetArrayLength(ADisk)>0 then KillTimer(WizardForm.Handle,WFDiskTimerID);
   
  if CurPageID=wpFinished then begin
#ifdef FreeArc
    BtnSetVisibility(CancelUnpackingBtn, False);
#endif
    DeinitProgressBar;
  end;
end;
 
procedure DeInitializeSetup();
begin
  gdipShutdown;
  ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
  UnloadSkin;
  BASS_Stop;
  BASS_Free;
end;
 
procedure DeinitializeUninstall();
begin
  UnloadSkinUninst();
end;

Всего записей: 53 | Зарегистр. 25-10-2010 | Отправлено: 22:51 14-11-2010
   

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Компьютеры » Программы » Inno Setup (создание инсталяционных пакетов)
Widok (23-11-2010 10:55): лимит страниц. продолжаем здесь


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru