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

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

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

articlebot (13-10-2013 23:33): продолжение темы - №15
 Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

   

YURSHAT



Advanced Member
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору
//#define NeedSize "5000000000"
 
#define NeedMem 512
 
//#define Components
 
//#define SecondProgressBar
 
;#define records
#define precomp04
;#define precomp038
;#define unrar
 
#define MyAppPublisher "3"  
#define MyAppName "vasyakrn"  
 
#define GameEXE "\bin\vk.exe"
#define GameName "vasyakrn"
 
 
 
//#define Splash
//текстурований  buttons
//#define cangel
 
[Setup]  
AppID={{5498E339-0C4E-4FA2-A095-4B9E35359279}
AppName={#GameName}
AppVerName={#GameName}
AppVersion=1.0.0.4
DefaultDirName={pf}\{#GameName}
DefaultGroupName={#GameName}
OutputBaseFilename=setup  
Compression=lzma/Ultra64
SolidCompression=false
DiskSpanning=true
SlicesPerDisk=3
DiskSliceSize=1566000000
DisableReadyPage=true
VersionInfoCopyright=Vasya rePACK  
VersionInfoProductName=1.0  
AppCopyright={#GameName}
InternalCompressLevel=Ultra64
#ifdef NeedSize
ExtraDiskSpaceRequired={#NeedSize}
#endif
 
#ifdef Components
[Types]
Name: full; Description: Full installation; Flags: iscustom
 
[Components]
Name: text; Description: Язык субтитров; Types: full; Flags: fixed
Name: text\rus; Description: Русский; Flags: exclusive; ExtraDiskSpaceRequired: 100000000
Name: text\eng; Description: Английский; Flags: exclusive; ExtraDiskSpaceRequired: 200000000
Name: voice; Description: Язык озвучки; Types: full; Flags: fixed
Name: voice\rus; Description: Русский; Flags: exclusive; ExtraDiskSpaceRequired: 500000000
Name: voice\eng; Description: Английский; Flags: exclusive; ExtraDiskSpaceRequired: 600000000
 
[Tasks]
Name: VCCheck; Description: Установить Microsoft Visual C++ 2005 Redist
Name: PhysXCheck; Description: Установить Nvidia PhysX
 
[Run]
Filename: {src}\Redist\vcredist_x86.exe; Parameters: /q; StatusMsg: Устанавливаем Microsoft Visual C++ 2005 Redist...; Flags: skipifdoesntexist; Tasks: VCCheck; Check: CheckError
Filename: {src}\Redist\PhysX.exe; Parameters: /qn; StatusMsg: Устанавливаем Nvidia PhysX...; Flags: skipifdoesntexist; Tasks: PhysXCheck; Check: CheckError
 
 
 
 
#endif
 
 
 
//[Registry]
 
[Languages]  
Name: russian; MessagesFile: compiler:Languages\Russian.isl  
 
[UninstallDelete]  
Name: {app}\*.*; Type: filesandordirs  
 
 
[CustomMessages]  
russian.ExtractedFile=Извлекается файл:
russian.Extracted=Распаковка архивов...
russian.CancelButton=Отмена
russian.Error=Ошибка распаковки!
russian.ElapsedTime=Прошло:
russian.RemainingTime=Осталось времени:
russian.EstimatedTime=Всего:
russian.AllElapsedTime=Время установки:
 
 
russian.Welcome1=Вас приветствует Мастер установки игры {#GameName}
russian.Welcome2=Программа установит игру {#GameName}  на Ваш компьютер.%n%nРекомендуется закрыть антивирусные пакеты, а также все прочие приложения перед тем, как продолжить.%n%nНажмите «Далее», чтобы продолжить, или «Отмена», чтобы выйти из программы установки.  
russian.Space=Доступно места на диске:  
russian.Space1=Требуется места на диске:  
russian.Status=Пожалуйста, подождите, пока игра установится на Ваш компьютер.  
russian.DescrLbl1=В какую папку Вы хотите установить {#GameName}?  
russian.Language=Виберите язык игры:  
russian.StartMenuLbl=Нажмите «Установить», чтобы продолжить. Если Вы хотите выбрать другую папку, нажмите «Обзор».  
russian.Finished1=Установка игры {#GameName}. Гражданская война успешно завершена.  
russian.Finished2=Игра {#GameName}. Гражданская война была успешно установлена на Ваш компьютер. Для ее запуска выберите соответствующий значек в меню «Пуск» или ярлык на Рабочем столе.  
russian.Finished3=Игра {#GameName} была успешно установлена на Ваш компьютер. Для ее запуска выберите соответствующий значек в меню «Пуск» или ярлык на Рабочем столе.%n  Нажмите «Завершить», чтобы выйти из программы установки. %n %n %n %n %n С уважением VASYAKRN Vasya Vishnovski 2011
russian.DirectX=Обновить DirectX  
russian.DirectXInstall=Идет обновление DirectX...  
russian.Icons=Добавить ярлык на Рабочий стол  
russian.Uninstall=Удалить {#GameName}  
russian.ArcBreak=Установка прервана!  
russian.ExtractedInfo=Распаковано %1 Мб из %2 Мб  
russian.ArcInfo=Архив: %1 из %2  
russian.ArcTitle=Распаковка архивов {#GameName}  
russian.ArcError=Распаковщик вернул код ошибки: %1  
russian.ArcFail=Распаковка не завершена!  
russian.AllProgress=Общий прогресс распаковки: %1%%  
russian.ArcBroken=Возможно, архив %1 повреждён%nили недостаточно места на диске назначения.  
russian.Extracting=Распаковывается: %1  
russian.taskbar=%1%%, жди %2  
russian.remains=Осталось ждать %1  
russian.LongTime=вечно  
russian.ending=завершение  
russian.hour=часов  
russian.min=мин  
russian.sec=сек  
 
 
russian.BUT=Установить  
russian.SPACE=Доступно места на диске:  
russian.SPACE1=Требуется места на диске:  
russian.DirectX=Обновить DirectX  
russian.DirectXInstall=Идет обновление DirectX...  
russian.Icons=Создать ярлык
russian.Group=Создать ярлыки в меню "Пуск"  
russian.Redist=Установить Microsoft C++ Redist  
russian.RedistInstall=Идет установка Microsoft Visual C++ Redistibutable  
russian.Finished1={#GameName}  установлена на Ваш компьютер.  
russian.Finished2=  
russian.RunProgram=  
russian.TasksLabel1=Дополнительные значки:  
russian.TasksLabel2=  
russian.ArcBreak=Установка прервана!  
russian.ExtractedInfo=Распаковано %1 Мб из %2 Мб  
russian.ArcInfo=Архив: %1 из %2  
russian.ArcTitle=Распаковка архивов FreeArc  
russian.ArcError=Распаковщик FreeArc вернул код ошибки: %1  
russian.ArcFail=Распаковка не завершена!  
russian.AllProgress=Общий прогресс распаковки: %1%%  
russian.ArcBroken=Возможно, архив %1 повреждён%nили недостаточно места на диске назначения.  
russian.Extracting=Распаковывается: %1  
russian.taskbar=%1%%, жди %2  
russian.remains=Осталось ждать %1  
russian.LongTime=вечно  
russian.ending=завершение  
russian.hour=часов  
russian.min=мин  
russian.sec=сек  
 
russian.p1=Программа установит игру {#MyAppName} в следущую папку.
russian.p2=Программа создаст ярлыки в следующей папке меню «Пуск».
 
[Files]  
Source: button.bmp; DestDir: {tmp}; Flags: dontcopy  
Source: "splash.png"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "isgsg.dll"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
 
Source: botva2.dll; Flags: dontcopy
Source: DirImage.png; Flags: dontcopy
Source: GroupImage.png; Flags: dontcopy
 
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\facompress.dll; DestDir: {tmp}; Flags: dontcopy
;Source: Include\arc.ini; DestDir: {tmp}; Flags: dontcopy
;Source: Include\srep.exe; DestDir: {tmp}; Flags: dontcopy
 
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp04
Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp04.exe; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp038
Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef unrar
Source: Include\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#endif
 
 
Source: 1.bmp; Flags: dontcopy  
 
 
 
[Icons]  
Name: {group}\Удалить; Filename: {app}\unins000.exe; WorkingDir: {app}  
Name: {userdesktop}\{#GameName}; Filename: {app}{#GameEXE}; WorkingDir: {app}\; Check: CreateIcons; Languages: ;
Name: {group}\{#GameName}; Filename:{app}{#GameEXE}; WorkingDir: {app}\;  
 
 
[Run]  
Filename: {app}\DirectX\DXSETUP.exe; WorkingDir: {src}\DirectX; Parameters: /silent; StatusMsg: ExpandConstant('{cm:DirectXInstall}'); Check: InstallDirectX; Flags: waituntilterminated; BeforeInstall: ProgressExt2(); AfterInstall: ProgressExt3()  
 
 
[Code]
 
function ImgLoad(Wnd :HWND; FileName: PAnsiChar; Left, Top, Width, Height :integer; Stretch, IsBkg :boolean) :Longint; external 'ImgLoad@{tmp}\botva2.dll stdcall delayload';
procedure ImgApplyChanges(h:HWND); external 'ImgApplyChanges@{tmp}\botva2.dll stdcall delayload';
procedure gdipShutdown;  external 'gdipShutdown@{tmp}\botva2.dll stdcall delayload';
 
procedure ShowSplashScreen(p1:HWND;p2:string;p3,p4,p5,p6,p7:integer;p8:boolean;p9:Cardinal;p10:integer); external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';
 
const  
  PCFonFLY=true;
  notPCFonFLY=false;
   
PM_REMOVE = 1;  
CP_ACP = 0; CP_UTF8 = 65001;  
oneMb = 1048576;  
 
ButtonWidth = 100;  
ButtonHeight = 25;  
 
bidBack = 0;  
bidNext = 1;  
bidCancel = 2;  
bidDirBrowse = 3;  
bidGroupBrowse = 4;  
 
var  
  LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2,LabelTime3: TLabel;
  ISDoneProgressBar1: TNewProgressBar;
#ifdef SecondProgressBar
  LabelPct2: TLabel;
  ISDoneProgressBar2:TNewProgressBar;
#endif
  MyCancelButton: TButton;
  Cancel:integer;
  MyError:boolean;
  PCFVer:double;
  SelectDirBitmapImage, SelectGroupBitmapImage: Longint;
 
ButtonPanel: array [0..4] of TPanel;  
ButtonImage: array [0..4] of TBitmapImage;  
ButtonLabel: array [0..4] of TLabel;  
SetupFormPanel: TPanel;  
 
 
 
LanguageLabel1: TLabel;  
LanguageLabel2: TLabel;  
 
rus: Boolean;  
pnl_ru, pnl_us: TPanel;  
 
 
Welcome, Parameters, StartMenu, Installing, Finish,  
 
IconsLabel, DirectXLabel, GroupLabel,p1,p2,  
SelectDirLabel, SelectDirBrowseLabel,  
PageNameLabel1, PageNameLabel2, PageNameLabel3,  
PageDescriptionLabel1, PageDescriptionLabel2, PageDescriptionLabel3,  
StatusLabel, FilenameLabel, NeedSpaceLabel,FreeSpaceLabel,  
WelcomeLabel1, WelcomeLabel2,FinishedLabel, FinishedHeadingLabel,  
SelectStartMenuFolderLabel, SelectStartMenuFolderBrowseLabel, ReadyLabel, NoIconsLabel: TLabel;  
DirectX, Icons, Group: TCheckBox;  
NeedSize:Integer;  
FreeMB, TotalMB: Cardinal;  
BmpFile: TBitmapImage;  
ExtractFile: TLabel;  
lblExtractFileName: TLabel;  
btnCancelUnpacking: TButton;  
CancelCode, n, UnPackError, StartInstall: Integer;  
 
msgError: string;  
lastMb: Integer;  
baseMb: Integer;  
totalUncompressedSize: Integer; // total uncompressed size of archive data in mb  
LastTimerEvent: DWORD;  
 
function InitializeSetup:boolean;
begin
  if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');
  Result:=True;
end;
 
procedure CreateFolderImage();
begin
  ExtractTemporaryFile('DirImage.png');
  ExtractTemporaryFile('GroupImage.png');
   
  WizardForm.SelectDirBitmapImage.Hide;
  WizardForm.SelectGroupBitmapImage.Hide;
   
  SelectDirBitmapImage:=ImgLoad(WizardForm.SelectDirPage.Handle,ExpandConstant('{tmp}\DirImage.png'),ScaleX(55), ScaleY(140),ScaleX(48),ScaleY(48),true,false);
  SelectGroupBitmapImage:=ImgLoad(WizardForm.SelectProgramGroupPage.Handle,ExpandConstant('{tmp}\GroupImage.png'),ScaleX(55), ScaleY(140),ScaleX(48),ScaleY(48),true,false);
 
  ImgApplyChanges(WizardForm.SelectDirPage.Handle);
  ImgApplyChanges(WizardForm.SelectProgramGroupPage.Handle);
end;
 
function DetectPage(CurPageID: Integer): TNewNotebookPage;  
begin  
case CurPageID of  
wpWelcome: Result:= WizardForm.WelcomePage;  
wpSelectDir: Result:= WizardForm.SelectDirPage;  
wpSelectProgramGroup: Result:= WizardForm.SelectProgramGroupPage;  
wpInstalling: Result:= WizardForm.InstallingPage;  
wpFinished: Result:= WizardForm.FinishedPage;  
end;  
end;  
 
Function NumToStr(Float: Extended): String;  
Begin  
Result:= Format('%.2n', [Float]); StringChange(Result, ',', '.');  
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do  
SetLength(Result, Length(Result)-1);  
End;  
 
function InstallDirectX: Boolean;  
begin  
Result:= DirectX.Checked;  
end;  
 
function CreateIcons: Boolean;  
begin  
Result:=Icons.Checked;  
end;  
 
function GroupIcons: Boolean;  
begin  
Result:=Group.Checked;  
end;  
 
procedure DirectXLabelOnClick(Sender: TObject);  
begin  
if DirectX.Checked = False then  
DirectX.Checked:= True else  
DirectX.Checked:= False;  
end;  
 
procedure IconsOnClick(Sender: TObject);  
begin  
if Icons.Checked = False then  
Icons.Checked:= True else  
Icons.Checked:= False;  
end;  
 
type
  TCallback = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
 
function WrapMyCallback(callback:TCallback; paramcount:integer):longword;external 'wrapcallback@files:ISDone.dll stdcall';
 
function ISArcExtract(CurComponent:longword; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password, CfgFile, WorkPath: AnsiString; ExtractPCF: BOOL ):BOOL; external 'ISArcExtract@files:ISDone.dll stdcall';
function IS7ZipExtract(CurComponent:longword; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):BOOL; external 'IS7zipExtract@files:ISDone.dll stdcall';
function ISRarExtract(CurComponent:longword; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):BOOL; external 'ISRarExtract@files:ISDone.dll stdcall';
function ISPrecompExtract(CurComponent:longword; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):BOOL; external 'ISPrecompExtract@files:ISDone.dll stdcall';
function ISSRepExtract(CurComponent:longword; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):BOOL; external 'ISSrepExtract@files:ISDone.dll stdcall';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):BOOL; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall';
function ISDoneInitialize(RecordFileName:AnsiString; TimeType,Comp1,Comp2,Comp3:longword; PrecompVers: double; RecursiveSubDir:boolean; WinHandle, NeededMem:longint; callback:TCallback):BOOL; external 'ISDoneInitialize@files:ISDone.dll stdcall';
function ISDoneStop:BOOL; external 'ISDoneStop@files:ISDone.dll stdcall';
 
function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
begin
  if OveralPct<=1000 then ISDoneProgressBar1.Position := OveralPct;
  LabelPct1.Caption := IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
#ifdef SecondProgressBar
  if CurrentPct<=1000 then
    ISDoneProgressBar2.Position := CurrentPct;
  LabelPct2.Caption := IntToStr(CurrentPct div 10)+'.'+chr(48 + CurrentPct mod 10)+'%';
#endif
  LabelCurrFileName.Caption:=MinimizePathName(ExpandConstant('{cm:ExtractedFile} ')+CurrentFile, LabelCurrFileName.Font, LabelCurrFileName.Width);
  LabelTime1.Caption:=ExpandConstant('{cm:ElapsedTime} ')+TimeStr2;
  LabelTime2.Caption:=ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
  LabelTime3.Caption:=ExpandConstant('{cm:AllElapsedTime}')+TimeStr3;
  Result := Cancel;
end;
 
procedure CancelButtonOnClick(Sender: TObject);
begin
  if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then Cancel:=1;
end;
 
procedure HideComponents;
begin
  WizardForm.FileNamelabel.Hide;
  ISDoneProgressBar1.Hide;
  LabelPct1.Hide;
  LabelCurrFileName.Hide;
  LabelTime1.Hide;
  LabelTime2.Hide;
  MyCancelButton.Hide;
#ifdef SecondProgressBar
  ISDoneProgressBar2.Hide;
  LabelPct2.Hide;
#endif
end;
 
procedure ShowComponents;
var PBTop:integer;
begin
  PBTop:=ScaleY(250);
  ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
  with ISDoneProgressBar1 do begin
    Parent   := WizardForm.InstallingPage;
    Height   := WizardForm.ProgressGauge.Height;
    Left     := ScaleX(50);
    Top      := PBTop;
    Width    := ScaleX(510);
    Max      := 1000;
 
  end;
  LabelPct1 := TLabel.Create(WizardForm);
  with LabelPct1 do begin
    Parent    := WizardForm.InstallingPage;
    AutoSize  := False;
    Left      := ISDoneProgressBar1.Width+ScaleX(5);
    Top       := ISDoneProgressBar1.Top + ScaleY(20);
    Width     := ScaleX(0);
    Width:= ScaleX(0);  
  end;
  LabelCurrFileName := TLabel.Create(WizardForm);
  with LabelCurrFileName do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := ISDoneProgressBar1.Width+ScaleX(0);
    Left     := ScaleX(0);
    Top      := ScaleY(30);
    Width:= ScaleX(0);
  end;
#ifdef SecondProgressBar
  PBTop:=PBTop+ScaleY(25);
  ISDoneProgressBar2 := TNewProgressBar.Create(WizardForm);
  with ISDoneProgressBar2 do begin
    Parent   := WizardForm.InstallingPage;
    Left     := ScaleX(0);
    Top      := PBTop+ScaleY(8);
    Width    := ISDoneProgressBar1.Width;
    Max      := 1000;
    Height   := WizardForm.ProgressGauge.Height;
 
  end;
  LabelPct2 := TLabel.Create(WizardForm);
  with LabelPct2 do begin
    Parent    := WizardForm.InstallingPage;
    AutoSize  := False;
    Left      := ISDoneProgressBar2.Width+ScaleX(5);
    Top       := ISDoneProgressBar2.Top + ScaleY(2);
    Width     := ScaleX(80);
 
  end;
#endif
  LabelTime1 := TLabel.Create(WizardForm);
  with LabelTime1 do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := ISDoneProgressBar1.Width div 2;
    Left     := ScaleX(80);
    Top      := PBTop + ScaleY(35);
    Width:= ScaleX(0);
  end;
  LabelTime2 := TLabel.Create(WizardForm);
  with LabelTime2 do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := LabelTime1.Width+ScaleX(0);
    Left     := ISDoneProgressBar1.Width div 2;
    Top      := LabelTime1.Top;
    Width:= ScaleX(0);
  end;
  LabelTime3 := TLabel.Create(WizardForm);
  with LabelTime3 do begin
    Parent   := WizardForm.FinishedPage;
    AutoSize := false;
    Width    := 0;
    Left     := 1800;
    Top      := 2000;
    Width:= ScaleX(0);
  end;
  MyCancelButton:=TButton.Create(WizardForm);
  with MyCancelButton do begin
    Parent:=WizardForm;
    Width:=ScaleX(110);
    Caption:=ExpandConstant('{cm:CancelButton}');
    Left:=ScaleX(499);
    Top:=WizardForm.cancelbutton.top;
    OnClick:=@CancelButtonOnClick;
    #ifdef cangel
    Width:= ScaleX(0);
    #endif
  end;
end;
 
 
procedure GetFreeSpaceCaption(Sender: TObject);  
var  
Path: String;  
begin  
Path := ExtractFileDrive(WizardForm.DirEdit.Text);  
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);  
if FreeMB > 1024 then  
FreeSpaceLabel.Caption := ExpandConstant('{cm:SPACE} ')+ NumToStr(round(FreeMB/1024*100)/100) + ' GB' else  
FreeSpaceLabel.Caption := ExpandConstant('{cm:SPACE} ')+ NumToStr(FreeMB)+ ' MB';  
  if FreeMB < NeedSize then  
  WizardForm.NextButton.Enabled := False else  
  WizardForm.NextButton.Enabled := True; end;  
 
procedure GetNeedSpaceCaption;  
begin  
if NeedSize > 1024 then  
NeedSpaceLabel.Caption := ExpandConstant('{cm:SPACE1} ')+ NumToStr(round(NeedSize/1024*100)/100) + ' GB' else  
NeedSpaceLabel.Caption := ExpandConstant('{cm:SPACE1} ')+ NumToStr(NeedSize)+ ' MB';  
end;  
 
procedure ProgressExt();  
begin  
FilenameLabel.Caption:= ExpandConstant(ExtractFileDir(CurrentFilename)) + '\' + ExtractFilename(CurrentFilename);  
end;  
 
procedure ProgressExt2();  
begin  
FilenameLabel.Caption:= ExpandConstant('{cm:DirectXInstall}')  
end;  
 
procedure ProgressExt3();  
begin  
FilenameLabel.Caption:= ''  
end;  
 
procedure InitializeWizard1();  
begin
  #ifdef Splash
ExtractTemporaryFile('splash.png');
ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}')+'\splash.png',1000,3000,1000,0,255,False,$FFFFFF,10);
WizardForm.Position:=poScreenCenter;
  #endif
ExtractTemporaryFile('1.bmp');  
 
NeedSize:= 5000;  
 
BmpFile:= TBitmapImage.Create(WizardForm);  
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));  
BmpFile.Top:= ScaleY(0);  
BmpFile.Left:= ScaleX(0);  
BmpFile.Width:= ScaleX(646);  
BmpFile.Height:= ScaleY(423);  
BmpFile.Stretch:= true;  
BmpFile.Parent:= WizardForm.WelcomePage;  
 
BmpFile:= TBitmapImage.Create(WizardForm);  
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));  
BmpFile.Top:= ScaleY(0);  
BmpFile.Left:= ScaleX(0);  
BmpFile.Width:= ScaleX(646);  
BmpFile.Height:= ScaleY(423);  
BmpFile.Stretch:= true;  
BmpFile.Parent:= WizardForm.SelectDirPage;  
 
BmpFile:= TBitmapImage.Create(WizardForm);  
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));  
BmpFile.Top:= ScaleY(0);  
BmpFile.Left:= ScaleX(0);  
BmpFile.Width:= ScaleX(646);  
BmpFile.Height:= ScaleY(423);  
BmpFile.Stretch:= true;  
BmpFile.Parent:= WizardForm.SelectProgramGroupPage;  
 
BmpFile:= TBitmapImage.Create(WizardForm);  
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));  
BmpFile.Top:= ScaleY(0);  
BmpFile.Left:= ScaleX(0);  
BmpFile.Width:= ScaleX(646);  
BmpFile.Height:= ScaleY(423);  
BmpFile.Stretch:= true;  
BmpFile.Parent:= WizardForm.InstallingPage;  
 
BmpFile:= TBitmapImage.Create(WizardForm);  
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));  
BmpFile.Top:= ScaleY(0);  
BmpFile.Left:= ScaleX(0);  
BmpFile.Width:= ScaleX(646);  
BmpFile.Height:= ScaleY(423);  
BmpFile.Stretch:= true  
BmpFile.Parent:= WizardForm.FinishedPage;  
 
WizardForm.ClientWidth:=ScaleX(646);  
WizardForm.ClientHeight:=ScaleY(423);  
WizardForm.Font.Color:=$ffffff;  
WizardForm.Center;  
 
with WizardForm do  
begin  
PageNameLabel.Hide;  
PageDescriptionLabel.Hide;  
WelcomeLabel1.Hide;  
WelcomeLabel2.Hide;  
DiskSpaceLabel.Hide;  
SelectDirBitmapImage.Hide;  
SelectDirBrowseLabel.Hide;  
SelectDirLabel.Hide;  
FinishedHeadingLabel.Hide;  
FinishedLabel.Hide;  
MainPanel.Hide;  
FilenameLabel.Hide;  
StatusLabel.Hide;  
SelectStartMenuFolderLabel.Hide;  
SelectStartMenuFolderBrowseLabel.Hide;  
ReadyLabel.Hide;  
end;  
 
with WizardForm do  
begin  
InnerNotebook.Left := ScaleX(0);  
InnerNotebook.Top := ScaleY(0);  
InnerNotebook.Width := ScaleX(646);  
InnerNotebook.Height := ScaleY(423);  
OuterNotebook.Left := ScaleX(0);  
OuterNotebook.Top := ScaleY(0);  
OuterNotebook.Width := ScaleX(646);  
OuterNotebook.Height := ScaleY(423);  
end;  
 
////////////////////// WelcomePage //////////////////////  
 
WelcomeLabel1:= TLabel.Create(WizardForm);  
with WelcomeLabel1 do  
begin  
Left:= ScaleX(40);  
Top:= ScaleY(150);  
Width:= ScaleX(650);  
Height:= ScaleY(400);  
AutoSize:= false;  
Transparent:= true;  
WordWrap:= true;  
Font.Name:='arial';  
Font.Size:= 10;  
Font.Color:=ClWhite;///главная надпись на странице приветствия  
Font.Style := [fsBold , fsItalic];  
Parent:= WizardForm.WelcomePage;  
Caption:= ExpandConstant('{cm:Welcome1}');  
end;  
 
WelcomeLabel2:=TLabel.Create(WizardForm);  
with WelcomeLabel2 do  
begin  
Top:= ScaleY(204);  
Left:= ScaleX(60);  
Width:= ScaleX(500);  
Height:= ScaleY(220);  
AutoSize:= false;  
Transparent:= true;  
WordWrap:= true;  
Font.Name:='arial';  
Font.Size:= 9;  
Font.Color:=ClWhite;///главная надпись на странице приветствия  
Font.Style := [fsBold , fsItalic];  
Parent:= WizardForm.WelcomePage;  
Caption:= ExpandConstant('{cm:Welcome2}');  
end;  
 
////////////////////// WelcomePage //////////////////////  
 
////////////////////// SelectDirPage //////////////////////  
 
   p1:= TLabel.Create(WizardForm);  
  with p1 do  
  begin  
  Caption:=ExpandConstant('{cm:p1}');  
  Left:= ScaleX(95);  
  Top:= ScaleY(168);  
  Width:= ScaleX(150);  
  Height:= ScaleY(113);  
 Font.Name:= 'arial';  
Font.Size:= 9;  
Font.Style:= [fsBold, fsItalic];  
Font.Color := clwhite;
  Transparent := True;  
  Parent:= WizardForm.SelectDirPage;
end;  
 
PageNameLabel1:= TLabel.Create(WizardForm);  
with PageNameLabel1 do  
begin  
Left:= ScaleX(44);  
Top:= ScaleY(32);  
Width:= ScaleX(300);  
Height:= ScaleY(30);  
AutoSize:= False;  
Font.Name:= 'Arial'  
Font.Size:= 10;  
Font.Style:= [fsBold, fsItalic];  
Font.Color:= Clwhite;  
Transparent := True;  
Parent:= WizardForm.SelectDirPage;  
end;  
 
PageDescriptionLabel1:= TLabel.Create(WizardForm);  
with PageDescriptionLabel1 do  
begin  
Left:=ScaleX(65);  
Top:= ScaleY(57);  
Width:= ScaleX(600);  
Height:= ScaleY(50);  
AutoSize:= False;  
Font.Name:= 'arial'  
Font.Size:= 10;  
Font.Style:= [fsBold, fsItalic];  
Font.Color:= ClWhite;  
Wordwrap:= True;  
Transparent := True;  
Parent:= WizardForm.SelectDirPage;  
end;  
 
SelectDirBrowseLabel:= TLabel.Create(WizardForm);  
with SelectDirBrowseLabel do  
begin  
Caption:= WizardForm.SelectDirBrowseLabel.Caption;  
Left:= ScaleX(55);  
Top:= ScaleY(195);  
Width:= ScaleX(500);  
Height:= ScaleY(50);  
AutoSize:= False;  
WordWrap:= True;  
Font.Name:= 'Arial'  
Font.Size:= 9;  
Font.Style:= [fsBold, fsItalic];  
Font.Color:= ClWhite;  
Transparent:= True;  
Parent:= WizardForm.SelectDirPage;  
end;  
 
with WizardForm do  
begin  
DirBrowseButton.Left:= ScaleX(1);  
DirBrowseButton.Top:= ScaleY(1);  
 
DirEdit.Left:= ScaleX(55);  
DirEdit.Top:= ScaleY(239);  
DirEdit.Width:= ScaleX(440);  
DirEdit.Font.Color:= ClBlack;  
DirEdit.Font.Name:= 'Arial'  
DirEdit.Font.Size:= 9;  
DirEdit.Font.Style:= [fsBold, fsItalic];
end;  
 
DirectX:= TCheckBox.Create(WizardForm);  
with DirectX do  
begin  
Parent:= WizardForm.SelectDirPage;  
Left:= ScaleX(300);  
Top:= ScaleY(270);  
Width:= ScaleX(14);  
Height:= ScaleY(14);  
TabOrder:= 0;  
Checked:= true;  
end;  
 
DirectXLabel:= TLabel.Create(WizardForm);  
with DirectXLabel do  
begin  
Caption:= ExpandConstant('{cm:DirectX}');  
Left:= ScaleX(315);  
Top:= ScaleY(270);  
Width:= ScaleX(150);  
Height:= ScaleY(13);  
Font.Name:= 'arial';  
Font.Size:= 8;  
Font.Style:= [fsBold, fsItalic];  
Font.Color:= ClWhite;  
Transparent := True;  
Parent:= WizardForm.SelectDirPage;  
OnClick:= @DirectXLabelOnClick;  
end;  
 
Icons:= TCheckBox.Create(WizardForm);  
with Icons do  
begin  
Parent:= WizardForm.SelectDirPage;  
Left:= ScaleX(300);  
Top:= ScaleY(290);  
Width:= ScaleX(14);  
Height:= ScaleY(14);  
TabOrder:= 2;  
Checked:= True;  
end;  
 
IconsLabel:= TLabel.Create(WizardForm);  
with IconsLabel do  
begin  
Caption:=ExpandConstant('{cm:Icons}');  
Left:= ScaleX(315);  
Top:= ScaleY(290);  
Width:= ScaleX(150);  
Height:= ScaleY(13);  
Font.Name:= 'arial';  
Font.Size:= 8;  
Font.Style:= [fsBold, fsItalic];  
Font.Color:= ClWhite;  
Transparent := True;  
Parent:= WizardForm.SelectDirPage;  
OnClick:= @IconsOnClick;  
end;  
 
NeedSpaceLabel:= TLabel.Create(WizardForm);  
with NeedSpaceLabel do  
begin  
Parent:= WizardForm.SelectDirPage;  
Left:= ScaleX(60);  
Top:= ScaleY(270);  
Width:= ScaleX(209);  
Height:= ScaleY(13);  
Font.Name:= 'arial';  
Font.Size:= 9;  
Font.Style:= [fsBold, fsItalic];  
Font.Color:= ClWhite;  
Transparent:= True;  
end;  
 
FreeSpaceLabel:= TLabel.Create(WizardForm);  
with FreeSpaceLabel do  
begin  
Parent:= WizardForm.SelectDirPage;  
Left:= ScaleX(60);  
Top:= ScaleY(290);  
Width:= ScaleX(209);  
Height:= ScaleY(13);  
Font.Name:= 'arial';  
Font.Size:= 9;  
Font.Style:= [fsBold, fsItalic];  
Font.Color:= ClWhite;  
Transparent:= True;  
end;  
 
WizardForm.DirEdit.OnChange:= @GetFreeSpaceCaption;  
WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text + #0;  
 
////////////////////// SelectDirPage //////////////////////  
 
////////////////////// ProgrammGroupPage //////////////////////  
 
  p2:= TLabel.Create(WizardForm);  
  with p2 do  
  begin  
  Caption:=ExpandConstant('{cm:p2}');  
  Left:= ScaleX(95);  
  Top:= ScaleY(168);  
  Width:= ScaleX(150);  
  Height:= ScaleY(113);  
 Font.Name:= 'arial';  
Font.Size:= 9;  
Font.Style:= [fsBold, fsItalic];  
Font.Color := clwhite;
  Transparent := True;  
  Parent:= WizardForm.SelectProgramGroupPage;
end;  
 
PageNameLabel2:= TLabel.Create(WizardForm);  
with PageNameLabel2 do  
begin  
Left:= ScaleX(44);  
Top:= ScaleY(32);  
Width:= ScaleX(350);  
Height:= ScaleY(30);  
AutoSize:= False;  
Font.Name:= 'arial';  
Font.Size:= 10;  
Font.Style:= [fsBold, fsItalic];  
Font.Color:= Clwhite;  
Transparent := True;  
Parent:= WizardForm.SelectProgramGroupPage;  
end;  
 
PageDescriptionLabel2:= TLabel.Create(WizardForm);  
with PageDescriptionLabel2 do  
begin  
Left:=ScaleX(65);  
Top:= ScaleY(57);  
Width:= ScaleX(600);  
Height:= ScaleY(50);  
AutoSize:= False;  
Font.Name:= 'arial'  
Font.Size:= 10;  
Font.Style:= [fsBold, fsItalic];  
Font.Color:= ClWhite;  
Wordwrap:= True;  
Transparent := True;  
Parent:= WizardForm.SelectProgramGroupPage;  
end;  
 
SelectStartMenuFolderBrowseLabel:=TLabel.Create(WizardForm)  
with SelectStartMenuFolderBrowseLabel do  
begin  
Left:= ScaleX(55);  
Top:= ScaleY(195);  
Width:= ScaleX(500);  
Height:= ScaleY(50);  
AutoSize:= False;  
WordWrap:= True;  
Font.Name:= 'arial';  
Font.Size:= 10;  
Font.Style:= [fsBold, fsItalic];  
Font.Color:= ClWhite;  
WordWrap:=True  
Transparent:=True  
Caption:=ExpandConstant('{cm:StartMenuLbl}')  
Parent:=WizardForm.SelectProgramGroupPage  
end;  
 
with WizardForm do  
begin  
GroupEdit.Left:= ScaleX(55);  
GroupEdit.Top:= ScaleY(239);  
GroupEdit.Width:= ScaleX(440);  
GroupEdit.Font.Color:= ClBlack;  
GroupEdit.Font.Name:= 'Arial'  
GroupEdit.Font.Size:= 9;  
GroupEdit.Font.Style:= [fsBold, fsItalic];
 
GroupBrowseButton.Top:= ScaleY(405);  
end;  
 
////////////////////// ProgrammGroupPage //////////////////////  
 
////////////////////// InstallingPage //////////////////////  
 
PageNameLabel3:= TLabel.Create(WizardForm);  
with PageNameLabel3 do  
begin  
Left:= ScaleX(44);  
Top:= ScaleY(32);  
Width:= ScaleX(150);  
Height:= ScaleY(20);  
AutoSize:= False;  
Font.Name:= 'arial';  
Font.Size:= 10;  
Font.Style:= [fsBold, fsItalic];  
Font.Color:= Clwhite;  
Transparent := True;  
Parent:= WizardForm.InstallingPage;  
end;  
 
StatusLabel:= TLabel.Create(WizardForm);  
with StatusLabel do  
begin  
Left:=ScaleX(65);  
Top:= ScaleY(57);  
Width:= ScaleX(600);  
Height:= ScaleY(50);  
AutoSize:= False;  
Font.Name:= 'arial';  
Font.Size:= 10;  
Font.Style:= [fsBold, fsItalic];  
Font.Color:= ClWhite;  
Transparent := True;  
Parent:= WizardForm.InstallingPage;  
Caption:= ExpandConstant('{cm:Status}')  
end;  
 
FilenameLabel:= TLabel.Create(WizardForm);  
with FilenameLabel do  
begin  
Left:= ScaleX(65);  
Top:= ScaleY(220);  
Width:= ScaleX(535);  
Height:= ScaleY(20);  
AutoSize:= False;  
Font.Name:= 'arial'  
Font.Size:= 10;  
Font.Style:= [fsBold, fsItalic];  
Font.Color:= ClWhite;  
Transparent := True;  
Parent:= WizardForm.InstallingPage;  
end;  
 
with WizardForm do  
begin  
ProgressGauge.Top:=ScaleY(250);  
ProgressGauge.Left:=ScaleX(50);  
ProgressGauge.Width:=ScaleX(510);  
end;  
 
////////////////////// InstallingPage //////////////////////  
 
////////////////////// FinishedPage //////////////////////  
 
FinishedHeadingLabel:=TLabel.Create(WizardForm);  
with FinishedHeadingLabel do  
begin  
Left:= ScaleX(25);  
Top:= ScaleY(135);  
Width:= ScaleX(650);  
Height:= ScaleY(65)  
AutoSize:= false;  
Alignment := taCenter;  
WordWrap:= true;  
Font.Name:='arial';  
Font.Size:= 10;  
Font.Color:=Clwhite;  
Font.Style := [fsBold, fsItalic];  
Transparent:= true;  
Parent:= WizardForm.FinishedPage;  
Caption:= ExpandConstant('{cm:Finished1}');  
end;  
 
FinishedLabel:= TLabel.Create(WizardForm);  
with FinishedLabel do  
begin  
Top:= ScaleY(140);  
Left:= ScaleX(50);  
Width:= ScaleX(550);  
Height:= ScaleY(200);  
AutoSize:= false;  
WordWrap:= true;  
Font.Name:= 'arial, fsItalic'  
Font.Size:= 10;  
Font.Style := [fsBold, fsItalic];  
Font.Color:=ClWhite;  
Transparent:= true;  
Parent:= WizardForm.FinishedPage;  
Caption:= ExpandConstant('{cm:Finished2}')+#13#13+ExpandConstant('{cm:Finished3}');  
end;  
end;  
 
////////////////////// FinishedPage //////////////////////  
 
procedure CurPageChanged1(CurPageID: Integer);  
begin  
PageNameLabel1.Caption:= WizardForm.PageNameLabel.Caption;  
PageDescriptionLabel1.Caption:= WizardForm.PageDescriptionLabel.Caption;  
PageNameLabel2.Caption:= WizardForm.PageNameLabel.Caption;  
PageDescriptionLabel2.Caption:= WizardForm.PageDescriptionLabel.Caption;  
PageNameLabel3.Caption:= WizardForm.PageNameLabel.Caption;  
 
if CurPageID=wpSelectProgramGroup then  
begin  
If WizardForm.FindComponent('NextButton') is TButton  
then  
TButton(WizardForm.FindComponent('NextButton')).Caption:='Установить';  
end;  
end;  
 
//************************************************ [Начало - Текстуры кнопок] ***************************************************//  
 
procedure ButtonLabelClick(Sender: TObject);  
var  
Button: TButton;  
begin  
ButtonImage[TLabel(Sender).Tag].Left := 0;  
case TLabel(Sender).Tag of  
bidBack: Button := WizardForm.BackButton;  
bidNext: Button := WizardForm.NextButton;  
bidCancel: Button := WizardForm.CancelButton;  
bidDirBrowse: Button := WizardForm.DirBrowseButton;  
bidGroupBrowse: Button := WizardForm.GroupBrowseButton;  
else  
Exit  
end  
Button.OnClick(Button);  
end;  
 
procedure ButtonLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);  
begin  
if ButtonLabel[TLabel(Sender).Tag].Enabled then  
ButtonImage[TLabel(Sender).Tag].Left := -ScaleX(ButtonWidth);  
end;  
 
procedure ButtonLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);  
begin  
ButtonImage[TLabel(Sender).Tag].Left := 0;  
end;  
 
procedure LoadButtonImage(AButton: TButton; AButtonIndex: integer);  
var  
Image: TBitmapImage;  
Panel: TPanel;  
Labl: TLabel;  
 
begin  
Panel := TPanel.Create(WizardForm);  
Panel.Left := AButton.Left;  
Panel.Top := AButton.Top;  
Panel.Width := AButton.Width;  
Panel.Height := AButton.Height;  
Panel.Tag := AButtonIndex;  
Panel.Parent := AButton.Parent;  
ButtonPanel[AButtonIndex] := Panel;  
 
Image := TBitmapImage.Create(WizardForm);  
Image.Width := ScaleX(200);  
Image.Height := ScaleY(25);  
Image.Enabled := False;  
Image.Bitmap.LoadFromFile(ExpandConstant('{tmp}\button.bmp'));  
Image.Stretch := True;  
Image.Parent := Panel;  
ButtonImage[AButtonIndex] := Image;  
 
with TLabel.Create(WizardForm) do begin  
Tag := AButtonIndex;  
Parent := Panel;  
Width := Panel.Width;  
Height := Panel.Height;  
Transparent := True;  
OnClick := @ButtonLabelClick;  
OnDblClick := @ButtonLabelClick;  
OnMouseDown := @ButtonLabelMouseDown;  
OnMouseUp := @ButtonLabelMouseUp;  
end;  
 
Labl := TLabel.Create(WizardForm);  
Labl.Autosize := True;  
Labl.Alignment := taCenter;  
Labl.Tag := AButtonIndex;  
Labl.Transparent := True;  
Labl.Font.Color := clWhite;  
Labl.Font.Style := [fsBold];  
Labl.Caption := AButton.Caption;  
Labl.OnClick := @ButtonLabelClick;  
Labl.OnDblClick := @ButtonLabelClick;  
Labl.OnMouseDown := @ButtonLabelMouseDown;  
Labl.OnMouseUp := @ButtonLabelMouseUp;  
Labl.Parent := Panel;  
ButtonLabel[AButtonIndex] := Labl;  
end;  
 
procedure UpdateButton(AButton: TButton;AButtonIndex: integer);  
begin  
ButtonLabel[AButtonIndex].Caption := AButton.Caption;  
ButtonPanel[AButtonIndex].Visible := AButton.Visible;  
ButtonLabel[AButtonIndex].Enabled := Abutton.Enabled;  
end;  
 
procedure InitializeWizard2();  
begin  
WizardForm.BackButton.SetBounds(WizardForm.ClientWidth - ScaleX(8) * 44,  
WizardForm.ClientHeight - ScaleY(ButtonHeight) * 2, ScaleX(ButtonWidth), ScaleY(ButtonHeight));  
 
WizardForm.NextButton.SetBounds(WizardForm.ClientWidth - ScaleX(8) * 31,  
WizardForm.ClientHeight - ScaleY(ButtonHeight) * 2, ScaleX(ButtonWidth), ScaleY(ButtonHeight));  
 
WizardForm.CancelButton.SetBounds(WizardForm.ClientWidth - ScaleX(8)* 18,  
WizardForm.ClientHeight - ScaleY(ButtonHeight) * 2, ScaleX(ButtonWidth), ScaleY(ButtonHeight));  
 
WizardForm.DirBrowseButton.Left:=507
WizardForm.DirBrowseButton.Width:=ButtonWidth
WizardForm.DirBrowseButton.Height:=ButtonHeight
WizardForm.DirBrowseButton.top:=237
 
WizardForm.GroupBrowseButton.Left:=507  
WizardForm.GroupBrowseButton.top:=237
WizardForm.GroupBrowseButton.Width:=ButtonWidth
WizardForm.GroupBrowseButton.Height:=ButtonHeight
   
   
ExtractTemporaryFile('button.bmp')  
LoadButtonImage(WizardForm.BackButton,bidBack)  
LoadButtonImage(WizardForm.NextButton,bidNext)  
LoadButtonImage(WizardForm.CancelButton,bidCancel)  
LoadButtonImage(WizardForm.DirBrowseButton,bidDirBrowse)  
LoadButtonImage(WizardForm.GroupBrowseButton,bidGroupBrowse)  
end;  
 
procedure CurPageChanged2(CurPageID: Integer);  
begin  
 
UpdateButton(WizardForm.BackButton,bidBack)  
UpdateButton(WizardForm.NextButton,bidNext)  
UpdateButton(WizardForm.CancelButton,bidCancel)  
 
ButtonLabel[bidBack].Left := ButtonPanel[bidBack].Width div 2 - ButtonLabel[bidBack].Width div 2;  
ButtonLabel[bidBack].Top := ButtonPanel[bidBack].Height div 2 - ButtonLabel[bidBack].Height div 2;  
ButtonLabel[bidNext].Left := ButtonPanel[bidNext].Width div 2 - ButtonLabel[bidNext].Width div 2;  
ButtonLabel[bidNext].Top := ButtonPanel[bidNext].Height div 2 - ButtonLabel[bidNext].Height div 2;  
ButtonLabel[bidCancel].Left := ButtonPanel[bidCancel].Width div 2 - ButtonLabel[bidCancel].Width div 2;  
ButtonLabel[bidCancel].Top := ButtonPanel[bidCancel].Height div 2 - ButtonLabel[bidCancel].Height div 2;  
ButtonLabel[bidDirBrowse].Left := ButtonPanel[bidDirBrowse].Width div 2 - ButtonLabel[bidDirBrowse].Width div 2;  
ButtonLabel[bidDirBrowse].Top := ButtonPanel[bidDirBrowse].Height div 2 - ButtonLabel[bidDirBrowse].Height div 2;  
ButtonLabel[bidGroupBrowse].Left := ButtonPanel[bidGroupBrowse].Width div 2 - ButtonLabel[bidGroupBrowse].Width div 2;  
ButtonLabel[bidGroupBrowse].Top := ButtonPanel[bidGroupBrowse].Height div 2 - ButtonLabel[bidGroupBrowse].Height div 2;  
 
if CurPageID = wpSelectDir then  
begin  
GetNeedSpaceCaption;  
end;  
end;  
 
//************************************************ [Конец - Текстуры кнопок] ***************************************************//  
 
//************************************************ [Начало - Панель] ***************************************************//  
 
Procedure InitializeWizard3();  
Var  
CurPageID: Integer;  
begin  
Welcome := TLabel.Create(WizardForm);  
Welcome.Top := ScaleY(103);  
Welcome.Left := ScaleX(16);  
Welcome.Caption := 'Приветствие';  
Welcome.Transparent := True;  
Welcome.Font.Size := 8;  
Welcome.Font.Name := 'Arial';  
Welcome.Font.Style:= [fsBold, fsItalic];  
 
 
Parameters := TLabel.Create(WizardForm);  
Parameters.Top := ScaleY(103);  
Parameters.Left := ScaleX(150);  
Parameters.Caption:= 'Параметры';  
Parameters.Transparent := True;  
Parameters.Font.Size := 8;  
Parameters.Font.Name := 'Arial';  
Parameters.Font.Style:= [fsBold, fsItalic];  
 
StartMenu := TLabel.Create(WizardForm);  
StartMenu.Top := ScaleY(103);  
StartMenu.Left := ScaleX(270);  
StartMenu.Caption := 'Меню "Пуск"';  
StartMenu.Transparent := True;  
StartMenu.Font.Size := 8;  
StartMenu.Font.Name := 'Arial';  
StartMenu.Font.Style:= [fsBold, fsItalic];  
 
Installing := TLabel.Create(WizardForm);  
Installing.Top := ScaleY(103);  
Installing.Left := ScaleX(412);  
Installing.Caption := 'Установка';  
Installing.Transparent := True;  
Installing.Font.Size := 8;  
Installing.Font.Name := 'Arial';  
Installing.Font.Style:= [fsBold, fsItalic];  
 
Finish := TLabel.Create(WizardForm);  
Finish.Left := 500;  
Finish.Top := ScaleY(103);  
Finish.Left := ScaleX(550);  
Finish.Caption := 'Завершение';  
Finish.Transparent := True;  
Finish.Font.Size := 8;  
Finish.Font.Name := 'Arial';  
Finish.Font.Style:= [fsBold, fsItalic];  
end;  
 
procedure CurPageChanged3(CurPageID: Integer);  
begin  
Welcome.Font.Color := -16777199;  
Parameters.Font.Color := -16777199;  
StartMenu.Font.Color := -16777199;  
Installing.Font.Color := -16777199;  
Finish.Font.Color := -16777199;  
 
if (CurPageID= wpWelcome)or(CurPageID= wpSelectDir)or (CurPageID= wpSelectProgramGroup)or(CurPageID= wpInstalling)or(CurPageID= wpFinished) then  
Welcome.Parent := DetectPage(CurPageID);  
Parameters.Parent := DetectPage(CurPageID);  
StartMenu.Parent := DetectPage(CurPageID);  
Installing.Parent := DetectPage(CurPageID);  
Finish.Parent := DetectPage(CurPageID);  
 
if CurPageID = wpWelcome then  
begin  
Welcome.Font.Color := clWhite;  
end;  
 
if CurPageID = wpSelectDir then  
begin  
Parameters.Font.Color := clWhite;  
end;  
 
if CurPageID = wpSelectProgramGroup then  
begin  
StartMenu.Font.Color := clWhite;  
end;  
 
if CurPageID = wpInstalling then  
begin  
Installing.Font.Color := clWhite;  
end;  
 
if CurPageID = wpFinished then  
begin  
Finish.Font.Color := clWhite;  
end;  
end;  
 
//************************************************ [Конец - Панель] ***************************************************//  
 
 
 
 
 
//************************************************ [Конец - Прогресс бар] ***************************************************//  
 
procedure CurPageChanged(CurPageID: Integer);  
begin  
 
CurPageChanged1(CurPageID);  
CurPageChanged2(CurPageID);  
CurPageChanged3(CurPageID);  
 
  if (CurPageID = wpFinished) and MyError then
  begin
    LabelTime3.Hide;
    WizardForm.Caption:= ExpandConstant('{cm:Error}');
    WizardForm.FinishedLabel.Font.Color:= clRed;
    WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
  end;
   
end;  
 
function CheckError:boolean;
begin
  result:= not MyError;
end;
 
procedure CurStepChanged(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:longword;
    tmp:integer;
begin
  if CurStep = ssInstall then begin  //Если необходимо, можно поменять на ssPostInstall
    WizardForm.ProgressGauge.Hide;
    WizardForm.CancelButton.Hide;
    ShowComponents;
    WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
    Cancel:=0;
 
// Распаковка всех необходимых файлов в папку {tmp}.
 
    ExtractTemporaryFile('facompress.dll'); //ускоряет распаковку .arc архивов.
//    ExtractTemporaryFile('arc.ini');
//    ExtractTemporaryFile('srep.exe');
 
#ifdef records
    ExtractTemporaryFile('records.inf');
#endif
#ifdef precomp04
    ExtractTemporaryFile('packjpg_dll.dll');
    ExtractTemporaryFile('RTconsole.exe');
    ExtractTemporaryFile('precomp04.exe');
#endif
#ifdef precomp038
    ExtractTemporaryFile('packjpg_dll.dll');
    ExtractTemporaryFile('RTconsole.exe');
    ExtractTemporaryFile('precomp038.exe');
    ExtractTemporaryFile('zlib1.dll');
#endif
#ifdef unrar
    ExtractTemporaryFile('Unrar.dll');
#endif
 
// Подготавливаем переменную, содержащую всю информацию о выделенных компонентах для ISDone.dll
// максимум 96 компонентов.
    Comps1:=0; Comps2:=0; Comps3:=0;
#ifdef Components
    TmpValue:=1;
    if IsComponentSelected('text\rus') then Comps1:=Comps1+TmpValue;     //компонент 1
    TmpValue:=TmpValue*2;
    if IsComponentSelected('text\eng') then Comps1:=Comps1+TmpValue;     //компонент 2
    TmpValue:=TmpValue*2;
    if IsComponentSelected('voice\rus') then Comps1:=Comps1+TmpValue;    //компонент 3
    TmpValue:=TmpValue*2;
    if IsComponentSelected('voice\eng') then Comps1:=Comps1+TmpValue;    //компонент 4
//    .....
#endif
 
#ifdef precomp04
    PCFVer:=0.4;
#else
#ifdef precomp038
    PCFVer:=0.38;
#else
    PCFVer:=0;
#endif
#endif
    repeat
      MyError:=true;
      if not ISDoneInitialize(ExpandConstant('{src}\records.inf'), $F777, Comps1,Comps2,Comps3, PCFVer, false, MainForm.Handle, {#NeedMem}, @ProgressCallback) then break;
      repeat
 
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\*.arc'), ExpandConstant('{app}'),  false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
 
//     далее находятся закомментированые примеры различных комбинаций параметров и функций распаковки
(*
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\Spider.arc'), ExpandConstant('{app}'),  false, '', '', ExpandConstant('{app}'), notPCFonFLY) then break;
        if not ISSRepExtract( 0, 0, ExpandConstant('{app}\data1024_1024.srep'),ExpandConstant('{app}\data1024.arc'), true                         ) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{app}\data1024.arc'), ExpandConstant('{app}'),  true, '', '', ExpandConstant('{app}'), notPCFonFLY) then break;
 
        if not IS7ZipExtract   ( 0, 0, ExpandConstant('{src}\data64.7z'),   ExpandConstant('{app}'),           false, ''                     ) then break;
        if not ISSRepExtract   ( 0, 0, ExpandConstant('{app}\data64a.srep'),ExpandConstant('{app}\data64.arc'), true                         ) then break;
        if not ISArcExtract    ( 0, 0, ExpandConstant('{app}\data64.arc'),  ExpandConstant('{app}\'),           true, '', '', '',notPCFonFLY ) then break;
        if not ISPrecompExtract( 0, 0, ExpandConstant('{app}\data.pcf'),    ExpandConstant('{app}\data.7z'),    true                         ) then break;
        if not IS7ZipExtract   ( 0, 0, ExpandConstant('{app}\data.7z'),     ExpandConstant('{app}\'),           true, ''                     ) then break;
 
        if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\CODMW_2.arc'),       ExpandConstant('{app}\data1'),            false, '', '', '', notPCFonFLY ) then break;
        if not ISSRepExtract   ( 0, 0, ExpandConstant('{app}\data1\CODMW2.srep'), ExpandConstant('{app}\data1\CODMW2.pcf'), true                           ) then break;
        if not ISPrecompExtract( 0, 0, ExpandConstant('{app}\data1\CODMW2.pcf'),  ExpandConstant('{app}\data1\CODMW2.7z'),  true                           ) then break;
        if not IS7ZipExtract   ( 0, 0, ExpandConstant('{app}\data1\CODMW2.7z'),   ExpandConstant('{app}\data1'),            true,  ''                      ) then break;
 
//  примеры использования компонентов и всплывающего запроса следующего диска:
 
        if not ShowChangeDiskWindow('Пожалуйста, вставьте диск 2 и дождитесь его инициализации.', ExpandConstant('{src}'),'CODMW2_Disk2.arc'               ) then break;
        if not ISArcExtract ( 1, 0, ExpandConstant('{src}\rustext.arc'),  ExpandConstant('{app}'), false, '', '', '', notPCFonFLY ) then break;
        if not ISArcExtract ( 2, 0, ExpandConstant('{src}\engtext.arc'),  ExpandConstant('{app}'), false, '', '', '', notPCFonFLY ) then break;
        if not ISArcExtract ( 3, 0, ExpandConstant('{src}\rusvoice.arc'), ExpandConstant('{app}'), false, '', '', '', notPCFonFLY ) then break;
        if not ISArcExtract ( 4, 0, ExpandConstant('{src}\engvoice.arc'), ExpandConstant('{app}'), false, '', '', '', notPCFonFLY ) then break;
        if not ShowChangeDiskWindow('Пожалуйста, вставьте первый диск и дождитесь его инициализации.', ExpandConstant('{src}'),'CODMW_2.arc'               ) then break;
 
//  просто различные комбинации параметров в функциях распаковки
 
        if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\sds_ru2.arc'), ExpandConstant('{app}\data1'),  false, '', '', ExpandConstant('{app}\data1'), PCFonFLY) then break;
        if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\sds_ru.arc'),  ExpandConstant('{app}\data1'),  false, '', '', ExpandConstant('{app}\data1'), PCFonFLY) then break;
 
        if not ISPrecompExtract( 0, 0, ExpandConstant('{src}\data1\*.pcf'),     ExpandConstant('{src}\data1'), false) then break;
        if not IS7ZipExtract   ( 0, 0, ExpandConstant('{src}\data1\sds_ru.7z'), ExpandConstant('{src}\data1'), true,  '') then break;
 
        if not ISRarExtract    ( 0, 0, ExpandConstant('{src}\data_*.rar'), ExpandConstant('{app}'), false, ''         ) then break;
        if not ISRarExtract    ( 0, 0, ExpandConstant('{src}\*part1.rar'), ExpandConstant('{app}'), false, 'Password' ) then break;
 
        if not IS7ZipExtract   ( 0, 0, ExpandConstant('{src}\data*.7z'), ExpandConstant('{app}\data1'), false, '' ) then break;
        if not IS7ZipExtract   ( 0, 0, ExpandConstant('{src}\sound.7z'), ExpandConstant('{app}\data1'), false, '' ) then break;
 
        if not ISArcExtract    ( 0, 33, ExpandConstant('{src}\dataR.arc'),   ExpandConstant('{app}\data1'),  false, '', '', '',notPCFonFLY) then break;
        if not ISArcExtract    ( 0, 33, ExpandConstant('{src}\CODMW_*.arc'), ExpandConstant('{app}\data1'),  false, '', '', '',notPCFonFLY) then break;
        if not ISArcExtract    ( 0, 34, ExpandConstant('{src}\dataR.arc'),   ExpandConstant('{app}\data1\'), false, '', '', '',notPCFonFLY) then break;
 
        if not ISPrecompExtract( 0, 0, ExpandConstant('{src}\*.pcf'),     ExpandConstant('{app}\data1'), false) then break;
        if not ISPrecompExtract( 0, 0, ExpandConstant('{src}\data0.pcf'), ExpandConstant('{app}\data1'), false) then break;
 
        if not ISSRepExtract   ( 0, 0, ExpandConstant('{src}\*.srep'),      ExpandConstant('{app}\data1\'),         false) then break;
        if not ISSRepExtract   ( 0, 0, ExpandConstant('{src}\data02.srep'), ExpandConstant('{app}\data1\data.pcf'), false) then break;
*)
        MyError:=false;
      until true;
      ISDoneStop;
    until true;
    HideComponents;
    WizardForm.CancelButton.Visible:=true;
    WizardForm.CancelButton.Enabled:=false;
  end;
  if (CurStep=ssPostInstall) and MyError then begin
    Exec(ExpandConstant('{uninstallexe}'), '/SILENT','', sw_Hide, ewWaitUntilTerminated, tmp);
  end;
end;
 
 
 
Procedure InitializeWizard();  
begin  
InitializeWizard1();  
InitializeWizard2();  
InitializeWizard3();  
CreateFolderImage();
end;
 
procedure DeinitializeSetup();
begin
  gdipShutdown;
end;

Всего записей: 855 | Зарегистр. 07-11-2009 | Отправлено: 12:06 15-08-2011 | Исправлено: YURSHAT, 12:13 15-08-2011
   

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

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


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

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

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru