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

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

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

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

   

Shegorat



Advanced Member
Редактировать | Профиль | Сообщение | ICQ | Цитировать | Сообщить модератору
#define NeedSize "5200150244"
 
;#define Components
 
#define records
#define precomp04
#define precomp038
#define unrar
 
[Setup]
AppName=Manhunt 2
AppVerName=Manhunt 2
DefaultDirName={pf}\Manhunt 2
OutputDir=.
OutputBaseFilename=Setup
Compression=lzma/ultra64
DefaultGroupName=Manhunt 2
WizardImageFile=WizardImage.bmp
WizardSmallImageFile=WizardSmallImage.bmp
SetupIconFile=Icon.ico
SolidCompression=yes
#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
#endif
 
[Run]
Filename: "{src}\Redist\DirectX\DXSETUP.exe"; StatusMsg: "{cm:dx1}";  Tasks: "directx"; Flags: waituntilterminated
Filename: "{src}\Redist\vcredist_x86.exe"; Parameters: "/q"; StatusMsg: "{cm:vc1}"; Tasks: "vc"; Flags: runhidden waituntilterminated ;
 
 
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
 
 
[Tasks]
Name: "icon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}";
Name: "directx"; Description: "{cm:dx}"; GroupDescription: "{cm:AdditionalTasks}"; Flags: unchecked
Name: "vc"; Description: "{cm:vc}"; GroupDescription: "{cm:AdditionalTasks}"; Flags: unchecked
 
 
[Files]
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\InnoCallback.dll; 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: "DirBitmap.bmp"; DestDir: "{tmp}"; Flags: dontcopy
Source: "GroupBitmap.bmp"; DestDir: "{tmp}"; Flags: dontcopy
Source: "1.bmp"; DestDir: "{tmp}"; Flags: dontcopy
Source: "button.bmp"; DestDir: "{tmp}"; Flags: dontcopy
Source: "1.bmp"; DestDir: "{app}"; Attribs: hidden system;
Source: "WizardSmallImage.bmp"; DestDir: "{app}"; Attribs: hidden system;
 
[CustomMessages]
russian.ExtractedFile=                    Идёт распаковка игровых архивов,пожалуйста ждите...
russian.CancelButton=Отменить распаковку
russian.Error=Ошибка распаковки!
russian.FinishedLabel=Программа {#SetupSetting("AppName")} установлена на Ваш компьютер. Приложение можно запустить с помощью соответствующего значка.%n%nНажмите «Завершить», чтобы выйти из программы установки.
russian.AdditionalTasks=Системные задачи:
russian.dx=Обновить Microsoft DirectX (Требуется интернет соединение)
russian.vc=Установить Microsoft Visual C++ 2005 SP1 Redist
russian.gfwl=Установить Games For Windows LIVE v3.0
russian.PhysX= Установить NVIDIA PhysX System Software
russian.dx1=Обновление DirectX...
russian.vc1=Установка Microsoft Visual C++ 2005 SP1 Redist...
russian.gfwl1=Установка Games For Windows LIVE...
russian.PhysX1=Установка PhysX...
 
[Icons]
Name: "{group}\Manhunt 2"; Filename: "{app}\Manhunt2R.exe" ; WorkingDir: {app}  ;IconFilename: "{app}\manhunt2.ico"
Name: "{group}\Удалить игру"; Filename: "{uninstallexe}"
Name: "{commondesktop}\Manhunt 2"; Filename: "{app}\Manhunt2R.exe"; Tasks: icon ; WorkingDir: {app}    ;IconFilename: "{app}\manhunt2.ico"
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Manhunt 2"; Filename: "{app}\Manhunt2R.exe"; Tasks: quicklaunchicon   ; WorkingDir: {app} ; IconFilename: "{app}\manhunt2.ico"
 
[UninstallDelete]
Type: filesandordirs; Name: {app}
 
[Code]
type
  TCallback = function (Pct: integer;CurrentFile:string): longword;
  TMessage = record hWnd: HWND; msg, wParam: Word; lParam: LongWord; Time: TFileTime; pt: TPoint; end;
 
 PDisplay_Device = record
  cb: DWord;
  DeviceName: array [0..31] of char;
  DeviceString: array [0..127] of char;
  StateFlags: DWord;
  DeviceID, DeviceKey: array [0..127] of char;
 end;
 
 TMixerCaps = record
  vPid, vDriverVersion: DWord;
  sName: array [0..31] of char;
  Support, cDestinations: DWord;
 end;
 
// Проверка версии Windows
#if Pos("4.", GetFileVersion(AddBackslash(GetEnv("windir")) + "Explorer.exe")) == 1
    {Win9x}
   TMemoryStatusEx = record
    dwLength, dwMemoryLoad: DWord;
    LoTotalPhys, LoAvailPhys, LoTotalPageFile, LoAvailPageFile,
    LoTotalVirtual, LoAvailVirtual, LoAvailExtendedVirtual, HiTotalPhys,
    HiAvailPhys, HiTotalPageFile, HiAvailPageFile, HiTotalVirtual, HiAvailVirtual,
    HiAvailExtendedVirtual: Integer;
   end;
  function GlobalMemoryStatusEx(var lpBuffer: TMemoryStatusEx): Boolean;
   external 'GlobalMemoryStatus@kernel32.dll stdcall';
#else
    {WinNT}
   TMemoryStatusEx = record
    dwLength, dwMemoryLoad: DWord;
    LoTotalPhys, HiTotalPhys, LoAvailPhys, HiAvailPhys,
    LoTotalPageFile, HiTotalPageFile, LoAvailPageFile, HiAvailPageFile,
    LoTotalVirtual, HiTotalVirtual, LoAvailVirtual, HiAvailVirtual, LoAvailExtendedVirtual,
    HiAvailExtendedVirtual: Integer;
   end;
  function GlobalMemoryStatusEx(var lpBuffer: TMemoryStatusEx): Boolean;
   external 'GlobalMemoryStatusEx@kernel32.dll stdcall';
#endif
 
var
  LabelPct,LabelCurrFileName: TLabel;
  ISDoneProgressBar: TNewProgressBar;
  MyCancelButton: TButton;
  OveralPct,Cancel:integer;
  CallBack:longword;
  MyError:boolean;
 
  LogoImage: TBitmapImage;
 
  ButtonPanel: array [0..4] of TPanel;
  ButtonImage: array [0..4] of TBitmapImage;
  ButtonLabel: array [0..4] of TLabel;
 
  StatusLabel, FileNameLabel, ExtractFile, StatusInfo, FinishedLabel: TLabel;
  FreeMB, TotalMB: Cardinal;
  Texture2, Texture: TBitmapImage;
 
  InfoPage: TWizardPage;
  TopText, BottomText: TNewStaticText;
  ChangeText: Boolean;
  SystemPanel, ProcessorPanel, VideoPanel,
  AudioPanel, RAMPanel, PageFilePanel: TMemo;
  SystemVersionPanel, ProcessorMHzPanel, VideoRAMPanel,
  AudioNamePanel, RAMTotalPanel, PageFileTotalPanel: TMemo;
  lpCaps: TMixerCaps;
  Version: TWindowsVersion;
  MemoryEx: TMemoryStatusEx;
  n, errCode: Integer;
  Keys: TArrayOfString;
  DeviceValue: Cardinal;
  lpDisplayDevice: PDisplay_Device;
 
const
  Color = clBlack;
  ButtonWidth = 80;
  ButtonHeight = 23;
 
  bidBack = 0;
  bidNext = 1;
  bidCancel = 2;
  bidDirBrowse = 3;
  bidGroupBrowse = 4;
 
  DISPLAY_DEVICE_PRIMARY_DEVICE = 4;
  oneMB = 1024*1024;
  NeedMHz = 1800;
  NeedVideoRAM = 128;
  NeedSoundCard = 'Creative X-Fi';
  NeedMB = 512;
  NeedPageFile = 1024;
   
function GetSystemMetrics(nIndex: Integer): Integer; external 'GetSystemMetrics@user32.dll stdcall';
function GetDeviceCaps(hDC, nIndex: Integer): Integer; external 'GetDeviceCaps@GDI32 stdcall';
function CreateDC(lpDriverName, lpDeviceName, lpOutput: String; lpInitData: Integer): Integer; external 'CreateDCA@GDI32 stdcall';
function EnumDisplayDevices(lpDevice, iDevNum: DWord; var lpDisplayDevice: PDisplay_Device; dwFlags: DWord): Boolean; external 'EnumDisplayDevicesA@user32.dll stdcall';
function mixerGetDevCaps(uDeviceID: LongInt; var lpCaps: TMixerCaps; uSize: LongInt): LongInt; external 'mixerGetDevCapsA@winmm.dll stdcall';
function mixerGetNumDevs: Integer; external 'mixerGetNumDevs@winmm.dll stdcall';
 
function PeekMessage(var lpMsg: TMessage; hWnd: HWND; wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; external 'PeekMessageA@user32.dll stdcall';
function TranslateMessage(const lpMsg: TMessage): BOOL; external 'TranslateMessage@user32.dll stdcall';
function DispatchMessage(const lpMsg: TMessage): Longint; external 'DispatchMessageA@user32.dll stdcall';
 
function WrapMyCallback(callback:TCallback; paramcount:integer):longword;external 'wrapcallback@files:innocallback.dll stdcall';
 
function ISArcExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; callback: longword; Password, CfgFile, WorkPath: AnsiString):BOOL; external 'ISArcExtract@files:ISDone.dll stdcall';
function IS7ZipExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; callback: longword; Password: AnsiString):BOOL; external 'IS7zipExtract@files:ISDone.dll stdcall';
function ISRarExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; callback: longword; Password: AnsiString):BOOL; external 'ISRarExtract@files:ISDone.dll stdcall';
function ISPrecompExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean; callback: longword):BOOL; external 'ISPrecompExtract@files:ISDone.dll stdcall';
function ISSRepExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutFile, IdxFile: AnsiString; DeleteInFile:boolean; callback: longword):BOOL; external 'ISSrepExtract@files:ISDone.dll stdcall';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):BOOL; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall';
function StartRecord(RecordFileName:AnsiString; AllComponents:longword):BOOL; external 'StartRecord@files:ISDone.dll stdcall';
function CheckPoint(CurComponent:Integer):BOOL; external 'CheckPoint@files:ISDone.dll stdcall';
function StopRecord:BOOL; external 'StopRecord@files:ISDone.dll stdcall';
 
function ProgressCallback(Pct: integer; CurrentFile:AnsiString): longword;
var  Msg: TMessage;
begin
   if Pct<=ISDoneProgressBar.Max then
      ISDoneProgressBar.Position := Pct;
   LabelPct.Caption := IntToStr(Pct div 10)+'.'+chr(48 + Pct mod 10)+'%';
   LabelCurrFileName.Caption :=ExpandConstant('{cm:ExtractedFile} ');
   while PeekMessage(Msg, 0, 0, 0, 1) do begin
      TranslateMessage(Msg);
      DispatchMessage(Msg);
   end;
   Result := Cancel;
end;
 
procedure CancelButtonOnClick(Sender: TObject);
begin
   if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then Cancel:=1;
end;
 
procedure RepaintInstall();
begin
  ExtractTemporaryFile('button.bmp')
  ExtractTemporaryFile('DirBitmap.bmp');
  ExtractTemporaryFile('GroupBitmap.bmp');
  ExtractTemporaryFile('1.bmp');
 
  WizardForm.WizardBitmapImage.Width := ScaleX(497);
  WizardForm.WizardBitmapImage2.Width := ScaleX(497);
  WizardForm.PageNameLabel.Width:=ScaleX(300);
  WizardForm.PageDescriptionLabel.Hide;
 
  WizardForm.Font.Color:=clWhite;
 
  WizardForm.Color:=Color;
  WizardForm.WelcomePage.Color:=Color;
  WizardForm.InnerPage.Color:=Color;
  WizardForm.FinishedPage.Color:=Color;
  WizardForm.SelectDirPage.Color:=Color;
  WizardForm.SelectComponentsPage.Color:=Color;
  WizardForm.SelectProgramGroupPage.Color:=Color;
  WizardForm.SelectTasksPage.Color:=Color;
  WizardForm.ReadyPage.Color:=Color;
  WizardForm.InstallingPage.Color:=Color;
 
  WizardForm.PageNameLabel.Color:=Color;
  WizardForm.PageNameLabel.Font.Color:=ClWhite;
  WizardForm.MainPanel.Color:=Color;
 
  WizardForm.WelcomeLabel1.Hide;
  WizardForm.WelcomeLabel2.Hide;
 
  WizardForm.SelectDirLabel.Color:=Color;
  WizardForm.SelectDirBrowseLabel.Color:=Color;
  WizardForm.DirEdit.Color:=Color;
  WizardForm.DiskSpaceLabel.Color:=Color;
 
  WizardForm.ComponentsList.Color:=Color;
  WizardForm.SelectComponentsLabel.Color:=Color;
  WizardForm.TypesCombo.Hide;
  WizardForm.ComponentsDiskSpaceLabel.Hide;
 
  WizardForm.GroupEdit.Color:=Color;
  WizardForm.SelectStartMenuFolderLabel.Color:=Color;
  WizardForm.SelectStartMenuFolderBrowseLabel.Color:=Color;
 
  WizardForm.SelectTasksLabel.Color:=Color;
  WizardForm.TasksList.Color:=Color;
 
  WizardForm.ReadyMemo.Color:=Color;
  WizardForm.ReadyMemo.ScrollBars:= ssNone
  WizardForm.ReadyLabel.Color:=Color;
 
  WizardForm.StatusLabel.Color:=Color;
  WizardForm.FilenameLabel.Color:=Color;
 
  WizardForm.FinishedHeadingLabel.Hide;
  WizardForm.FinishedLabel.Hide;
 
  WizardForm.SelectDirBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\DirBitmap.bmp'));
  WizardForm.SelectDirBitmapImage.AutoSize:=true;
 
  WizardForm.SelectGroupBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\GroupBitmap.bmp'));
  WizardForm.SelectGroupBitmapImage.AutoSize:=true;
 
  LogoImage := TBitmapImage.Create(WizardForm);
  with LogoImage do
  begin
    SetBounds(ScaleX(10), ScaleY(320), ScaleX(175), ScaleY(40));
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
    Parent := WizardForm;
  end;
 
  with WizardForm.WizardSmallBitmapImage do
  begin
    SetBounds(ScaleX(335), ScaleY(2), ScaleX(160), ScaleY(50));
  end;
 
  with WizardForm.ComponentsList do
  begin
    Top:=ScaleY(55);
    Height:=ScaleY(150);
  end;
 
  with TLabel.Create(WizardForm) do begin
    AutoSize:=WizardForm.WelcomeLabel1.AutoSize;
    Left:=WizardForm.WelcomeLabel1.Left;
    Top:=WizardForm.WelcomeLabel1.Top
    Width:=WizardForm.WelcomeLabel1.Width
    Height:=WizardForm.WelcomeLabel1.Height
    WordWrap:=WizardForm.WelcomeLabel1.WordWrap;
    Font.Name:=WizardForm.WelcomeLabel1.Font.Name;
    Font.Size:=WizardForm.WelcomeLabel1.Font.Size;
    Font.Color:=clWhite;
    Font.Style:=WizardForm.WelcomeLabel1.Font.Style;
    Caption:=WizardForm.WelcomeLabel1.Caption;
    Parent:=WizardForm.WelcomeLabel1.Parent
    Transparent:=True
  end;
 
   with TLabel.Create(WizardForm) do begin
    AutoSize:=WizardForm.WelcomeLabel2.AutoSize;
    Left:=WizardForm.WelcomeLabel2.Left;
    Top:=WizardForm.WelcomeLabel2.Top
    Width:=WizardForm.WelcomeLabel2.Width
    Height:=WizardForm.WelcomeLabel2.Height
    WordWrap:=WizardForm.WelcomeLabel2.WordWrap;
    Font.Name:=WizardForm.WelcomeLabel2.Font.Name;
    Font.Size:=WizardForm.WelcomeLabel2.Font.Size;
    Font.Color:=clWhite;
    Font.Style:=WizardForm.WelcomeLabel2.Font.Style;
    Caption:=WizardForm.WelcomeLabel2.Caption;
    Parent:=WizardForm.WelcomeLabel2.Parent
    Transparent:=True
  end;
 
  with TLabel.Create(WizardForm) do begin
    AutoSize:=WizardForm.FinishedHeadingLabel.AutoSize;
    Left:=WizardForm.FinishedHeadingLabel.Left;
    Top:=WizardForm.FinishedHeadingLabel.Top
    Width:=WizardForm.FinishedHeadingLabel.Width
    Height:=WizardForm.FinishedHeadingLabel.Height
    WordWrap:=WizardForm.FinishedHeadingLabel.WordWrap;
    Font.Name:=WizardForm.FinishedHeadingLabel.Font.Name;
    Font.Size:=WizardForm.FinishedHeadingLabel.Font.Size;
    Font.Color:=clWhite;
    Font.Style:=WizardForm.FinishedHeadingLabel.Font.Style;
    Caption:=WizardForm.FinishedHeadingLabel.Caption;
    Parent:=WizardForm.FinishedHeadingLabel.Parent
    Transparent:=True
  end;
 
  FinishedLabel:= TLabel.Create(WizardForm)
  with FinishedLabel do begin
    AutoSize:=WizardForm.FinishedLabel.AutoSize;
    Left:=WizardForm.FinishedLabel.Left;
    Top:=WizardForm.FinishedLabel.Top
    Width:=WizardForm.FinishedLabel.Width;
    Height:=WizardForm.FinishedLabel.Height+50;
    WordWrap:=WizardForm.FinishedLabel.WordWrap;
    Font.Name:=WizardForm.FinishedLabel.Font.Name;
    Font.Size:=WizardForm.FinishedLabel.Font.Size;
    Font.Color:=clWhite;
    Font.Style:=WizardForm.FinishedLabel.Font.Style;
    Caption:=ExpandConstant('{cm:FinishedLabel}');
    Parent:=WizardForm.FinishedLabel.Parent
    Transparent:=True
  end;
end;
 
procedure InitializeUninstallProgressForm;
begin
  FileCopy(ExpandConstant('{app}\WizardSmallImage.bmp'), ExpandConstant('{tmp}\WizardSmallImage.bmp'), False);
  FileCopy(ExpandConstant('{app}\1.bmp'), ExpandConstant('{tmp}\1.bmp'), False);
 
  UninstallProgressForm.Color:=Color;
  UninstallProgressForm.InnerPage.Color:=Color;
  UninstallProgressForm.MainPanel.Color:=Color;
  UninstallProgressForm.PageNameLabel.Color:=Color;
  UninstallProgressForm.PageDescriptionLabel.Hide;
  UninstallProgressForm.PageNameLabel.Font.Color:=clWhite;
  UninstallProgressForm.PageNameLabel.Width:=ScaleX(300);
  UninstallProgressForm.StatusLabel.Color:=Color;
  UninstallProgressForm.StatusLabel.Font.Color:=clWhite;
 
  LogoImage := TBitmapImage.Create(UninstallProgressForm);
  with LogoImage do
  begin
    SetBounds(ScaleX(10), ScaleY(320), ScaleX(175), ScaleY(40));
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
    Parent := UninstallProgressForm;
  end;
 
  with UninstallProgressForm.WizardSmallBitmapImage do
  begin
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardSmallImage.bmp'));
    SetBounds(ScaleX(335), ScaleY(2), ScaleX(160), ScaleY(50));
  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:=-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:=160
  Image.Height:=23
  Image.Enabled:=False
  Image.Bitmap.LoadFromFile(ExpandConstant('{tmp}\button.bmp'))
  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.Left:=23
  Labl.Top:=5
  Labl.Autosize:=True
  Labl.Alignment:=taCenter
  Labl.Tag:=AButtonIndex
  Labl.Transparent:=True
  Labl.Font.Color:=clWhite
  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 LicenceAcceptedRadioOnClick(Sender: TObject);
begin
  ButtonLabel[bidNext].Enabled:=True
end;
 
procedure LicenceNotAcceptedRadioOnClick(Sender: TObject);
begin
  ButtonLabel[bidNext].Enabled:=False
end;
 
procedure UpdateButtons(CurPageID: Integer);
begin
  UpdateButton(WizardForm.BackButton,bidBack)
  UpdateButton(WizardForm.NextButton,bidNext)
  UpdateButton(WizardForm.CancelButton,bidCancel)
  ButtonLabel[bidBack].Left := (ButtonPanel[bidBack].Width / 2 - ButtonLabel[bidBack].Width / 2);
  ButtonLabel[bidNext].Left := (ButtonPanel[bidNext].Width / 2 - ButtonLabel[bidNext].Width / 2);
  ButtonLabel[bidCancel].Left := (ButtonPanel[bidCancel].Width / 2 - ButtonLabel[bidCancel].Width / 2);
  ButtonLabel[bidDirBrowse].Left := (ButtonPanel[bidDirBrowse].Width / 2 - ButtonLabel[bidDirBrowse].Width / 2);
  ButtonLabel[bidGroupBrowse].Left := (ButtonPanel[bidGroupBrowse].Width / 2 - ButtonLabel[bidGroupBrowse].Width / 2);
end;
 
procedure ButtonTextures();
begin
  WizardForm.BackButton.Width:=ButtonWidth
  WizardForm.BackButton.Height:=ButtonHeight
 
  WizardForm.NextButton.Width:=ButtonWidth
  WizardForm.NextButton.Height:=ButtonHeight
 
  WizardForm.CancelButton.Width:=ButtonWidth
  WizardForm.CancelButton.Height:=ButtonHeight
 
  WizardForm.DirBrowseButton.Left:=337
  WizardForm.DirBrowseButton.Width:=ButtonWidth
  WizardForm.DirBrowseButton.Height:=ButtonHeight
 
  WizardForm.GroupBrowseButton.Left:=337
  WizardForm.GroupBrowseButton.Width:=ButtonWidth
  WizardForm.GroupBrowseButton.Height:=ButtonHeight
 
  WizardForm.LicenseAcceptedRadio.OnClick:=@LicenceAcceptedRadioOnClick
 
  WizardForm.LicenseNotAcceptedRadio.OnClick:=@LicenceNotAcceptedRadioOnClick
 
  LoadButtonImage(WizardForm.BackButton,bidBack)
  LoadButtonImage(WizardForm.NextButton,bidNext)
  LoadButtonImage(WizardForm.CancelButton,bidCancel)
  LoadButtonImage(WizardForm.DirBrowseButton,bidDirBrowse)
  LoadButtonImage(WizardForm.GroupBrowseButton,bidGroupBrowse)
end;
 
// Дополнить число до кратного Multiple
function ToMultiple(Bytes, Multiple: Integer): Integer;
begin
  if Abs(Bytes/Multiple) > Bytes/Multiple then
     Result := (Bytes/Multiple + 1)*Multiple
  else
     Result := Bytes
end;
 
// Перевод числа в значение Бт/Кб/Мб/Гб/Тб (до 3х знаков после запятой)
function ByteOrTB(Bytes: Extended; noMB: Boolean): String;
begin
 if not noMB then
    Result := FloatToStr(Int(Bytes)) + ' Мб'
 else
        if Bytes < 1024 then
       Result := FloatToStr(Int(Bytes)) + ' Бт'
    else
             if Bytes/1024 < 1024 then
          Result := FloatToStr(round((Bytes/1024)*10)/10) + ' Кб'
       else
                    if Bytes/oneMB < 1024 then
             Result := FloatToStr(round(Bytes/oneMB*100)/100) + ' Мб'
          else
             if Bytes/oneMB/1000 < 1024 then
                Result := FloatToStr(round(Bytes/oneMB/1024*1000)/1000) + ' Гб'
             else
                              Result := FloatToStr(round(Bytes/oneMB/oneMB*1000)/1000) + ' Тб'
 StringChange(Result, ',', '.')
end;
 
// Удаление начальных, конечных и повторных пробелов
function DelSp(String: String): String;
begin
 while (Pos('  ', String) > 0) do Delete(String, Pos('  ', String), 1)
 Result := Trim(String)
end;
 
function Size64(Hi, Lo: Integer): Extended;
begin
 Result := Lo
 if Lo < 0 then
    Result := Result + $7FFFFFFF + $7FFFFFFF + 2
 for Hi := Hi-1 downto 0 do Result := Result + $7FFFFFFF + $7FFFFFFF + 2
end;
 
function CheckCPU(NeedMHz: Integer): Boolean;
var
  String: String;
begin
    String := 'Hardware\Description\System\CentralProcessor'; RegGetSubkeyNames(HKLM, String, Keys)     // Количество ядер
    for n := 0 to GetArrayLength(Keys)-1 do
      RegQueryStringValue(HKLM, String + '\' + Keys[n], 'ProcessorNameString', Keys[n])
    if not RegQueryDWordValue(HKLM, String + '\0', '~MHz', DeviceValue) or (DeviceValue < NeedMHz) then
         Exit
  else
     Result := True
end;
 
function CheckMemorySize(NeedRAM: Integer): Boolean;
begin
    MemoryEx.dwLength := SizeOf(MemoryEx)
    if not GlobalMemoryStatusEx(MemoryEx) then
         MsgBox('Ошибка функции:' + #13 + 'GlobalMemoryStatusEx', mbError, mb_Ok)
  else
       if (ToMultiple(trunc(Size64(MemoryEx.HiTotalPhys, MemoryEx.LoTotalPhys)/oneMB), 16) < NeedRAM) then
         Exit
     else
         Result := True
end;
 
procedure CreateCheckForm();
begin
 
  TopText := TNewStaticText.Create(InfoPage)
  with TopText do
  begin
    Parent := InfoPage.Surface
    Left := 0
    AutoSize := True
  end
 
  BottomText := TNewStaticText.Create(InfoPage)
  with BottomText do
  begin
    Parent := InfoPage.Surface
    Caption := 'Когда Вы будете готовы продолжить установку, нажмите «Далее».'
    Font.Color := clWhite
    Left := 0
    Top := 200
    AutoSize := True
  end
 
  SystemPanel := TMemo.Create(InfoPage)
  with SystemPanel do
  begin
    Text := 'Система'
    Alignment := taCenter
    Parent := InfoPage.Surface
    Left := ScaleX(0)
    Top := ScaleY(33)
    Width := ScaleX(100)
    Height := ScaleY(22)
    ReadOnly := True
    Font.Color:= ClBlack
    Color := $EEEEEE
  end
 
  SystemVersionPanel := TMemo.Create(InfoPage)
  with SystemVersionPanel do
  begin
    Alignment := taLeftJustify
    Parent := InfoPage.Surface
    Left := ScaleX(104)
    Top := SystemPanel.Top
    Width := ScaleX(310)
    Height := ScaleY(22)
    Font.Color:= ClBlack
    ReadOnly := True
   end
 
  ProcessorPanel := TMemo.Create(InfoPage)
  with ProcessorPanel do
  begin
    Text := 'Процессор'
    Alignment := taCenter
    Parent := InfoPage.Surface
    Left := ScaleX(0)
    Top := SystemPanel.Top + 27
    Width := ScaleX(100)
    Height := ScaleY(22)
    ReadOnly := True
    Font.Color:= ClBlack
    Color := $EEEEEE
  end
 
  ProcessorMHzPanel := TMemo.Create(InfoPage)
  with ProcessorMHzPanel do
  begin
    Alignment := taLeftJustify
    Parent := InfoPage.Surface
    Left := ScaleX(104)
    Top := ProcessorPanel.Top
    Width := ScaleX(310)
    Height := ScaleY(22)
    Font.Color:= ClBlack
    ReadOnly := True
  end
 
  VideoPanel := TMemo.Create(InfoPage)
  with VideoPanel do
  begin
    Text := 'Видеоадаптер'
    Alignment := taCenter
    Parent := InfoPage.Surface
    Left := ScaleX(0)
    Top := ProcessorPanel.Top + 27
    Width := ScaleX(100)
    Height := ScaleY(22)
    ReadOnly := True
    Font.Color:= ClBlack
    Color := $EEEEEE
  end
 
  VideoRAMPanel := TMemo.Create(InfoPage)
  with VideoRAMPanel do
  begin
    Alignment := taLeftJustify
    Parent := InfoPage.Surface
    Left := ScaleX(104)
    Top := VideoPanel.Top
    Width := ScaleX(310)
    Height := ScaleY(22)
    Font.Color:= ClBlack
    ReadOnly := True
  end
 
  AudioPanel := TMemo.Create(InfoPage)
  with AudioPanel do
  begin
    Text := 'Звуковая карта'
    Alignment := taCenter
    Parent := InfoPage.Surface
    Left := ScaleX(0)
    Top := VideoPanel.Top + 27
    Width := ScaleX(100)
    Height := ScaleY(22)
    ReadOnly := True
    Font.Color:= ClBlack
    Color := $EEEEEE
  end
 
  AudioNamePanel := TMemo.Create(InfoPage)
  with AudioNamePanel do
  begin
    Alignment := taLeftJustify
    Parent := InfoPage.Surface
    Left := ScaleX(104)
    Top := AudioPanel.Top
    Width := ScaleX(310)
    Height := ScaleY(22)
    Font.Color:= ClBlack
    ReadOnly := True
  end
 
  RAMPanel := TMemo.Create(InfoPage)
  with RAMPanel do
  begin
    Text := 'Объём памяти'
    Alignment := taCenter
    Parent := InfoPage.Surface
    Left := ScaleX(0)
    Top := AudioPanel.Top + 27
    Width := ScaleX(100)
    Height := ScaleY(22)
    ReadOnly := True
    Font.Color:= ClBlack
    Color := $EEEEEE
  end
 
  RAMTotalPanel := TMemo.Create(InfoPage)
  with RAMTotalPanel do
  begin
    Alignment := taLeftJustify
    Parent := InfoPage.Surface
    Left := ScaleX(104)
    Top := RAMPanel.Top
    Width := ScaleX(310)
    Height := ScaleY(22)
    Font.Color:= ClBlack
    ReadOnly := True
  end
 
  PageFilePanel := TMemo.Create(InfoPage)
  with PageFilePanel do
  begin
    Text := 'Файл подкачки'
    Alignment := taCenter
    Parent := InfoPage.Surface
    Left := ScaleX(0)
    Top := RAMPanel.Top + 27
    Width := ScaleX(100)
    Height := ScaleY(22)
    ReadOnly := True
    Font.Color:= ClBlack
    Color := $EEEEEE
  end;
 
  PageFileTotalPanel := TMemo.Create(InfoPage)
  with PageFileTotalPanel do
  begin
    Alignment := taLeftJustify
    Parent := InfoPage.Surface
    Left := ScaleX(104)
    Top := PageFilePanel.Top
    Width := ScaleX(310)
    Height := ScaleY(22)
    Font.Color:= ClBlack
    ReadOnly := True
  end
 
end;
 
procedure UpdateInfo();
var
  DeviceName, DeviceKey: String;
begin
  ChangeText := False
 
  GetWindowsVersionEx(Version)
 
  // Операционная система:
  SystemVersionPanel.Color := $CCFFCC
 
  DeviceKey := 'Software\Microsoft\Windows NT\CurrentVersion'
  if not UsingWinNT then StringChange(DeviceKey, 'Windows NT', 'Windows')
    RegQueryStringValue(HKLM, DeviceKey, 'ProductName', DeviceName)
  if RegQueryStringValue(HKLM, DeviceKey, 'CSDVersion', DeviceKey) then
     DeviceName := DeviceName + ' ' + DeviceKey
    StringChange(DeviceName, 'Microsoft ', '')
  SystemVersionPanel.Text := ' ' + DeviceName + ' сборка ' + IntToStr(Version.Major) + '.' + IntToStr(Version.Minor) +
                             '.' + IntToStr(Version.Build)
 
  if (Pos('2000 Service Pack 4', SystemVersionPanel.Text) = 0) and  // Windows 2000 SP4
     (Pos('XP Service Pack 2', SystemVersionPanel.Text) = 0) and  // Windows XP SP2
     (Pos('Vista', SystemVersionPanel.Text) = 0) then  // Windows Vista (c любым SP или без него)
     begin
      SystemVersionPanel.Color := $CCCCFF
      ChangeText := True
     end
 
  // Процессор:
  ProcessorMHzPanel.Color := $CCFFCC
 
  if not CheckCPU(NeedMHz) then
     begin
       ProcessorMHzPanel.Color := $CCCCFF
       ChangeText := True
     end
 
  ProcessorMHzPanel.Text := ' ' + DelSp(Keys[0]) + ' @' + IntToStr(DeviceValue) + ' MHz'
  if GetArrayLength(Keys) > 1 then
     ProcessorPanel.Text := 'Процессоры' // + ' (' + IntToStr(GetArrayLength(Keys)) + ')'
 
  // Видеокарта:
  VideoRAMPanel.Color := $CCFFCC
 
  lpDisplayDevice.cb := SizeOf(lpDisplayDevice)
  DeviceKey := ''
    n := 0
  while not (EnumDisplayDevices(0, n, lpDisplayDevice, 0) and
            (lpDisplayDevice.StateFlags and DISPLAY_DEVICE_PRIMARY_DEVICE > 0)) and (n < 127) do n := n + 1
    for n := 0 to 127 do DeviceKey := DeviceKey + lpDisplayDevice.DeviceKey[n]
  Delete(DeviceKey, Pos(Chr(0), DeviceKey), 127)  // Ключ драйвера получаем из API
    StringChange(DeviceKey, '\Registry\Machine\', '')
  errCode := 1
  DeviceValue := 0
  if RegQueryBinaryValue(HKLM, DeviceKey, 'HardwareInformation.MemorySize', DeviceName) then
         for n := 1 to Length(DeviceName) do
       begin
         DeviceValue := DeviceValue + Ord(DeviceName[n])*errCode
         errCode := errCode*$100
       end
  else
     if RegQueryDWordValue(HKLM, DeviceKey, 'HardwareInformation.MemorySize', DeviceValue) then
     else
        RegQueryDWordValue(HKLM, DeviceKey + '\Info', 'VideoMemory', DeviceValue)
    DeviceName := ''
  for n := 0 to 127 do DeviceName := DeviceName + lpDisplayDevice.DeviceString[n]
  Delete(DeviceName, Pos(Chr(0), DeviceName), 127)
 
  if DeviceName <> '' then
    if DeviceValue > 0 then
      VideoRAMPanel.Text := ' ' + DelSp(DeviceName) + ', '+ ByteOrTB(DeviceValue/oneMB, False)
    else
      VideoRAMPanel.Text := ' ' + DelSp(DeviceName) + ' (Standard), '+ ByteOrTB(DeviceValue/oneMB, False)
  else
     begin
      VideoRAMPanel.Text := ' Драйвер устройства не обнаружен'
      VideoRAMPanel.Color := $CCCCFF
      ChangeText := True
     end
  if (DeviceValue/oneMB < NeedVideoRAM) then
     begin
       VideoRAMPanel.Color := $CCCCFF
       ChangeText := True
     end
  VideoRAMPanel.Text := VideoRAMPanel.Text + ', ' + IntToStr(GetSystemMetrics(0)) + 'x' +
                        IntToStr(GetSystemMetrics(1)) + ' (' + IntToStr(GetDeviceCaps(CreateDC('DISPLAY','','',0),14) *
                        GetDeviceCaps(CreateDC('DISPLAY','','',0),12)) + ' bit)'
 
  // Звуковая карта:
  AudioNamePanel.Color := $CCFFCC
 
  // for errCode := 0 to 1 do  // Вывод основного звукового устройства
  for errCode := 0 to mixerGetNumDevs do
    begin
          mixerGetDevCaps(errCode-1, lpCaps, SizeOf(lpCaps))
      DeviceName := ' '
          for n := 0 to 31 do DeviceName := DeviceName + lpCaps.sName[n]
      Delete(DeviceName, Pos(Chr(0), DeviceName), 31)
      Delete(DeviceName, Pos(' [', DeviceName), 31)
      StringChange(DeviceName, 'SB ', 'Creative ')
      Delete(DeviceName, Pos(' Audio', DeviceName), 31)
          SetArrayLength(Keys, errCode)
      if errCode > 0 then Keys[errCode-1] := DeviceName
    end
 
    if GetArrayLength(Keys) > 1 then
    begin
     AudioPanel.Text := 'Звуковые карты'
     // AudioPanel.Text := 'Звуковые карты (' + IntToStr(GetArrayLength(Keys)) +')'
     AudioNamePanel.Text := ''
     for n := 1 to GetArrayLength(Keys) do
         AudioNamePanel.Text := AudioNamePanel.Text + Keys[n-1]  // + '(' + IntToStr(n) + ')'
    end
   else
    if GetArrayLength(Keys) = 0 then
     begin
      AudioNamePanel.Text := ' Драйвер устройства не обнаружен'
      AudioNamePanel.Color := $CCCCFF
      ChangeText := True
     end
      else
       AudioNamePanel.Text := Keys[0]
  if Pos(NeedSoundCard, AudioNamePanel.Text) = 0 then
     AudioNamePanel.Text := AudioNamePanel.Text + ' (рекомендуется ' + NeedSoundCard + ')'
 
  // Объём памяти:
    RAMTotalPanel.Color := $CCFFCC
  if not CheckMemorySize(NeedMB) then
    begin
      RAMTotalPanel.Color := $CCCCFF
      ChangeText := True
    end
  RAMTotalPanel.Text := ' ' + ByteOrTB(ToMultiple(trunc(Size64(MemoryEx.HiTotalPhys, MemoryEx.LoTotalPhys)/oneMB), 16), False) + ' всего, ' +
                              ByteOrTB(ToMultiple(trunc(Size64(MemoryEx.HiTotalPhys, MemoryEx.LoTotalPhys)/oneMB), 16) -
                                                        Size64(MemoryEx.HiAvailPhys, MemoryEx.LoAvailPhys)/oneMB, False) + ' используется, ' +
                              ByteOrTB(Size64(MemoryEx.HiAvailPhys, MemoryEx.LoAvailPhys)/oneMB, False) + ' свободно'
 
  // Виртуальная память:
  PageFileTotalPanel.Color := $CCFFCC
  PageFileTotalPanel.Text := ' ' + ByteOrTB(Size64(MemoryEx.HiTotalPageFile, MemoryEx.LoTotalPageFile)/oneMB, False) + ' всего, ' +
                                   ByteOrTB((Size64(MemoryEx.HiTotalPageFile, MemoryEx.LoTotalPageFile) -
                                             Size64(MemoryEx.HiAvailPageFile, MemoryEx.LoAvailPageFile))/oneMB, False) + ' занято системным кэшем'
  if Size64(MemoryEx.HiTotalPageFile, MemoryEx.LoTotalPageFile)/oneMB < NeedPageFile then
    begin
      PageFileTotalPanel.Color := $CCCCFF
      ChangeText := True
    end
 
  if ChangeText = True then
    begin
      TopText.Top := 0
      TopText.Caption := 'Не все компоненты удовлетворяют минимальным требованиям игры.' #13
                         'Пожалуйста, проверьте позиции, выделенные красным цветом.'
      TopText.Font.Color := clRed
      // WizardForm.NextButton.Enabled := False
    end
  else
    begin
      TopText.Caption := 'Все компоненты соответствуют минимальным требованиям игры.'
      TopText.Font.Color := clGreen
      TopText.Top := 8
      // WizardForm.NextButton.Enabled := True
    end
end;
 
 procedure MinimizeInstallPage(CurPageID: Integer);
 begin
  if CurPageID=wpInstalling then
   begin
    WizardForm.CancelButton.BringToFront;
    WizardForm.Bevel.Hide;
    WizardForm.Bevel1.Hide;
    WizardForm.BorderStyle:=bsDialog;
    WizardForm.MainPanel.Visible:=False;
    WizardForm.Width:=ScaleX(320);
    WizardForm.Height:=ScaleY(91);
    WizardForm.InnerNotebook.Left:=ScaleX(7);
    WizardForm.InnerNotebook.Top:=ScaleY(7);
    WizardForm.InnerNotebook.Width:=ScaleX(300);
    WizardForm.StatusLabel.Left:=ScaleX(0);
    WizardForm.StatusLabel.Top:=ScaleY(0);
    WizardForm.StatusLabel.Width:=WizardForm.InnerNotebook.Width;
    WizardForm.FileNameLabel.Left:=ScaleX(0);
    WizardForm.FileNameLabel.Top:=ScaleY(17);
    WizardForm.FileNameLabel.Width:=WizardForm.InnerNotebook.Width;
    WizardForm.ProgressGauge.Top:=ScaleY(15);
    WizardForm.ProgressGauge.Left:=ScaleX(0);
    WizardForm.ProgressGauge.Width:=WizardForm.InnerNotebook.Width;
    WizardForm.CancelButton.Left:=ScaleX(122);
    WizardForm.CancelButton.Top:=ScaleY(70);
    WizardForm.Left:=GetSystemMetrics(16)-ScaleX(325);
    WizardForm.Top:=GetSystemMetrics(17)-ScaleX(68);
   end;
if CurPageID=wpFinished
 then
  begin
  WizardForm.Width:=502;{Размер окна по горизонтали}
  WizardForm.Height:=392;{Размер окна по вертикали}
  WizardForm.Bevel.Show;
  WizardForm.Position:=poScreenCenter; {Возврат в исходное состояние}
 end
end;
 
procedure InitializeWizard();
begin
  InfoPage := CreateCustomPage(wpLicense, 'Аппаратное и программное обеспечение',
                                          'Программа установки обнаружила следующие наобходимые компоненты.')
  CreateCheckForm()  // Создание объектов TMemo, в которых будет выводится информация о системе
  UpdateInfo()  // Обновление информации о системе
  RepaintInstall();
  ButtonTextures();
 
   ISDoneProgressBar := TNewProgressBar.Create(WizardForm);
   with ISDoneProgressBar do begin
      Left      := ScaleX(0);
      Top       := ScaleY(40);
      Width     := ScaleX(417);
      Max       := 1000;
      Height    := WizardForm.ProgressGauge.Height;
      Parent    := WizardForm.InstallingPage;
   end;
   LabelPct := TLabel.Create(WizardForm);
   with LabelPct do begin
     Parent    := WizardForm.InstallingPage;
     AutoSize  := False;
     Width     := WizardForm.ProgressGauge.Width;
     Top       := WizardForm.ProgressGauge.Top + ScaleY(40);
     Alignment := taCenter;
     Caption   := '';
   end;
   LabelCurrFileName := TLabel.Create(WizardForm);
   with LabelCurrFileName do begin
      Parent    := WizardForm.InstallingPage;
      AutoSize  := False;
      Width     := WizardForm.ProgressGauge.Width;
      Left      := ScaleX(0);
      Top       :=  WizardForm.ProgressGauge.Top + ScaleY(25);
      Caption   := '';
   end;
end;
 
Procedure CurPageChanged(CurPageID: Integer);
Begin
  if CurPageID = InfoPage.ID then UpdateInfo()  // Обновление информации о системе
   if (CurPageID = wpFinished) and MyError then
   begin
      WizardForm.Caption:= ExpandConstant('{cm:Error}');
      WizardForm.FinishedLabel.Font.Color:= clRed;
      WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
   end;
  MinimizeInstallPage(CurPageID)
  UpdateButtons(CurPageID);
end;
 
procedure CurStepChanged(CurStep: TSetupStep);
var ChComp, TmpValue:longword;
    n:integer;
begin
   if CurStep = ssInstall then begin  //Если необходимо, можно переделать на ssPostInstall
      WizardForm.ProgressGauge.Hide;
      CallBack:=WrapMyCallback(@ProgressCallback,2);
      Cancel:=0;
      OveralPct:=0;
 
// Распаковка всех необходимых файлов в папку {tmp}. Это необходимо для того, чтобы
//выполнять установку в момент ssInstall, и секция [Run] выполнялась после установки.
#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
      ChComp:=0;
#ifdef Components
      TmpValue:=1;
      if IsComponentSelected('text\rus') then ChComp:=ChComp+TmpValue;     //компонент 1
      TmpValue:=TmpValue*2;
      if IsComponentSelected('text\eng') then ChComp:=ChComp+TmpValue;     //компонент 2
      TmpValue:=TmpValue*2;
      if IsComponentSelected('voice\rus') then ChComp:=ChComp+TmpValue;    //компонент 3
      TmpValue:=TmpValue*2;
      if IsComponentSelected('voice\eng') then ChComp:=ChComp+TmpValue;    //компонент 4
#endif
 
      StartRecord(ExpandConstant('{src}\records.inf'),ChComp);
      repeat
         MyError:=true;
//       if not ISRarExtract    ( 0, OveralPct, 0, ExpandConstant('{src}\aaa.rar'), ExpandConstant('{app}'),            false,CallBack, ''              ) then break;
         if not ISArcExtract    ( 0, OveralPct, 0, ExpandConstant('{src}\Setup-1.bin'),  ExpandConstant('{app}'),                false,CallBack, '',    '',    '') then break;
         if not ISSRepExtract   ( 0, OveralPct, 0, ExpandConstant('{app}\GameData.srep'), ExpandConstant('{app}\GameData.pcf'), '', true, CallBack                  ) then break;
         if not ISPrecompExtract( 0, OveralPct, 0, ExpandConstant('{app}\GameData.pcf'),  ExpandConstant('{app}\GameData.7z'),      true, CallBack                  ) then break;
         if not IS7ZipExtract   ( 0, OveralPct, 0, ExpandConstant('{app}\GameData.7z'),   ExpandConstant('{app}'),                true, CallBack, ''              ) then break;
         MyError:=false;
                  MyError:=true;
//       if not ISRarExtract    ( 0, OveralPct, 0, ExpandConstant('{src}\aaa.rar'), ExpandConstant('{app}'),            false,CallBack, ''              ) then break;
         if not ISArcExtract    ( 0, OveralPct, 0, ExpandConstant('{src}\Setup-2.bin'),  ExpandConstant('{app}'),                false,CallBack, '',    '',    '') then break;
         if not ISSRepExtract   ( 0, OveralPct, 0, ExpandConstant('{app}\VideoData.srep'), ExpandConstant('{app}\VideoData.pcf'), '', true, CallBack                  ) then break;
         if not ISPrecompExtract( 0, OveralPct, 0, ExpandConstant('{app}\VideoData.pcf'),  ExpandConstant('{app}\VideoData.7z'),      true, CallBack                  ) then break;
         if not IS7ZipExtract   ( 0, OveralPct, 0, ExpandConstant('{app}\VideoData.7z'),   ExpandConstant('{app}'),                true, CallBack, ''              ) then break;
         MyError:=false;
                  MyError:=true;
//       if not ISRarExtract    ( 0, OveralPct, 0, ExpandConstant('{src}\aaa.rar'), ExpandConstant('{app}'),            false,CallBack, ''              ) then break;
         if not ISArcExtract    ( 0, OveralPct, 0, ExpandConstant('{src}\Setup-3.bin'),  ExpandConstant('{app}'),                false,CallBack, '',    '',    '') then break;
         if not ISSRepExtract   ( 0, OveralPct, 0, ExpandConstant('{app}\AudioData.srep'), ExpandConstant('{app}\AudioData.7z'), '', true, CallBack                  ) then break;
         if not IS7ZipExtract   ( 0, OveralPct, 0, ExpandConstant('{app}\AudioData.7z'),   ExpandConstant('{app}'),                true, CallBack, ''              ) then break;
         MyError:=false;
      until true;
      StopRecord;
   end;
   if (CurStep=ssPostInstall) and MyError then
      Exec(ExpandConstant('{uninstallexe}'), '/SILENT','', sw_Hide, ewWaitUntilTerminated, n);
end;

Всего записей: 695 | Зарегистр. 09-06-2009 | Отправлено: 04:15 09-11-2010
   

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

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


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

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

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru