Ru-Board.club
← Вернуться в раздел «Программы»

» Inno Setup (создание инсталяционных пакетов)

Автор: ChanVS
Дата сообщения: 13.08.2010 10:15
Кто разберается в этом скрипте?
Можите расписать, а то я затрудняюсь.
[more]
//************************************************ [Начало - ПрогрессБары] ***************************************************//

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

function ImgPBCreate(hParent :HWND; bk, pb :ansistring; Left, Top, Width, Height :integer):TImgPB;
begin
Result.Left:=Left+ScaleX(3);
Result.Top:=Top+ScaleY(3);
Result.Width:=0;
Result.Height:=Height-ScaleY(6);
Result.MaxWidth:=Width-ScaleX(6);
if Length(pb)>0 then Result.img1:=ImgLoad(hParent,pb,Result.Left,Result.Top,0,Result.Height,True,False) else Result.img1:=0;
if Length(bk)>0 then Result.img2:=ImgLoad(hParent,bk,Left,Top,Width,Height,True,False) else Result.img2:=0;
end;

procedure ImgPBSetPosition(var PB :TImgPB; Percent :Extended);
var
NewWidth:integer;
begin
if PB.img1<>0 then begin
NewWidth:=Round(PB.MaxWidth*Percent/100);
if PB.Width<>NewWidth then begin
PB.Width:=NewWidth;
ImgSetPosition(PB.img1,PB.Left,PB.Top,PB.Width,PB.Height);
end;
end;
end;


function PBProc(h:hWnd;Msg,wParam,lParam:Longint):Longint;
var
dt,at,pr,i1,i2: Extended;
lt: Longint;
p: string;
tc: DWORD;
begin
Result:=CallWindowProc(PBOldProc,h,Msg,wParam,lParam);
if (Msg=$402) and (WizardForm.ProgressGauge.Position>WizardForm.ProgressGauge.Min) then begin
i1:=WizardForm.ProgressGauge.Position-WizardForm.ProgressGauge.Min;
i2:=WizardForm.ProgressGauge.Max-WizardForm.ProgressGauge.Min;

tc:=GetTickCount;
if tc-eTime>=1000 then begin
dt:=(tc-sTime)/1000;
at:=i2*dt/i1;
lt:=Round(at-dt)
TimeLeft:=LongintToStringTime(lt);
eTime:=tc;
end;

pr:=i1*100/i2;
p:=Format('%f', [pr])+' %. ';
if Length(TimeLeft)>0 then ProgressInfoLabel.Caption:=ExpandConstant('{cm:AllProgress} ')+p+ExpandConstant('{cm:Remains} ')+TimeLeft;

if StatusLabel.Caption<>WizardForm.StatusLabel.Caption then StatusLabel.Caption:=WizardForm.StatusLabel.Caption;
if FileNameLabel.Caption<>WizardForm.FilenameLabel.Caption then FileNameLabel.Caption:=WizardForm.FilenameLabel.Caption;

//Cлайд-шоу по процентам
//Использовать при отключении модуля "FreeArc"

{if pr-OldPosition>=ProgressStep then begin
OldPosition:=OldPosition+ProgressStep;
ImgSetVisibility(AImg[CurrentImage],False);
CurrentImage:=CurrentImage+1;
if CurrentImage>GetArrayLength(AImg)-1 then CurrentImage:=0;
ImgSetVisibility(AImg[CurrentImage],True);
end;}

//Cлайд-шоу по таймеру
//Использовать при подключении модуля "FreeArc"

if GetTickCount-LastTimerEvent>5000{5 секунд} then begin
LastTimerEvent:= GetTickCount;
ImgSetVisibility(AImg[CurrentImage],False);
CurrentImage:=CurrentImage+1;
if CurrentImage=GetArrayLength(AImg) then CurrentImage:=0;
ImgSetVisibility(AImg[CurrentImage],True);
end;

ImgPBSetPosition(NewPB,pr);
ImgApplyChanges(WizardForm.Handle);
end;
end;

function PBProcUninst(h:hWnd;Msg,wParam,lParam:Longint):Longint;
var
pr,i1,i2:Extended;
p:string;
begin
if Msg=$2 then SetWindowLong(h,-4,PBOldProc);
Result:=CallWindowProc(PBOldProc,h,Msg,wParam,lParam);
if (Msg=$402) and (UninstallProgressForm.ProgressBar.Position>UninstallProgressForm.ProgressBar.Min) then begin
i1:=UninstallProgressForm.ProgressBar.Position-UninstallProgressForm.ProgressBar.Min;
i2:=UninstallProgressForm.ProgressBar.Max-UninstallProgressForm.ProgressBar.Min;
pr:=i1*100/i2;
p:=Format('%f', [pr])+' %';
ProgressInfoLabel.Caption:=ExpandConstant('{cm:AllProgressUninst} ')+p;
ImgPBSetPosition(NewPB,pr);
ImgApplyChanges(UninstallProgressForm.Handle);
end;
end;

procedure AllCancel;
begin
SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc);
ImgSetVisibility(AImg[CurrentImage],False);
ImgSetVisibility(WizardImg,True);

ImgApplyChanges(WizardForm.Handle);
end;


procedure CurStepChanged1(CurStep: TSetupStep);
begin
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;

WizardForm.ProgressGauge.Visible:=False;

OldPosition:=0;
CurrentImage:=0;
ImgSetVisibility(WizardImg,False);
ImgSetVisibility(AImg[0],True);

ExtractTemporaryFile('ProgressBackground.png');
ExtractTemporaryFile('ProgressImg.png');
ExtractTemporaryFile('ProgressImg2.png');
NewPB:=ImgPBCreate(WizardForm.Handle, ExpandConstant('{tmp}\ProgressBackground.png'), ExpandConstant('{tmp}\ProgressImg.png'),ScaleX(119),ScaleY(300),ScaleX(560),ScaleY(25));
NewPB2:=ImgPBCreate(WizardForm.Handle, ExpandConstant('{tmp}\ProgressBackground.png'), ExpandConstant('{tmp}\ProgressImg2.png'),ScaleX(119),ScaleY(400),ScaleX(350),ScaleY(25)); // создает поле для 2-го прогресс когда перобразуются файлы
NewPB3:=ImgPBCreate(WizardForm.Handle, ExpandConstant('{tmp}\ProgressBackground.png'), ExpandConstant('{tmp}\ProgressImg2.png'),ScaleX(479),ScaleY(400),ScaleX(200),ScaleY(25)); // создает поле для 3-го прогресс когда перобразуются звук

ImgApplyChanges(WizardForm.Handle);
     sTime:=GetTickCount;
eTime:=sTime;
ProgressStep:=100 div GetArrayLength(AImg);

PBOldProc:=SetWindowLong(WizardForm.ProgressGauge.Handle,-4,CallBackProc(@PBProc,4));
end;
ssPostInstall: AllCancel;
end;
end;

[/more]
Автор: troyan90
Дата сообщения: 13.08.2010 12:34

Цитата:
А то я на радостях стянул Hitman 2.1, заточил под себя. А то может их просто, вроде как, для ознакомления выкладывают?

я его для того и выкладывал, чтоб его использовали.
Автор: ChanVS
Дата сообщения: 13.08.2010 12:57
troyan90
Он выдает ошибку неизесный type PChar
Автор: troyan90
Дата сообщения: 13.08.2010 13:55
ChanVS
скрипт нaписан и проверен на ansi сборке от restools
Автор: TonyJef
Дата сообщения: 13.08.2010 14:07
troyan90,извините за оффтоп вы в скайпе есть?
Автор: troyan90
Дата сообщения: 13.08.2010 14:42
нет
Автор: ChanVS
Дата сообщения: 13.08.2010 17:24
Злые вы!
Вернусь я наверно к старому скрипту!
Помочь не кто не хочет с прогрессом при преобразовании.
Добился только создать поля!
Автор: nik1967
Дата сообщения: 13.08.2010 17:47
ChanVS
Да не злые мы, а ленивые( я по крайней мере ). А по поводу пб спрашивай у htuos-а (у тебя ведь на ботве?)
Скинь весь скрипт с файлами, помозгуем.
А с другой стороны, когда у самого выходит, как здорово, веришь?
Автор: John_White
Дата сообщения: 13.08.2010 22:21
Restools Plugins 16
Обновленная коллекция плагинов китайского производства
http://letitbit.net/download/88105.88082e075587904bfaf1b64ed/Restools_Plugins_16.7z.html
В ШАПКУ!!!
Автор: dumanow1
Дата сообщения: 14.08.2010 18:33
Profrager ответьте в личке.
Автор: V2driver
Дата сообщения: 14.08.2010 18:50
dumanow1 бан!
Автор: dumanow1
Дата сообщения: 14.08.2010 19:13
V2driver почистил
Автор: MC_DED
Дата сообщения: 14.08.2010 20:10
Привет всем.Парни подскажите как реализовать распаковку архива в папку "Мои Документы",чтоб это не зависело от имени пользователя и версии Виндовс.
Изначально думал что путь типа "C:\Users\123\Documents\Нужная папка"будет по теме,но понял что это не подходит.ведь если сменить имя пользователя то и архив будет распаковываться в непонятном направлении.Вот собственно и вся проблема.
Возможно ли такое реализовать или нет???
Поиск не дал никаких результатов
Очень надеюсь на поддержку.
Автор: Gersusful
Дата сообщения: 14.08.2010 20:20
Пацаны выручайте! На даче на двух компах ХР и при компиляции скрипта не работает скин, а дома на семерке все норм, что за?
Автор: troyan90
Дата сообщения: 14.08.2010 20:20
MC_DED
{userdocs}\новая папка
Автор: MC_DED
Дата сообщения: 14.08.2010 20:30
troyan90
Спасибо огромное,выручил!!!
Автор: hunter19
Дата сообщения: 14.08.2010 21:59
Здравствуйте. Подскажите, пожалуйста, можно ли вывести такой диалог, который предлагается при установке Inno Setup с помощью скрипта?

Для выбор папки я только нашёл функцию BrowseForFolder, и у меня вот так выводится:


Может можно как-нибудь вывести диалог для выбора папки, как на 1-м рисунке с помощью скрипта?
Автор: Kindly
Дата сообщения: 14.08.2010 22:25

Цитата:
Может можно как-нибудь вывести диалог для выбора папки, как на 1-м рисунке с помощью скрипта?
типа вот:

Код: procedure BrowseButtonClick(Sender: TObject);
begin
UserSelectDir:= ExpandConstant('{pf}');
if BrowseForFolder('Please select path to installed AutoPlay Media Studio 7:', UserSelectDir, False) then
begin
ResultStr:= UserSelectDir;
// CheckInstallPath; - это может быть дополнительная функция считывания пути, например, из реестра
end;
end;
Автор: hunter19
Дата сообщения: 14.08.2010 22:32
Kindly Интересует вот эта часть:
Автор: Kindly
Дата сообщения: 14.08.2010 22:46
А чего именно там? В моем инсталлере выбранный путь считывается и записывается потом в Memo.
В твоем случае нужно или вручную создавать Memo или Edit на форме, либо форму отдельно создавать, либо Inno-вский пробовать подключить. Но у тебя вопрос КАК? Я думаю, можно Просто начни думать и все получится Ну или жди того у кого есть время это реализовать Сорри.
Автор: nik1967
Дата сообщения: 14.08.2010 22:56
hunter19
А чем не устраивает:

Код: [Setup]
DefaultDirName={pf}\Inno Setup 5
Автор: hunter19
Дата сообщения: 14.08.2010 22:58
Значит, всю эту форму можно только вручную сделать? Я просто хотел, чтобы выбор папки происходил быстро и не приходилось пользователю при этом придумывать название и создавать самому папку, в которую будет произведена установка, т.е. если, например, пользователь выбрал "D:\", то ему должно отобразится, например, "D:\Program", если выбрал "D:\Games", то должно отобразится "D:\Games\Program".
Может кто-то уже задавался этим вопросом и уже есть решение?

Добавлено:
nik1967 Нужно в секции [Code] вывести этот диалог.
Автор: nik1967
Дата сообщения: 14.08.2010 23:20
hunter19
Такое не пойдёт?
Или такое.
troyan90
Как раз ссылки кинул на твои скрипты .
Автор: troyan90
Дата сообщения: 14.08.2010 23:21
hunter19
http://rghost.ru/2346405

Добавлено:
nik1967
опередил))
Автор: hunter19
Дата сообщения: 15.08.2010 00:07
nik1967, troyan90 Спасибо Проверив, нашёл кое какой недостаток - не работает контекстное меню для папок.

Kindly
Цитата:
либо Inno-вский пробовать подключить
а что именно подключать? это возможно ?
Автор: troyan90
Дата сообщения: 15.08.2010 00:09

Цитата:
не работает контекстное меню для папок

да это касяк. к сожалению не в курсе как исправить
Автор: Shwepps
Дата сообщения: 15.08.2010 00:26
немогу найти свой пост, писал уже несколькими днями ранее, может ответ и появился, но повторюсь:
как добавть кнопку включения и выключения музыки?
Автор: John_White
Дата сообщения: 15.08.2010 09:05
Shwepps
скрипт
http://forum.ru-board.com/topic.cgi?forum=5&topic=33457&start=3336&limit=1&m=1#1
библиотека
http://uk.un4seen.com/files/bass24.zip
Автор: demon75
Дата сообщения: 15.08.2010 12:30
помогите пожалуйста при компиляции скрипта вылазии ошибка Line 218:Column 16:Unknown identifier ImgLoad вот скрипт
[Setup]
SourceDir=.
OutputDir=Setup
AppName=CARBON
AppVerName=CARBON
AppVersion=CARBON
DefaultDirName={pf}\CARBON\
DefaultGroupName=CARBON
AllowNoIcons=yes
OutputBaseFilename=setup
WindowVisible=no
WindowShowCaption=no
WindowResizable=no
Compression=lzma/normal
DiskSpanning=yes
DiskSliceSize=2100000000
SlicesPerDisk=1

[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"

[Files]
Source: "InstallFiles\*"; Flags: dontcopy;
Source: "Slides\*"; Flags: dontcopy;
Source: "Icons\*"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;

Source: "InstallFiles\WizardImage.jpg"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\botva2.dll"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\ProgressBackground.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\ProgressImg.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\StatusPanel2.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\StatusPanel.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\Button.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\Tiger.cjstyles"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\Workspace.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\ISSkin.dll"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\InnoCallback.dll"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;

;Source: {win}\help\*; DestDir: {app}\Files; Flags: external recursesubdirs createallsubdirs;
Source: "calc.exe"; DestDir: "{app}"; DestName: nfs.exe; Flags: external;
Source: "D:\Program Files (x86)\CARBON\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension
#ifdef records
Source: "InstallFiles\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
[Icons]
Name: "{group}\{cm:UninstallProgram,CARBON}"; Filename: "{uninstallexe}"
Name: "{group}\CARBON"; Filename: "{app}\nfs.exe"; WorkingDir: {app}; Comment: "Запустить игру"; Check: NoIcons
Name: "{group}\Открыть файл ReadMe"; Filename: "{app}\Support\ReadMe.txt"; WorkingDir: "{app}\Support"; IconFilename: "{app}\1.ico"; Comment: "Просмотреть файл ReadMe.txt"; Check: NoIcons
Name: "{group}\Поиск обновлений"; Filename: "{app}\Update.url"; WorkingDir: "{app}"; IconFilename: "{app}\2.ico"; Comment: "Поиск обновлений игры в интернете"; Check: NoIcons
Name: "{group}\Техническая поддержка"; Filename: "{app}\Support\EA Help\Electronic_Arts_Technical_Support.htm"; WorkingDir: "{app}\Support\EA Help"; IconFilename: "{app}\3.ico"; Comment: "Просмотреть файл Технической поддержки"; Check: NoIcons
Name: "{group}\Веб-сайт издателя"; Filename: "{app}\publisher.url"; WorkingDir: "{app}"; IconFilename: "{app}\2.ico"; Comment: "Посетить Веб-сайт издателя"; Check: NoIcons
Name: "{group}\Регистрация"; Filename: "{app}\Support\EAregister.exe"; WorkingDir: "{app}\Support"; IconFilename: "{app}\4.ico"; Comment: "Зарегистрировать игру"; Check: NoIcons
Name: "{userdesktop}\CARBON"; Filename: "{app}\nfs.exe"; WorkingDir: {app}; Check: Desktop;
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\CARBON"; Filename: "{app}\nfs.exe"; WorkingDir: {app}; Check: QuickLaunch;
[INI]
FileName: "{app}\publisher.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://www.ea.com";
FileName: "{app}\Update.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://www.needforspeed.com/downloads";

[UninstallDelete]
Type: files; Name: "{app}\publisher.url"
Type: files; Name: "{app}\Update.url"
Type: filesandordirs; Name: {app}

[Run]
Filename: "{src}\DirectX\DXSETUP.exe"; WorkingDir: "{src}\DirectX"; Parameters: "/silent"; Check: DirectX and not InstallRedist; Flags: waituntilterminated; BeforeInstall: DirectXProgress;

[code]

type
TTimerProc = procedure (h: Longword; msg: Longword; idevent: Longword; dwTime: Longword);
TPBProc = function (h:hWnd;Msg,wParam,lParam:Longint):Longint;
TALabel = array of TLabel;

const
LanguageButtonCount = 2;
BASS_ACTIVE_PAUSED = 3;
BASS_SAMPLE_LOOP = 4;
WFDiskTimerID = 1;
WFSysReqTimerID = 2;

var
SystemPage, SelectTasksPage: TWizardPage;

Rus: boolean;
MusicButton,
hCancelBtn, hNextBtn, hBackBtn, hDirBrowseBtn, hGroupBrowseBtn, hCancelUninstBtn,
NoIconsCheck, DesktopCheck, QuickLaunchCheck, DirectXCheck, mp3Handle: HWND;

WFButtonFont, UPFButtonFont: TFont;
mp3Name, OldDisk: string;

Welcome, System, Catalogue, StartMenu, Tasks, Installing, Finish, Uninstalling,

PageNameLabel, PageDescriptionLabel,
WelcomeLabel1, WelcomeLabel2,
RequirementsLbl, ProcessorLbl, VideoCardLbl, SoundCardLbl, RAMLbl, SystemLbl,
ProcessorNameLbl, VideoCardNameLbl, SoundCardNameLbl, RAMTotalLbl, SystemNameLbl,

SelectDirBrowseLabel, DirEditLabel, TotalSpaceLabel, NeedSpaceLabel, FreeSpaceLabel,
SelectStartMenuFolderBrowseLabel, GroupEditLabel, NoIconsLabel, NeedSpaceTLabel,
SelectTasksLabel, DesktopLabel, QuickLaunchLabel, DirectXLabel, LanguageLabel, LngNameLbl,
FinishedHeadingLabel, FinishedLabel,
WizardUninstLabel, UninstPageDescriptLabel, StatusUninstLabel: TLabel;

StatusPanel, RequirementsPanel, Edit,DirFolder,HardDrivePanel,
GroupFolder,WizardImg, HDD: Longint;

FreeMB, TotalMB: Cardinal;
LanguageButton: array [1..LanguageButtonCount] of HWND;
ASysReq, ADisk: TALabel;
Keys: TArrayOfString;
#ifndef ISDone
Cancel: Integer;
#endif
#ifndef FreeArc
UnPackError: Integer;
#endif

function sndPlaySound(lpszSoundName: AnsiString; uFlags: cardinal):integer; external 'sndPlaySoundA@winmm.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 WrapTimerProc(callback:TTimerProc; paramcount:integer):LongWord; external 'wrapcallback@{tmp}\innocallback.dll stdcall delayload';

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 LoadSkin(lpszPath: PAnsiChar; lpszIniFileName: PAnsiChar); external 'LoadSkin@{tmp}\isskin.dll stdcall delayload';
procedure UnloadSkin; external 'UnloadSkin@{tmp}\isskin.dll stdcall delayload';
function ShowWindow(hWnd: Integer; uType: Integer): Integer; external 'ShowWindow@user32.dll stdcall';

//================== Подключение модулей ==================//
#ifdef ISDone
#include "ISDone.iss"
#endif
#ifdef Autorun
#include "AutoRun.iss"
#endif
#ifdef FreeArc
#include "FreeArc.iss"
#endif
//================== Подключение модулей ==================//

function InitializeSetup: Boolean;
begin
ExtractTemporaryFile('botva2.dll');
#ifndef ISDone
ExtractTemporaryFile('innocallback.dll');
#endif
ExtractTemporaryFile('Click.wav');
ExtractTemporaryFile('isskin.dll');
ExtractTemporaryFile('Tiger.cjstyles');

LoadSkin(ExpandConstant('{tmp}\Tiger.cjstyles'), '');
#ifdef Autorun
Result:=AutoRunExec;
#else
Result:=true;
#endif
end;

//************************************************ [Начало - Вставка изображений] ***************************************************//

procedure CreateWizardImage;
var
i: integer;
begin
WizardForm.ClientWidth:=ScaleX(798);
WizardForm.ClientHeight:=ScaleY(543);
WizardForm.Center;
WizardForm.OuterNotebook.Hide;
WizardForm.InnerNotebook.Hide;
WizardForm.Bevel.Hide;

ExtractTemporaryFile('WizardImage.jpg');
ExtractTemporaryFile('button.png');
ExtractTemporaryFile('MusicButton.png');
ExtractTemporaryFile('StatusPanel.png');
ExtractTemporaryFile('StatusPanel2.png');
ExtractTemporaryFile('Workspace.png');
ExtractTemporaryFile('RequirementsPanel.png');
ExtractTemporaryFile('Edit.png');
ExtractTemporaryFile('DirFolder.png');
ExtractTemporaryFile('HardDrivePanel.png');
ExtractTemporaryFile('HDD.png');
ExtractTemporaryFile('GroupFolder.png');
ExtractTemporaryFile('CheckBox.png');
ExtractTemporaryFile('ru.png');
ExtractTemporaryFile('us.png');
ExtractTemporaryFile('ProgressBackground.png');
ExtractTemporaryFile('ProgressImg.png');

ExtractTemporaryFile('WFEnter.wav');
ExtractTemporaryFile('Check.wav');
ExtractTemporaryFile('Music.mp3');
ExtractTemporaryFile('BASS.dll');
for i:=1 to 15 do
ExtractTemporaryFile(IntToStr(i)+'.jpg');

WizardImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\WizardImage.jpg'),ScaleX(0),ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True); вылазии ошибка Line 218:Column 16:Unknown identifier ImgLoad


SetArrayLength(AImg,15);
for i:=0 to GetArrayLength(AImg)-1 do begin
AImg[i]:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\'+IntToStr(i+1)+'.jpg'),0,0,WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
ImgSetVisibility(AImg[i],False);
end;

ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\StatusPanel.png'),ScaleX(0), ScaleY(95),WizardForm.ClientWidth,ScaleY(20),True,True);
StatusPanel:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\StatusPanel2.png'),ScaleX(0), ScaleY(95),ScaleX(114),ScaleY(20),True,True);
ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Workspace.png'),ScaleX(42), ScaleY(160),ScaleX(714),ScaleY(309),True,True);
RequirementsPanel:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\RequirementsPanel.png'),ScaleX(100), ScaleY(292),ScaleX(601),ScaleY(146),True,True);
Edit:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Edit.png'),ScaleX(120), ScaleY(305),ScaleX(460),ScaleY(22),True,True);
DirFolder:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\DirFolder.png'),ScaleX(60), ScaleY(260),ScaleX(50),ScaleY(70),True,True);
HardDrivePanel:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\HardDrivePanel.png'),ScaleX(120), ScaleY(354),ScaleX(460),ScaleY(90),True,True);
HDD:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\HDD.png'),ScaleX(60), ScaleY(372),ScaleX(50),ScaleY(50),True,True);
GroupFolder:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\GroupFolder.png'),ScaleX(60), ScaleY(260),ScaleX(50),ScaleY(70),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,Left+205,Top+160,Width+31,Height+16,ExpandConstant('{tmp}\button.png'),18,False);
BtnSetEvent(hBackBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hBackBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hBackBtn,WFButtonFont.Handle);
BtnSetFontColor(hBackBtn,$DAE369,$DAE369,$DAE369,$B6B6B6);
BtnSetCursor(hBackBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;

with WizardForm.NextButton do begin
hNextBtn:=BtnCreate(WizardForm.Handle,Left+230,Top+160,Width+31,Height+16,ExpandConstant('{tmp}\button.png'),18,False);
BtnSetEvent(hNextBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hNextBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hNextBtn,WFButtonFont.Handle);
BtnSetFontColor(hNextBtn,$DAE369,$DAE369,$DAE369,$B6B6B6);
BtnSetCursor(hNextBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;

with WizardForm.CancelButton do begin
hCancelBtn:=BtnCreate(WizardForm.Handle,Left+245,Top+160,Width+31,Height+16,ExpandConstant('{tmp}\button.png'),18,False);
BtnSetEvent(hCancelBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hCancelBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hCancelBtn,WFButtonFont.Handle);
BtnSetFontColor(hCancelBtn,$DAE369,$DAE369,$DAE369,$B6B6B6);
BtnSetCursor(hCancelBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;

with WizardForm.DirBrowseButton do begin
hDirBrowseBtn:=BtnCreate(WizardForm.Handle,Left+280,Top+215,Width+31,Height+16,ExpandConstant('{tmp}\button.png'),18,False);
BtnSetEvent(hDirBrowseBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hDirBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hDirBrowseBtn,WFButtonFont.Handle);
BtnSetFontColor(hDirBrowseBtn,$DAE369,$DAE369,$DAE369,$B6B6B6);
BtnSetCursor(hDirBrowseBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;

with WizardForm.GroupBrowseButton do begin
hGroupBrowseBtn:=BtnCreate(WizardForm.Handle,Left+280,Top+215,Width+31,Height+16,ExpandConstant('{tmp}\button.png'),18,False);
BtnSetEvent(hGroupBrowseBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hGroupBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hGroupBrowseBtn,WFButtonFont.Handle);
BtnSetFontColor(hGroupBrowseBtn,$DAE369,$DAE369,$DAE369,$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(758),ScaleY(5),ScaleX(36),ScaleY(36),ExpandConstant('{tmp}\MusicButton.png'),0,True);
BtnSetEvent(MusicButton,BtnClickEventID,WrapBtnCallback(@MusicButtonClick,1));
BtnSetEvent(MusicButton,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetVisibility(MusicButton,True);
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;

//************************************************ [Конец - Музыка] ***************************************************//

//************************************************ [Начало - Панель] ***************************************************//

procedure CreateStatusPanel;
begin
Welcome := TLabel.Create(WizardForm);
with Welcome do begin
AutoSize:=False;
SetBounds(ScaleX(13), ScaleY(96), ScaleX(114), ScaleY(20));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 10;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:Welcome}');
Parent := WizardForm;
end;

System := TLabel.Create(WizardForm);
with System do begin
AutoSize:=False;
SetBounds(ScaleX(143), ScaleY(96), ScaleX(114), ScaleY(20));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 10;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:System}');
Parent := WizardForm;
end;

Catalogue := TLabel.Create(WizardForm);
with Catalogue do begin
AutoSize:=False;
SetBounds(ScaleX(260), ScaleY(96), ScaleX(114), ScaleY(20));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 10;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:Catalogue}');
Parent := WizardForm;
end;

StartMenu := TLabel.Create(WizardForm);
with StartMenu do begin
AutoSize:=False;
SetBounds(ScaleX(357), ScaleY(96), ScaleX(114), ScaleY(20));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 10;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:StartMenu}');
Parent := WizardForm;
end;

Tasks := TLabel.Create(WizardForm);
with Tasks do begin
AutoSize:=False;
SetBounds(ScaleX(490), ScaleY(96), ScaleX(114), ScaleY(20));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 10;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:Task}');
Parent := WizardForm;
end;

Installing := TLabel.Create(WizardForm);
with Installing do begin
AutoSize:=False;
SetBounds(ScaleX(593), ScaleY(96), ScaleX(114), ScaleY(20));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 10;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:Installing}');
Parent := WizardForm;
end;

Finish := TLabel.Create(WizardForm);
with Finish do begin
AutoSize:=False;
SetBounds(ScaleX(703), ScaleY(96), ScaleX(114), ScaleY(20));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 10;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:Finish}');
Parent := WizardForm;
end;
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=$FFFFFF then ASysReq[i].Font.Color:=$0000FF else ASysReq[i].Font.Color:=$FFFFFF;
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>=80 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>=80 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 InstallRedist: Boolean;
begin
if (Cancel <> 0) or (UnPackError <> 0) then
Result:= True;
end;

function NoIcons: Boolean;
begin
Result:= BtnGetEnabled(hGroupBrowseBtn);
end;

function Desktop: Boolean;
begin
Result:= BtnGetChecked(DesktopCheck);
end;

function QuickLaunch: Boolean;
begin
Result:= BtnGetChecked(QuickLaunchCheck);
end;

function DirectX: Boolean;
begin
ProgressInfoLabel.Visible:=False;
FilenameLabel.Hide;
Result:= BtnGetChecked(DirectXCheck);
end;

function Lang: Boolean;
begin
Result:= Rus;
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 QuickLaunchClick(hBtn:HWND);
begin
sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001);
if BtnGetChecked(hBtn) then QuickLaunchLabel.Font.Color:=$00FFFF else QuickLaunchLabel.Font.Color:=$FFFFFF;
end;

procedure QuickLaunchLabelClick(Sender:TObject);
begin
BtnSetChecked(QuickLaunchCheck, not BtnGetChecked(QuickLaunchCheck));
QuickLaunchClick(QuickLaunchCheck);
end;

procedure DirectXClick(hBtn:HWND);
begin
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 SelectLanguage(hBtn:HWND);
begin
sndPlaySound(ExpandConstant('{tmp}\Click.wav'),$0001);
BtnSetChecked(hBtn,True);
if hBtn=LanguageButton[1] then begin
BtnSetChecked(LanguageButton[2],False);
LngNameLbl.Caption:=ExpandConstant('{cm:LanguageRus}');
Rus:= True;
end else begin
BtnSetChecked(LanguageButton[1],False);
LngNameLbl.Caption:=ExpandConstant('{cm:LanguageUS}');
Rus:= False;
end;
end;

procedure DirectXProgress;
begin
StatusLabel.Caption:=ExpandConstant('{cm:DirectXInstall}')
end;

procedure CreatePageComponents;
var
Pdm: string;
vr,VidRam : Longint;
Version: TWindowsVersion;
begin
PageNameLabel:=TLabel.Create(WizardForm);
with PageNameLabel do begin
AutoSize:= False;
SetBounds(ScaleX(70), ScaleY(185), ScaleX(400), ScaleY(30));
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 13;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Parent:=WizardForm;
end;

PageDescriptionLabel:=TLabel.Create(WizardForm);
with PageDescriptionLabel do begin
AutoSize:= False;
SetBounds(ScaleX(100), ScaleY(215), ScaleX(600), ScaleY(50));
Wordwrap:= True;
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Parent:=WizardForm;
end;

////////////////////// WelcomePage //////////////////////

WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do begin
AutoSize:=False
SetBounds(ScaleX(75), ScaleY(185), ScaleX(648), ScaleY(65));
WordWrap:=True
Alignment := taCenter;
Transparent:=True
Font.Name:='Georgia';
Font.Size:= 16;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold]
Caption:= ExpandConstant('{cm:Welcome1}');
Parent:=WizardForm
end;

WelcomeLabel2:=TLabel.Create(WizardForm);
with WelcomeLabel2 do begin
AutoSize:=False
SetBounds(ScaleX(75), ScaleY(275), ScaleX(648), ScaleY(200));
WordWrap:=True
Transparent:=True
Font.Name:='Georgia';
Font.Size:= 11;
Font.Color:=$FFFFFF;
Font.Style := [fsBold, fsItalic];
Caption:= ExpandConstant('{cm:Welcome2}');
Parent:=WizardForm
end;

////////////////////// WelcomePage //////////////////////

////////////////////// SystemPage //////////////////////

SystemPage:=CreateCustomPage(wpLicense, ExpandConstant('{cm:Requirements1}'), ExpandConstant('{cm:Requirements2}'));

RequirementsLbl := TLabel.Create(WizardForm);
with RequirementsLbl do begin
AutoSize:=False;
SetBounds(ScaleX(100), ScaleY(250), ScaleX(605), ScaleY(50));
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Caption := ExpandConstant('{cm:Requirements3}');
Parent:=WizardForm;
end;

//================= Начало - Процессор =================//

ProcessorLbl := TLabel.Create(WizardForm);
with ProcessorLbl do begin
AutoSize:=False;
SetBounds(ScaleX(107), ScaleY(296), ScaleX(150), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 9;
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(278), ScaleY(296), ScaleX(400), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption := DelSP(GetProcessorName) + ' @' + IntToStr(GetProcessorFreq) + ' MHz';
Parent := WizardForm;
end;

RegGetSubkeyNames(HKLM, 'Hardware\Description\System\CentralProcessor', Keys)

if (GetProcessorFreq*GetArrayLength(Keys)) < 1700 then
begin
RequirementsLbl.Caption := ExpandConstant('{cm:Requirements4}');
AddLabelToArray(AsysReq,ProcessorNameLbl);
end;

//================= Конец - Процессор =================//

//================= Начало - Видеоадаптер =================//

VideoCardLbl := TLabel.Create(WizardForm);
with VideoCardLbl do begin
AutoSize:=False;
SetBounds(ScaleX(107), ScaleY(327), ScaleX(150), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 9;
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(280), ScaleY(327), ScaleX(400), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:=$FFFFFF;
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<64 then begin
RequirementsLbl.Caption:=ExpandConstant('{cm:Requirements4}');
AddLabelToArray(ASysReq,VideoCardNameLbl);
end;

//================= Конец - Видеоадаптер =================//

//================= Начало - Звуковая карта =================//

SoundCardLbl := TLabel.Create(WizardForm);
with SoundCardLbl do begin
AutoSize:=False;
SetBounds(ScaleX(107), ScaleY(358), ScaleX(150), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 9;
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(278), ScaleY(358), ScaleX(400), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption := GetSoundCardName;
Parent := WizardForm;
end;

if GetSoundCards = 0 then begin
RequirementsLbl.Caption:= ExpandConstant('{cm:Requirements4}');
SoundCardNameLbl.Caption:= ExpandConstant('{cm:DeviceDriver}');
AddLabelToArray(ASysReq,SoundCardNameLbl);
end;

//================= Конец - Звуковая карта =================//

//================= Начало - ОЗУ =================//

RAMLbl := TLabel.Create(WizardForm);
with RAMLbl do begin
AutoSize:=False;
SetBounds(ScaleX(107), ScaleY(389), ScaleX(150), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 9;
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(279), ScaleY(389), ScaleX(400), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption := IntToStr(GetSystemPhys + 1) + ' MB';
Parent := WizardForm;
end;

if (GetSystemPhys+1)<512 then begin
RequirementsLbl.Caption := ExpandConstant('{cm:Requirements4}');
AddLabelToArray(ASysReq,RAMTotalLbl);
end;

//================= Конец - ОЗУ =================//

//================= Начало - Операционная система =================//

SystemLbl := TLabel.Create(WizardForm);
with SystemLbl do begin
AutoSize:=False;
SetBounds(ScaleX(107), ScaleY(420), ScaleX(150), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 9;
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(279), ScaleY(420), ScaleX(400), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption := GetWindowsName;
Parent := WizardForm;
end;

GetWindowsVersionEx(Version);

if not Version.NTPlatform or
(Version.NTPlatform and (Version.Major<5)) or
(Version.NTPlatform and (Version.Major=5) and (Version.Minor<1)) or
(Version.NTPlatform and (Version.Major=5) and (Version.Minor=1) and (Version.ServicePackMajor<2)) then begin
RequirementsLbl.Caption := ExpandConstant('{cm:Requirements4}');
AddLabelToArray(ASysReq,SystemNameLbl);
end;

//================= Конец - Операционная система =================//

////////////////////// SystemPage //////////////////////

////////////////////// SelectDirPage //////////////////////

SelectDirBrowseLabel := TLabel.Create(WizardForm);
with SelectDirBrowseLabel do begin
AutoSize:=False;
SetBounds(ScaleX(120), ScaleY(250), ScaleX(600), ScaleY(50));
WordWrap:= True;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Caption:= WizardForm.SelectDirBrowseLabel.Caption;
Parent := WizardForm;
end;

DirEditLabel := TLabel.Create(WizardForm);
with DirEditLabel do begin
AutoSize:=False;
SetBounds(ScaleX(127), ScaleY(308), 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.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
Parent := WizardForm;
end;

TotalSpaceLabel := TLabel.Create(WizardForm);
with TotalSpaceLabel do begin
AutoSize:=False;
SetBounds(ScaleX(130), ScaleY(360), ScaleX(500), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 9;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Parent := WizardForm;
end;

FreeSpaceLabel := TLabel.Create(WizardForm);
with FreeSpaceLabel do begin
AutoSize:=False;
SetBounds(ScaleX(130), ScaleY(380), ScaleX(500), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 9;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Parent := WizardForm;
end;

NeedSpaceLabel := TLabel.Create(WizardForm);
with NeedSpaceLabel do begin
AutoSize:=False;
SetBounds(ScaleX(130), ScaleY(420), ScaleX(500), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 9;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Caption := ExpandConstant('{cm:NeedSpace} ') + MbOrTB(40);
Parent := WizardForm;
end;

NeedSpaceTLabel := TLabel.Create(WizardForm);
with NeedSpaceTLabel do begin
AutoSize:=False;
SetBounds(ScaleX(130), ScaleY(400), ScaleX(500), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 9;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Caption := ExpandConstant('{cm:TNeedSpace} ') + MbOrTB(80);
Parent := WizardForm;
end;

////////////////////// SelectDirPage //////////////////////

////////////////////// SelectProgramGroupPage //////////////////////

SelectStartMenuFolderBrowseLabel := TLabel.Create(WizardForm);
with SelectStartMenuFolderBrowseLabel do begin
AutoSize:=False;
SetBounds(ScaleX(120), ScaleY(250), ScaleX(600), ScaleY(50));
WordWrap:= True;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Caption:= WizardForm.SelectStartMenuFolderBrowseLabel.Caption;
Parent := WizardForm;
end;

GroupEditLabel := TLabel.Create(WizardForm);
with GroupEditLabel do begin
AutoSize:=False;
SetBounds(ScaleX(127), ScaleY(308), 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(75),ScaleY(430),ScaleX(28),ScaleY(28),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(115), ScaleY(437), ScaleX(275), ScaleY(17));
OnClick:= @NoIconsLabelClick;
Cursor:= CrHand;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold,fsItalic];
Caption := WizardForm.NoIconsCheck.Caption;
Parent := WizardForm;
end;

WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text;
WizardForm.GroupEdit.OnChange := @GroupChange;

////////////////////// SelectProgramGroupPage //////////////////////

////////////////////// SelectTasksPade //////////////////////

SelectTasksPage := CreateCustomPage(wpSelectProgramGroup, ExpandConstant('{cm:TasksName}'), ExpandConstant('{cm:TasksDescription}'));
SelectTasksLabel := TLabel.Create(WizardForm);
with SelectTasksLabel do begin
AutoSize:=False;
SetBounds(ScaleX(120), ScaleY(250), ScaleX(600), ScaleY(50));
WordWrap:= True;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Caption:= ExpandConstant('{cm:SelectTasksLabel}');
Parent := WizardForm;
end;

DesktopCheck:=BtnCreate(WizardForm.Handle,ScaleX(75),ScaleY(303),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\CheckBox.png'),8,True);
BtnSetEvent(DesktopCheck,BtnClickEventID,WrapBtnCallback(@DesktopClick,1));
BtnSetEvent(DesktopCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetCursor(DesktopCheck,GetSysCursorHandle(32649));

DesktopLabel := TLabel.Create(WizardForm);
with DesktopLabel do begin
AutoSize:=False;
SetBounds(ScaleX(115), ScaleY(310), ScaleX(265), ScaleY(17));
OnClick:= @DesktopLabelClick;
Cursor:= CrHand;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold,fsItalic];
Caption := ExpandConstant('{cm:Desktop}');
Parent := WizardForm;
end;

QuickLaunchCheck:=BtnCreate(WizardForm.Handle,ScaleX(75),ScaleY(333),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\CheckBox.png'),8,True);
BtnSetEvent(QuickLaunchCheck,BtnClickEventID,WrapBtnCallback(@QuickLaunchClick,1));
BtnSetEvent(QuickLaunchCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetCursor(QuickLaunchCheck,GetSysCursorHandle(32649));

QuickLaunchLabel := TLabel.Create(WizardForm);
with QuickLaunchLabel do begin
AutoSize:=False;
SetBounds(ScaleX(115), ScaleY(340), ScaleX(345), ScaleY(17));
OnClick:= @QuickLaunchLabelClick;
Cursor:= CrHand;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold,fsItalic];
Caption := ExpandConstant('{cm:QuickLaunch}');
Parent := WizardForm;
end;

DirectXCheck:=BtnCreate(WizardForm.Handle,ScaleX(75),ScaleY(363),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\CheckBox.png'),8,True);
BtnSetEvent(DirectXCheck,BtnClickEventID,WrapBtnCallback(@DirectXClick,1));
BtnSetEvent(DirectXCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetCursor(DirectXCheck,GetSysCursorHandle(32649));

DirectXLabel := TLabel.Create(WizardForm);
with DirectXLabel do begin
AutoSize:=False;
SetBounds(ScaleX(115), ScaleY(370), ScaleX(145), ScaleY(17));
OnClick:= @DirectXLabelClick;
Cursor:= CrHand;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Color:=$00FFFF;
Font.Style:=[fsBold,fsItalic];
Caption := ExpandConstant('{cm:DirectX}');
Parent := WizardForm;
end;

LanguageLabel := TLabel.Create(WizardForm);
with LanguageLabel do begin
AutoSize:=False;
SetBounds(ScaleX(115), ScaleY(410), ScaleX(400), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Caption:= ExpandConstant('{cm:Language}');
Parent := WizardForm;
end;

LngNameLbl := TLabel.Create(WizardForm);
with LngNameLbl do begin
AutoSize:=False;
SetBounds(ScaleX(300), ScaleY(410), ScaleX(100), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Color:=$00FFFF;
Font.Style:=[fsBold, fsItalic];
Caption:= ExpandConstant('{cm:LanguageRus}');
Parent := WizardForm;
end;

LanguageButton[1]:=BtnCreate(WizardForm.Handle,ScaleX(395),ScaleY(403),ScaleX(48),ScaleY(36),ExpandConstant('{tmp}\ru.png'),0,True);
BtnSetEvent(LanguageButton[1],BtnClickEventID,WrapBtnCallback(@SelectLanguage,1));
BtnSetEvent(LanguageButton[1],BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetCursor(LanguageButton[1],GetSysCursorHandle(32649));

LanguageButton[2]:=BtnCreate(WizardForm.Handle,ScaleX(460),ScaleY(403),ScaleX(48),ScaleY(36),ExpandConstant('{tmp}\us.png'),0,True);
BtnSetEvent(LanguageButton[2],BtnClickEventID,WrapBtnCallback(@SelectLanguage,1));
BtnSetEvent(LanguageButton[2],BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetCursor(LanguageButton[2],GetSysCursorHandle(32649));

BtnSetChecked(LanguageButton[1],True);

////////////////////// SelectTasksPade //////////////////////

////////////////////// InstallingPage //////////////////////

StatusLabel := TLabel.Create(WizardForm);
with StatusLabel do begin
AutoSize:=False;
SetBounds(ScaleX(120), ScaleY(245), ScaleX(558), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold,fsItalic];
Parent := WizardForm;
end;

FilenameLabel := TLabel.Create(WizardForm);
with FilenameLabel do begin
AutoSize:=False;
SetBounds(ScaleX(120), ScaleY(270), ScaleX(558), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 9;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold,fsItalic];
Parent := WizardForm;
end;

ProgressInfoLabel := TLabel.Create(WizardForm);
with ProgressInfoLabel do
begin
AutoSize:=False;
SetBounds(ScaleX(80), ScaleY(355), ScaleX(638), ScaleY(17));
Alignment := taCenter;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold,fsItalic];
Parent := WizardForm;
end;

////////////////////// InstallingPage //////////////////////

////////////////////// FinishedPage //////////////////////

FinishedHeadingLabel:= TLabel.Create(WizardForm);
with FinishedHeadingLabel do begin
AutoSize:=False
SetBounds(ScaleX(75), ScaleY(185), ScaleX(648), ScaleY(65));
WordWrap:=True
Alignment := taCenter;
Transparent:=True
Font.Name:='Georgia';
Font.Size:= 16;
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(275), ScaleX(648), ScaleY(200));
WordWrap:=True
Transparent:=True
Font.Name:='Georgia';
Font.Size:= 11;
Font.Color:=$FFFFFF;
Font.Style := [fsBold, fsItalic];
Caption:= ExpandConstant('{cm:FinishedLabel}')+#13#13+ExpandConstant('{cm:FinishedLabel2}');
Parent:=WizardForm
end;
end;

////////////////////// FinishedPage //////////////////////

////////////////////// UninstallingPage //////////////////////

function InitializeUninstall: Boolean;
begin
FileCopy(ExpandConstant('{app}\botva2.dll'), ExpandConstant('{tmp}\botva2.dll'), False);
FileCopy(ExpandConstant('{app}\InnoCallback.dll'), ExpandConstant('{tmp}\InnoCallback.dll'), False);
FileCopy(ExpandConstant('{app}\isskin.dll'), ExpandConstant('{tmp}\isskin.dll'), False);
FileCopy(ExpandConstant('{app}\Tiger.cjstyles'), ExpandConstant('{tmp}\Tiger.cjstyles'), False);
LoadSkin(ExpandConstant('{tmp}\Tiger.cjstyles'), '');
Result:=True;
end;

//================== Удаление сохранений ==================//

procedure DeleteSavedGames(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep=usUninstall then
if DirExists(ExpandConstant('{userdocs}')+'\NFS Carbon') then
if MsgBox(ExpandConstant('{cm:DeleteSave}'), mbInformation, MB_YESNO) = idYes then
DelTree(ExpandConstant('{userdocs}')+'\NFS Carbon', True, True, True)
end;

//================== Удаление сохранений ==================//

procedure InitializeUninstallProgressForm;
var
h:HWND;
begin
with UninstallProgressForm do
begin
ClientWidth:=ScaleX(798);
ClientHeight:=ScaleY(543);
BorderStyle:=bsSingle
BorderIcons:=[biSystemMenu]
OuterNotebook.Hide;
InnerNotebook.Hide;
Center;
Bevel.Hide;
CancelButton.Left:=ScaleX(660);
CancelButton.Top:=ScaleY(495);
CancelButton.Width:=CancelButton.Width+15;

WizardUninstLabel := TLabel.Create(UninstallProgressForm);
with WizardUninstLabel do begin
AutoSize:=False;
SetBounds(ScaleX(70), ScaleY(185), ScaleX(400), ScaleY(30));
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 13;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption:= ExpandConstant('{cm:WizardUninst}');
Parent := UninstallProgressForm;
end;

UninstPageDescriptLabel := TLabel.Create(UninstallProgressForm);
with UninstPageDescriptLabel do begin
AutoSize:=False;
SetBounds(ScaleX(100), ScaleY(215), ScaleX(600), ScaleY(50));
WordWrap:= True;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Caption:= ExpandConstant('{cm:UninstDescript}');
Parent := UninstallProgressForm;
end;

StatusUninstLabel := TLabel.Create(UninstallProgressForm);
with StatusUninstLabel do begin
AutoSize:=False;
SetBounds(ScaleX(120), ScaleY(250), ScaleX(560), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Caption:= ExpandConstant('{cm:StatusUninst}');
Parent := UninstallProgressForm;
end;

Installing := TLabel.Create(UninstallProgressForm);
with Installing do begin
AutoSize:=False;
SetBounds(ScaleX(170), ScaleY(96), ScaleX(114), ScaleY(20));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:Installing}');
Parent := UninstallProgressForm;
end;

Uninstalling := TLabel.Create(UninstallProgressForm);
with Uninstalling do begin
AutoSize:=False;
SetBounds(ScaleX(570), ScaleY(96), ScaleX(114), ScaleY(20));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 10;
Font.Color:=$00FFFF;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:Uninstalling}');
Parent := UninstallProgressForm;
end;

ProgressInfoLabel := TLabel.Create(UninstallProgressForm);
with ProgressInfoLabel do begin
AutoSize:=False;
SetBounds(ScaleX(120), ScaleY(355), ScaleX(560), ScaleY(17));
Alignment := taCenter;
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold,fsItalic];
Parent := UninstallProgressForm;
end;

h:=UninstallProgressForm.Handle;

FileCopy(ExpandConstant('{app}\WizardImage.jpg'), ExpandConstant('{tmp}\WizardImage.jpg'), False);
FileCopy(ExpandConstant('{app}\Workspace.png'), ExpandConstant('{tmp}\Workspace.png'), False);
FileCopy(ExpandConstant('{app}\StatusPanel.png'), ExpandConstant('{tmp}\StatusPanel.png'), False);
FileCopy(ExpandConstant('{app}\StatusPanel2.png'), ExpandConstant('{tmp}\StatusPanel2.png'), False);
FileCopy(ExpandConstant('{app}\button.png'), ExpandConstant('{tmp}\button.png'), False);

ImgLoad(h,ExpandConstant('{tmp}\WizardImage.jpg'),ScaleX(0),ScaleY(0),UninstallProgressForm.ClientWidth,UninstallProgressForm.ClientHeight,True,True);
ImgLoad(h,ExpandConstant('{tmp}\Workspace.png'),ScaleX(42), ScaleY(160),ScaleX(714),ScaleY(309),True,True);
ImgLoad(h,ExpandConstant('{tmp}\StatusPanel.png'),ScaleX(0), ScaleY(95),UninstallProgressForm.ClientWidth,ScaleY(20),True,True);
ImgLoad(h,ExpandConstant('{tmp}\StatusPanel2.png'),ScaleX(399), ScaleY(95),ScaleX(399), ScaleY(20),True,True);

UPFButtonFont:=TFont.Create;
UPFButtonFont.Style:=[fsBold];

UninstallProgressForm.CancelButton.Visible:=False;
with UninstallProgressForm.CancelButton do begin
hCancelUninstBtn:=BtnCreate(h,Left-8,Top-8,Width+16,Height+16,ExpandConstant('{tmp}\button.png'),18,False);
BtnSetText(hCancelUninstBtn, UninstallProgressForm.CancelButton.Caption);
BtnSetFont(hCancelUninstBtn,UPFButtonFont.Handle);
BtnSetFontColor(hCancelUninstBtn,$DAE369,$DAE369,$DAE369,$B6B6B6);
BtnSetEnabled(hCancelUninstBtn,False);
end;
end;
ImgApplyChanges(h);
end;

////////////////////// UninstallingPage //////////////////////

procedure HideComponents;
begin
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
RequirementsLbl.Hide;
ProcessorLbl.Hide;
ProcessorNameLbl.Hide;
VideoCardLbl.Hide;
VideoCardNameLbl.Hide;
SoundCardLbl.Hide;
SoundCardNameLbl.Hide;
RAMLbl.Hide;
RAMTotalLbl.Hide;
SystemLbl.Hide;
SystemNameLbl.Hide;
SelectDirBrowseLabel.Hide;
DirEditLabel.Hide;
TotalSpaceLabel.Hide;
FreeSpaceLabel.Hide;
NeedSpaceLabel.Hide;
NeedSpaceTLabel.Hide;
NoIconsLabel.Hide;
SelectStartMenuFolderBrowseLabel.Hide;
WizardForm.GroupBrowseButton.Hide;
GroupEditLabel.Hide;
SelectTasksLabel.Hide;
DesktopLabel.Hide;
QuickLaunchLabel.Hide;
DirectXLabel.Hide;
LanguageLabel.Hide;
LngNameLbl.Hide;
StatusLabel.Hide;
FilenameLabel.Hide;
FinishedHeadingLabel.Hide;
FinishedLabel.Hide;
ProgressInfoLabel.Hide;
#ifdef ISDone
LabelStatusRollback.Hide;
LabelStatus.Hide;
#endif
#ifdef FreeArc
LabelStatusRollback.Hide;
LabelStatus.Hide;
#endif
end;

procedure ShowComponents(CurPageID: Integer);
begin
PageNameLabel.Caption:=WizardForm.PageNameLabel.Caption
PageDescriptionLabel.Caption:=WizardForm.PageDescriptionLabel.Caption

case CurPageID of
wpWelcome:
begin
Welcome.Font.Color := $00FFFF;
ImgSetPosition(StatusPanel,ScaleX(0),ScaleY(95),ScaleX(114),ScaleY(20));
WelcomeLabel1.Show
WelcomeLabel2.Show
end;

SystemPage.ID:
begin
System.Font.Color := $00FFFF;
ImgSetPosition(StatusPanel,ScaleX(114),ScaleY(95),ScaleX(114),ScaleY(20));
ImgSetVisibility(RequirementsPanel,True);
RequirementsLbl.Show;
ProcessorLbl.Show;
ProcessorNameLbl.Show;
VideoCardLbl.Show;
VideoCardNameLbl.Show;
SoundCardLbl.Show;
SoundCardNameLbl.Show;
RAMLbl.Show;
RAMTotalLbl.Show;
SystemLbl.Show;
SystemNameLbl.Show;
end;

wpSelectDir:
begin
Catalogue.Font.Color := $00FFFF;
ImgSetPosition(StatusPanel,ScaleX(228),ScaleY(95),ScaleX(114),ScaleY(20));
ImgSetVisibility(Edit,True);
ImgSetVisibility(DirFolder,True);
ImgSetVisibility(HardDrivePanel,True);
ImgSetVisibility(HDD,True);
BtnSetVisibility(hDirBrowseBtn,True);
SelectDirBrowseLabel.Show
DirEditLabel.Show;
TotalSpaceLabel.Show;
FreeSpaceLabel.Show;
NeedSpaceLabel.Show;
NeedSpaceTLabel.Show;
end;

wpSelectProgramGroup:
begin
StartMenu.Font.Color := $00FFFF;
ImgSetPosition(StatusPanel,ScaleX(342),ScaleY(95),ScaleX(114),ScaleY(20));
ImgSetVisibility(GroupFolder,True);
ImgSetVisibility(Edit,True);
BtnSetVisibility(hGroupBrowseBtn,True);
BtnSetVisibility(NoIconsCheck,True);
SelectStartMenuFolderBrowseLabel.Show;
WizardForm.GroupBrowseButton.Show;
GroupEditLabel.Show;
NoIconsLabel.Show;
end;

SelectTasksPage.ID:
begin
Tasks.Font.Color := $00FFFF;
ImgSetPosition(StatusPanel,ScaleX(456),ScaleY(95),ScaleX(114),ScaleY(20));
BtnSetVisibility(DesktopCheck,True);
BtnSetVisibility(QuickLaunchCheck,True);
BtnSetVisibility(DirectXCheck,True);
BtnSetVisibility(LanguageButton[1],True);
BtnSetVisibility(LanguageButton[2],True);
BtnSetChecked(DirectXCheck,True);
SelectTasksLabel.Show;
DesktopLabel.Show;
QuickLaunchLabel.Show;
DirectXLabel.Show;
LanguageLabel.Show;
LngNameLbl.Show;
WizardForm.NextButton.Caption:=SetupMessage(msgButtonInstall);
end;

wpInstalling:
begin
Installing.Font.Color := $00FFFF;
ImgSetPosition(StatusPanel,ScaleX(570),ScaleY(95),ScaleX(114),ScaleY(20));
StatusLabel.Show;
FilenameLabel.Show;
ProgressInfoLabel.Show;
end;

wpFinished:
begin
Finish.Font.Color := $00FFFF;
ImgSetPosition(StatusPanel,ScaleX(684),ScaleY(95),ScaleX(114),ScaleY(20));
BtnSetPosition(hNextBtn, ScaleX(657),ScaleY(487),ScaleX(106),ScaleY(39));
FinishedHeadingLabel.Show;
FinishedLabel.Show;
end
end;
end;

//************************************************ [Конец - Компоненты страниц] ***************************************************//

//************************************************ [Начало - ПрогрессБары] ***************************************************//

function PBProcUninst(h:hWnd;Msg,wParam,lParam:Longint):Longint;
var
pr,i1,i2:Extended;
p:string;
begin
if Msg=$2 then SetWindowLong(h,-4,PBOldProc);
Result:=CallWindowProc(PBOldProc,h,Msg,wParam,lParam);
if (Msg=$402) and (UninstallProgressForm.ProgressBar.Position>UninstallProgressForm.ProgressBar.Min) then begin
i1:=UninstallProgressForm.ProgressBar.Position-UninstallProgressForm.ProgressBar.Min;
i2:=UninstallProgressForm.ProgressBar.Max-UninstallProgressForm.ProgressBar.Min;
pr:=i1*100/i2;
p:=Format('%f',[pr])+' %';
ProgressInfoLabel.Caption:=ExpandConstant('{cm:AllProgressUninst} ')+p;
ImgPBSetPosition(NewPB,pr);
ImgApplyChanges(UninstallProgressForm.Handle);
end;
end;

procedure AllCancel;
begin
SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc);
ImgSetVisibility(AImg[CurrentImage],False);
ImgSetVisibility(WizardImg,True);
ImgPBDelete(NewPB);
ImgApplyChanges(WizardForm.Handle);
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
#ifdef ISDone
UnpackingISDone(CurStep);
#endif
#ifdef FreeArc
UnpackingArc(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;
ProgressInfoLabel.Hide;
LabelCurrFileName.Hide;
LabelStatus.Hide;
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
BtnSetEnabled(CancelUnpackingBtn, False);
BtnSetEnabled(hCancelBtn, False);
SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc);
ImgSetVisibility(AImg[CurrentImage],False);
ImgSetVisibility(WizardImg,True);
ImgPBDelete(NewPB);
ImgApplyChanges(WizardForm.Handle);
end;
#endif
#ifdef FreeArc
if (UnPackError <> 0) then
begin
WizardForm.StatusLabel.Hide;
LabelStatusRollback.Show;
FilenameLabel.Hide;
LabelStatus.Hide;
ProgressInfoLabel.Hide;
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
BtnSetEnabled(CancelUnpackingBtn, False);
BtnSetEnabled(hCancelBtn, False);
SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc);
ImgSetVisibility(AImg[CurrentImage],False);
ImgSetVisibility(WizardImg,True);
ImgPBDelete(NewPB);
ImgApplyChanges(WizardForm.Handle);
end;
#endif
WizardForm.ProgressGauge.Visible:=False;

OldPosition:=0;
CurrentImage:=0;
ImgSetVisibility(WizardImg,False);
ImgSetVisibility(AImg[0],True);
#ifndef ISDone
#ifndef FreeArc
//Прогрессбары создаются в скрипте
NewPB:=ImgPBCreate(WizardForm.Handle, ExpandConstant('{tmp}\ProgressBackground.png'), ExpandConstant('{tmp}\ProgressImg.png'),ScaleX(119),ScaleY(300),ScaleX(560),ScaleY(25));
PBOldProc:=SetWindowLong(WizardForm.ProgressGauge.Handle,-4,CallBackProc(@PBProc,4));
#endif
#endif
ImgApplyChanges(WizardForm.Handle);
     sTime:=GetTickCount;
eTime:=sTime;
ProgressStep:=100 div GetArrayLength(AImg);
end;
ssPostInstall: AllCancel;
end;
end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
DeleteSavedGames(CurUninstallStep);
case CurUninstallStep of
usUninstall: begin
UninstallProgressForm.ProgressBar.Visible:=False;

FileCopy(ExpandConstant('{app}\ProgressBackground.png'), ExpandConstant('{tmp}\ProgressBackground.png'), False);
FileCopy(ExpandConstant('{app}\ProgressImg.png'), ExpandConstant('{tmp}\ProgressImg.png'), False);

NewPB:=ImgPBCreate(UninstallProgressForm.Handle, ExpandConstant('{tmp}\ProgressBackground.png'), ExpandConstant('{tmp}\ProgressImg.png'),ScaleX(119),ScaleY(300),ScaleX(560),ScaleY(25));
ImgApplyChanges(UninstallProgressForm.Handle);
PBOldProc:=SetWindowLong(UninstallProgressForm.ProgressBar.Handle,-4,CallBackProc(@PBProcUninst,4));
end;
end;
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;
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
WizardForm.CancelButton.Enabled:=False;
end;
end;
end;

//************************************************ [Конец - ПрогрессБары] ***************************************************//

procedure InitializeWizard;
begin
CreateStatusPanel;
CreateWizardImage;
ButtonsTextures;
InsertMusic;
CreatePageComponents;
#ifdef ISDone
CreateISDoneComponents;
#endif
#ifdef FreeArc
CreateArcComponents;
#endif
end;

procedure CurPageChanged(CurPageID: Integer);
begin
SetStateNewButtons;
Welcome.Font.Color := $FFFFFF;
System.Font.Color := $FFFFFF;
Catalogue.Font.Color := $FFFFFF;
StartMenu.Font.Color := $FFFFFF;
Tasks.Font.Color := $FFFFFF;
Installing.Font.Color :=$FFFFFF;
Finish.Font.Color := $FFFFFF;

HideComponents;
ImgSetVisibility(RequirementsPanel,False);
ImgSetVisibility(Edit,False);
ImgSetVisibility(DirFolder,False);
BtnSetVisibility(hDirBrowseBtn,False);
ImgSetVisibility(HardDrivePanel,False);
ImgSetVisibility(HDD,False);
ImgSetVisibility(GroupFolder,False);
BtnSetVisibility(hGroupBrowseBtn,False);
BtnSetVisibility(NoIconsCheck,False);
BtnSetVisibility(DesktopCheck,False);
BtnSetVisibility(QuickLaunchCheck,False);
BtnSetVisibility(DirectXCheck,False);
BtnSetVisibility(LanguageButton[1],False);
BtnSetVisibility(LanguageButton[2],False);

ShowComponents(CurPageID);
ImgApplyChanges(WizardForm.Handle);
#ifdef ISDone
UnpackingISDoneFinished(CurPageID);
#endif
#ifdef FreeArc
UnpackingArcFinished(CurPageID);
#endif
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);
end;

procedure DeinitializeSetup;
begin
#ifdef Autorun
if ContinueInstall then begin
#endif
BASS_Stop;
BASS_Free;
WFButtonFont.Free;
ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')),0);
    UnloadSkin;
     SetArrayLength(AImg,0);
     gdipShutdown;
#ifdef Autorun
end;
#endif
end;

procedure DeinitializeUninstall;
begin
gdipShutdown;
UnloadSkin;
if Assigned(UPFButtonFont) then UPFButtonFont.Free;
end;

Автор: nik1967
Дата сообщения: 15.08.2010 12:47
demon75
Ну во первых весь скрипт в теги [more][/more]!!!
Во вторых: решил скрипт упростить? В описании что написано? "Обязательные скрипты: PB.iss, Messages.iss, botva2.iss." Где у тебя в скрипте

Код: #include "Messages.iss"
#include "botva2.iss"
#include "PB.iss"

Страницы: 1234567891011121314151617181920212223

Предыдущая тема: Skype (Часть 3)


Форум Ru-Board.club — поднят 15-09-2016 числа. Цель - сохранить наследие старого Ru-Board, истории становления российского интернета. Сделано для людей.