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

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

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

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

   

R3Pa4eK



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

#define AppId                           "{A5BC96DB-3DEA-418E-A5DC-A8644BDAD8A1}"
#define MyAppName                       "DiRT 3"
 
#define CurentNeedSize                  "11000"
#define TotalNeedSize                   "8500"
 
#define NeedMem                         "512"
 
#define MyAppExeName                    "dirt3.exe"
#define IconFile                        "DIRT_3.ico"
 
; Если нужна музыка. Если нет, закомментировать
;#define Music
 
; Если нужна другая картинка на финишной странице. Если нет, закомментировать
#define FinishImage                     "2.bmp"
 
; Если нужен Nvidia PhysX. Если нет, закомментировать
;#define PhysX
 
; Если нужен реестр. Если нет, закомментировать
#define Registry
 
; Если нужны компоненты. Если нет, закомментировать
;#define Components
 
; Если нужен фаервол. Если нет, закомментировать
;#define FirewallInstallHelper
 
; Если нужны скины. Если нет, закомментировать
;#define Skin                            "Tiger.cjstyles"
 
; Если нужно лого. Если нет, закомментировать
;#define logo                            
 
; Если нужен 2 прогрессбар. Если нет, закомментировать
;#define SecondProgressBar
 
#define records
;#define precomp04                                                        
#define precomp038
;#define unrar
 
; Если нужны ситемные требования. Если нет, закомментировать
#define SysReq
 
#ifdef SysReq
; Частота процессора
#define Processor "2800"
; Величина видеопамяти
#define VideoCard "256"
; Величина оперативной памяти
#define RamMemory "2000"
; Операционная система
; В строке System данные расположены так "WinMajor.WinMinor.WinBuild.WinSP"
#define System "5.1..2"
#ifdef Skin
; Цвет левой панели (Процессор, Видеокарта, Оперативная память, Звуковая карта, Операционная система), если используется скин
#define Color1   "$484848"
#else
; Цвет левой панели (Процессор, Видеокарта, Оперативная память, Звуковая карта, Операционная система), если не используется скин
#define Color1   "$C9C9C9"
#endif
#ifdef Skin
; Цвет правой панели (значения), если используется скин
#define Color2   "clTeal"
#else
; Цвет правой панели (значения), если не используется скин
#define Color2   "$CCFFCC"
#endif
#ifdef Skin
; Цвет надписи "Все параметры Вашего компьютера соответсвуют требуемым.", если используется скин
#define Color3   "clLime"
#else
; Цвет надписи "Все параметры Вашего компьютера соответсвуют требуемым.", если не используется скин
#define Color3   "clGreen"
#endif
#ifdef Skin
; Цвет правой панели (значения), если значения не соответствуют требуемым и если используется скин
#define Color4   "$0101AF"
#else
; Цвет правой панели (значения), если значения не соответствуют требуемым и если не используется скин
#define Color4   "$CCCCFF"
#endif
#ifdef Skin
; Цвет надписи "Конфигурация Вашего компьютера не соответсвует тербуемой. Пожалуйста, проверьте компоненты, выделенные красным цветом.",  
; если значения не соответствуют требуемым и если используется скин
#define Color5   "$1313FF"
#else
; Цвет надписи "Конфигурация Вашего компьютера не соответсвует тербуемой. Пожалуйста, проверьте компоненты, выделенные красным цветом.",  
; если значения не соответствуют требуемым и если не используется скин
#define Color5   "clRed"
#endif
#include "Files\HWREQ\HWREQ_Module.iss"
#endif
 
[Setup]
AppId={{#AppId}
AppName={#MyAppName}
AppVerName={#MyAppName}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=Setup
Compression=none
SolidCompression=true
AllowNoIcons=true
VersionInfoCopyright=AntonOVS
SetupIconFile=Files\Install\{#IconFile}
WizardImageFile=Files\Install\WizardImage.bmp
#ifdef Skin
WizardSmallImageFile=Files\Install\WizardSmallImage1.bmp
#else
WizardSmallImageFile=Files\Install\WizardSmallImage.bmp
#endif
DirExistsWarning=no
;UninstallFilesDir={app}\Uninstall
ShowTasksTreeLines=true
#ifdef NeedSize
ExtraDiskSpaceRequired={#TotalNeedSize}
#endif
 
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
 
[CustomMessages]
rus.ExtractedFile=Извлекается файл:
rus.Extracted=Распаковка архивов...
rus.Error=Ошибка распаковки!
rus.Error1=Установка прервана!
rus.ElapsedTime=Прошло времени:
rus.RemainingTime=Осталось времени:
rus.EstimatedTime=Всего:
rus.AllElapsedTime=Время установки:
rus.Welcome1=Вас приветствует %nМастер установки игры %n{#MyAppName}
rus.Welcome2=Программа установит игру %n{#MyAppName} на Ваш компьютер.%n%nРекомендуется закрыть антивирусные пакеты, %nа также все прочие приложения перед тем, %nкак продолжить.%n%n%nНажмите «Далее», чтобы продолжить, или  %n«Отмена», чтобы выйти из программы установки.
rus.Finished1=Установка игры %n{#MyAppName} %nуспешно завершена.
rus.Finished2=Игра {#MyAppName} %nбыла успешно установлена на Ваш компьютер. %n%nДля ее запуска выберите соответствующий ярлык в меню «Пуск» или на Рабочем столе.
rus.Finished3=Нажмите «Завершить», чтобы выйти из программы установки.
rus.ISDoneFinishedHeading=Установка игры %n{#MyAppName} %nне завершена!
rus.ISDoneTitleBack=Откат установки...
rus.DeleteSave=Удалить сохраненные игры и профили?
rus.No_Cancel=В данный момент отмена невозможна!
rus.Info=Отключите антивирусную программу, ибо проблем с запуском игры вам не избежать
 
[Files]
Source: Files\Install\*; Flags: dontcopy
Source: Files\Install\5.ico; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system
#ifdef FirewallInstallHelper
Source: Files\Install\FirewallInstallHelper.dll; DestDir: {app}; Flags: ignoreversion
#endif
#ifdef Skin
Source: Files\ISSkin\{#Skin}; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: Files\ISSkin\ISSkin.dll; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
#endif
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp04
Source: Files\Install\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\Install\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Files\Install\precomp04.exe; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp038
Source: Files\Install\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\Install\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Files\Install\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
Source: Files\Install\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef unrar
Source: Files\Install\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#endif
 
#ifdef Music
Source: Files\Music\*; Flags: dontcopy
#endif
 
Source: {win}\help\*; DestDir: {app}\Files; Flags: external recursesubdirs createallsubdirs; Check: CheckError
 
#ifdef Components
[Types]
Name: full; Description: Full installation; Flags: iscustom
 
[Components]
Name: text; Description: Язык субтитров; Types: full; Flags: fixed
Name: text\rus; Description: Русский; Flags: exclusive;  
Name: text\eng; Description: Английский; Flags: exclusive;  
Name: voice; Description: Язык озвучки; Types: full; Flags: fixed
Name: voice\rus; Description: Русский; Flags: exclusive;  
Name: voice\eng; Description: Английский; Flags: exclusive;  
#endif
 
#ifdef Registry
[Registry]
Root: HKLM; SubKey: SOFTWARE\Codemasters; Flags: uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Codemasters\DiRT3; ValueType: string; ValueName: PATH_APPLICATION; ValueData: D:\Games\DiRT 3\; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Codemasters\DiRT3; ValueType: string; ValueName: LOCALE; ValueData: 2057; Flags: uninsdeletevalue uninsdeletekeyifempty
#endif
 
[Icons]
Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; WorkingDir: {app}; IconFilename: "{app}\{#MyAppExeName}"; Comment: {#MyAppName}; Check: CheckError
Name: {group}\Удалить игру; Filename: {uninstallexe}; WorkingDir: {app}\Uninstall\; Comment: Удалить игру {#MyAppName}; Check: CheckError
Name: {commondesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; WorkingDir: {app}; IconFilename: "{app}\{#MyAppExeName}"; Comment: {#MyAppName}; Check: CheckError
 
[Tasks]
Name: desktopicon; Description: Добавить ярлык на рабочий стол; GroupDescription: Создание ярлыков:
Name: Redist; Description: Дополнительное программное обеспечение:  
Name: Redist\DirectXCheck; Description: Обновить DirectX (Требуется интернет-подключение); Flags: unchecked
#ifdef PhysX
Name: Redist\PhysXCheck; Description: Установить Nvidia PhysX; Flags: unchecked
#endif
Name: Redist\VCCheck; Description: Установить Microsoft Visual C++ Redist; Flags: unchecked
Name: Redist\OpenAL; Description: Установить OpenAL; Flags: unchecked
Name: Redist\Xlive; Description: Установить Microsoft Games For Windows Live; Flags: unchecked
 
[Run]
Filename: {src}\Redist\vcredist_x86.exe; StatusMsg: Устанавливаем Microsoft Visual C++ Redist x86...; Flags: skipifdoesntexist; Tasks: Redist\VCCheck; Check: CheckError and not IsWin64
Filename: {src}\Redist\vcredist_x64.exe; StatusMsg: Устанавливаем Microsoft Visual C++ Redist x64...; Flags: skipifdoesntexist; Tasks: Redist\VCCheck; Check: CheckError and IsWin64
#ifdef PhysX
Filename: {src}\Redist\PhysX.exe; StatusMsg: Устанавливаем Nvidia PhysX...; Flags: skipifdoesntexist; Tasks: Redist\PhysXCheck; Check: CheckError
#endif
Filename: {src}\Redist\DXSETUP.exe; StatusMsg: Обновляем DirectX...; Flags: skipifdoesntexist; Tasks: Redist\DirectXCheck; Check: CheckError
Filename: {src}\Redist\oalinst.exe; StatusMsg: Устанавливаем OpenAL; Flags: skipifdoesntexist; Tasks: Redist\OpenAL; Check: CheckError
Filename: {src}\Redist\Game For Windows Live\GFWLIVESetupStub.exe; StatusMsg: Устанавливаем Microsoft Games For Windows Live; Flags: skipifdoesntexist; Tasks: Redist\Xlive; Check: CheckError
 
[UninstallDelete]
Type: filesandordirs; Name: {app}
 
#ifdef Music
  #include "Files\Music\Music.iss"
#endif
 
[Code]
const
  PCFonFLY=true;
  oneMb = 1048576;
  notPCFonFLY=false;
var
  LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2,LabelTime3,LabelTime4,PageNameLabel,PageNameLabel1,PageDescriptionLabel,
  PageDescriptionLabel1,WelcomeLabel1,WelcomeLabel2,WelcomeLabel3,WelcomeLabel4,TotalNeedSpaceLabel,NeedSpaceLabel,FreeSpaceLabel,
  FinishedHeadingLabel,FinishedHeadingLabel1,FinishedLabel,FinishedLabel1,FinishedLabel2,FinishedLabel3,StatusLabel,LogoLabel: TLabel;
  BmpFile,LogoImage: TBitmapImage;
  ISDoneProgressBar1: TNewProgressBar;
#ifdef SecondProgressBar
  LabelPct2: TLabel;
  ISDoneProgressBar2:TNewProgressBar;
#endif
  FreeMB, TotalMB: Cardinal;
  MyError:boolean;
  PCFVer:double;
  CurentNeedSize, TotalNeedSize,Cancel: Integer;
  path, name: String;
  LogoPanel: TPanel;
 
type
  TCallback = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
 
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';
#ifdef FirewallInstallHelper
function AddApplicationToExceptionList(path: String; name: String): Boolean; external 'AddApplicationToExceptionListA@files:FirewallInstallHelper.dll stdcall setuponly';
function RemoveApplicationFromExceptionList(path: String): Boolean; external 'RemoveApplicationFromExceptionListA@{app}\FirewallInstallHelper.dll stdcall uninstallonly';
#endif
#ifdef Skin
procedure LoadSkin(lpszPath: PAnsiChar; lpszIniFileName: PAnsiChar); external 'LoadSkin@{tmp}\isskin.dll stdcall delayload';
procedure UnloadSkin; external 'UnloadSkin@{tmp}\isskin.dll stdcall delayload';
function ShowWindow(hWnd: Integer; uType: Integer): Integer; external 'ShowWindow@user32.dll stdcall';
#endif
 
function InitializeSetup: Boolean;
begin
MsgBox(ExpandConstant('{cm:Info}'), mbInformation, mb_Ok);  
#ifdef Music
  InitializeMusicSetup;
#endif
#ifdef Skin
  ExtractTemporaryFile('isskin.dll');
  ExtractTemporaryFile('{#Skin}');
  LoadSkin(ExpandConstant('{tmp}\{#Skin}'), '');
#endif
  Result:=true;
end;
 
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;
  LabelTime4.Caption:=ExpandConstant('{cm:AllElapsedTime} ')+TimeStr3;
  Result := Cancel;
end;
 
// Перевод числа в строку с точностью 3 знака (%.3n) с округлением дробной части, если она есть
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 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;
 
procedure CancelButtonOnClick(Sender: TObject);
begin
  if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then Cancel:=1;
end;
 
procedure Close(Sender: TObject; var Action: TCloseAction);
begin
  Action := caNone;
  if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then Cancel:=1;
end;
 
procedure Close1(Sender: TObject; var Action: TCloseAction);
begin
  MsgBox(ExpandConstant('{cm:No_Cancel}'), mbInformation, MB_OK);
  Action := caNone;
end;
 
//***************************************** [ начало изображения 497 360 ] *********************************************//
 
procedure Images_labels();
var
Page: TWizardPage;
begin
  with WizardForm do
  begin
  WizardBitmapImage.Width:=497
  WelcomeLabel1.Hide;
  WelcomeLabel2.Hide;
  WizardBitmapImage2.Hide;
  FinishedLabel.Hide;
  FinishedHeadingLabel.Hide;
  DiskSpaceLabel.Hide;
  ComponentsDiskSpaceLabel.Hide;
end;
 
//***************************************** [ конец 497 360 изображения  ] *********************************************//
 
//***************************************** [ начало 497 58 изображения  ] *********************************************//
 
PageNameLabel:= TLabel.Create(WizardForm);
  with PageNameLabel do
  begin
    Left:= WizardForm.PageNameLabel.Left;
    Top:= WizardForm.PageNameLabel.Top;
    Width:= WizardForm.PageNameLabel.Width;
    Height:= WizardForm.PageNameLabel.Height;
    AutoSize:= False;
    WordWrap:= True;
    Font.Name:= WizardForm.PageNameLabel.Font.Name;
    Font.Style:= [fsBold];
    Transparent:= True;
    Parent:= WizardForm.MainPanel;
  end;
 
PageDescriptionLabel:= TLabel.Create(WizardForm);
  with PageDescriptionLabel do
  begin
    Left:= WizardForm.PageDescriptionLabel.Left-12;
    Top:= WizardForm.PageDescriptionLabel.Top;
    Height:= WizardForm.PageDescriptionLabel.Height;
    Width:= ScaleX(260);
    AutoSize:= False;
    WordWrap:= True;
    Font.Name:= WizardForm.PageDescriptionLabel.Font.Name;
    Transparent:= True;
    Parent:= WizardForm.MainPanel;
  end;
 
  with WizardForm do
  begin
    PageNameLabel.Hide;
    PageDescriptionLabel.Hide;
    with MainPanel do
    begin
      with WizardSmallBitmapImage do
       begin
        Left:= ScaleX(0);
        Top:= ScaleY(0);
        Width:= Mainpanel.Width;
        Height:= MainPanel.Height;
       end;
    end;
 end;
 
 
//****************************************** [конец 497 58 изображения  ] **********************************************//
 
#ifdef FinishImage
  ExtractTemporaryFile('{#FinishImage}');
#else  
  ExtractTemporaryFile('WizardImage.bmp');
#endif
 
  BmpFile:= TBitmapImage.Create(WizardForm);
#ifdef FinishImage
  BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\{#FinishImage}'));
#else  
  BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardImage.bmp'));
#endif
  BmpFile.Top:= ScaleY(0);
  BmpFile.Left:= ScaleX(0);
  BmpFile.Width:= ScaleX(497);
  BmpFile.Height:= ScaleY(313);
  BmpFile.Stretch:= true;
  BmpFile.Parent:= WizardForm.FinishedPage;
 
//******************************************* [ начало WelcomePage ] ***************************************************//
 
  WelcomeLabel1:= TLabel.Create(WizardForm);
  with WelcomeLabel1 do begin
    AutoSize:=False;
    SetBounds(ScaleX(-26), ScaleY(31), ScaleX(550), ScaleY(70));
    WordWrap:=True;
    Alignment := taCenter;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 14;
    Font.Color:=$000000;
    Font.Style:=[fsBold];
    Caption:= ExpandConstant('{cm:Welcome1}');
    Parent:=WizardForm.WelcomePage;
  end;
  WelcomeLabel2:= TLabel.Create(WizardForm);
  with WelcomeLabel2 do begin
    AutoSize:=False;
    SetBounds(ScaleX(-27), ScaleY(30), ScaleX(550), ScaleY(70));
    WordWrap:=True;
    Alignment := taCenter;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 14;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsBold];
    Caption:= ExpandConstant('{cm:Welcome1}');
    Parent:=WizardForm.WelcomePage;
  end;
 
  WelcomeLabel3:=TLabel.Create(WizardForm);
  with WelcomeLabel3 do begin
    AutoSize:=False;
    SetBounds(ScaleX(-26), ScaleY(121), ScaleX(550), ScaleY(200));
    WordWrap:=True;
    Alignment := taCenter;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 10;
    Font.Color:=$000000;
    Font.Style := [fsBold, fsItalic];
    Caption:= ExpandConstant('{cm:Welcome2}');
    Parent:=WizardForm.WelcomePage;
  end;
  WelcomeLabel4:=TLabel.Create(WizardForm);
  with WelcomeLabel4 do begin
    AutoSize:=False;
    SetBounds(ScaleX(-27), ScaleY(120), ScaleX(550), ScaleY(200));
    WordWrap:=True;
    Alignment := taCenter;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 10;
    Font.Color:=$FFFFFF;
    Font.Style := [fsBold, fsItalic];
    Caption:= ExpandConstant('{cm:Welcome2}');
    Parent:=WizardForm.WelcomePage;
end;
 
//******************************************* [ конец WelcomePage ] ****************************************************//
 
//****************************************** [ начало SelectDirPage ] **************************************************//
 
WizardForm.DirEdit.Text:= MinimizePathName(WizardForm.DirEdit.Text, WizardForm.DirEdit.Font, WizardForm.DirEdit.Width);
 
//******************************************* [ конец SelectDirPage ] **************************************************//
 
//******************************************* [ начало FinishedPage ] **************************************************//
 
  FinishedHeadingLabel:= TLabel.Create(WizardForm);
  with FinishedHeadingLabel do begin
    SetBounds(ScaleX(-29), ScaleY(11), ScaleX(550), ScaleY(65));
    AutoSize:= false;
    Alignment := taCenter;
    Transparent:= true;
    WordWrap:= true;
    Font.Name:='Georgia';
    Font.Size:= 13;
    Font.Color:=$00000;
    Font.Style := [fsBold];
    Caption:= ExpandConstant('{cm:Finished1}');
    Parent:=WizardForm.FinishedPage;
  end;
  FinishedHeadingLabel1:= TLabel.Create(WizardForm);
  with FinishedHeadingLabel1 do begin
    SetBounds(ScaleX(-30), ScaleY(10), ScaleX(550), ScaleY(65));
    AutoSize:= false;
    Alignment := taCenter;
    Transparent:= true;
    WordWrap:= true;
    Font.Name:='Georgia';
    Font.Size:= 13;
    Font.Color:=$FFFFFF;
    Font.Style := [fsBold];
    Caption:= ExpandConstant('{cm:Finished1}');
    Parent:=WizardForm.FinishedPage;
  end;
 
  FinishedLabel:=TLabel.Create(WizardForm);
  with FinishedLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(26), ScaleY(121), ScaleX(450), ScaleY(200));
    WordWrap:=True;
    Alignment := taCenter;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 10;
    Font.Color:=$000000;
    Font.Style := [fsBold, fsItalic];
    Caption:= ExpandConstant('{cm:Finished2}');
    Parent:=WizardForm.FinishedPage;
  end;
  FinishedLabel1:=TLabel.Create(WizardForm);
  with FinishedLabel1 do begin
    AutoSize:=False;
    SetBounds(ScaleX(25), ScaleY(120), ScaleX(450), ScaleY(200));
    WordWrap:=True;
    Alignment := taCenter;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 10;
    Font.Color:=$FFFFFF;
    Font.Style := [fsBold, fsItalic];
    Caption:= ExpandConstant('{cm:Finished2}');
    Parent:=WizardForm.FinishedPage;
  end;
  FinishedLabel2:=TLabel.Create(WizardForm);
  with FinishedLabel2 do begin
    AutoSize:=False;
    SetBounds(ScaleX(26), ScaleY(261), ScaleX(450), ScaleY(200));
    WordWrap:=True;
    Alignment := taCenter;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 10;
    Font.Color:=$000000;
    Font.Style := [fsBold, fsItalic];
    Caption:= ExpandConstant('{cm:Finished3}');
    Parent:=WizardForm.FinishedPage;
  end;
  FinishedLabel3:=TLabel.Create(WizardForm);
  with FinishedLabel3 do begin
    AutoSize:=False;
    SetBounds(ScaleX(25), ScaleY(260), ScaleX(450), ScaleY(200));
    WordWrap:=True;
    Alignment := taCenter;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 10;
    Font.Color:=$FFFFFF;
    Font.Style := [fsBold, fsItalic];
    Caption:= ExpandConstant('{cm:Finished3}');
    Parent:=WizardForm.FinishedPage;
  end;
end;
 
//******************************************* [ конец FinishedPage ] ***************************************************//
 
//*************************************** [ начало Место для установки ] ***********************************************//
 
Function MbOrTb(Byte: Extended): String;
begin
  if Byte < 1024 then Result:= NumToStr(Byte) + ' Мб' else
    if Byte/1024 < 1024 then Result:= NumToStr(round(Byte/1024*100)/100) + ' Гб' else
      Result:= NumToStr(round((Byte/(1024*1024))*100)/100) + ' Тб'
end;
 
procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: String;
begin
  Path := ExtractFileDrive(WizardForm.DirEdit.Text);
  GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
  NeedSpaceLabel.Caption := 'Игра займет на диске: ~ '+ MbOrTb(CurentNeedSize)
  TotalNeedSpaceLabel.Caption := 'Для распаковки требуется: ~ '+ MbOrTb(TotalNeedSize)
  FreeSpaceLabel.Caption := 'Доступно места на диске: '+ MbOrTb(FreeMB)
  WizardForm.NextButton.Enabled:= (FreeMB>TotalNeedSize);
  if (FreeMB<TotalNeedSize) then
    FreeSpaceLabel.Font.Color:=clRed else
    FreeSpaceLabel.Font.Color:=WizardForm.Font.Color;
end;
 
procedure SpaceLabel();
begin
  CurentNeedSize := {#CurentNeedSize};
  TotalNeedSize := {#TotalNeedSize};
 
  FreeSpaceLabel := TLabel.Create(WizardForm);
  FreeSpaceLabel.Parent := WizardForm.SelectDirPage;
  FreeSpaceLabel.SetBounds(ScaleX(5), ScaleY(180), ScaleX(209), ScaleY(13));
 
  TotalNeedSpaceLabel := TLabel.Create(WizardForm);
  TotalNeedSpaceLabel.Parent := WizardForm.SelectDirPage;
  TotalNeedSpaceLabel.SetBounds(ScaleX(5), ScaleY(200), ScaleX(209), ScaleY(13));
 
  NeedSpaceLabel := TLabel.Create(WizardForm);
  NeedSpaceLabel.Parent := WizardForm.SelectDirPage;
  NeedSpaceLabel.SetBounds(ScaleX(5), ScaleY(220), ScaleX(209), ScaleY(13));
 
  WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
 
//****************************************** [ конец Место для установки ] *************************************************//
 
//************************************************ [ начало Кнопки ] *******************************************************//
 
with WizardForm.BackButton do
  Cursor := crHand;
 
with WizardForm.NextButton do
  Cursor := crHand;
 
with WizardForm.CancelButton do
  Cursor := crHand;
 
with WizardForm.DirBrowseButton do
  Cursor := crHand;
 
with WizardForm.GroupBrowseButton do
  Cursor := crHand;
end;
 
//************************************************ [ конец Кнопки ] ********************************************************//
 
//******************************************* [ начало Элементы ISDone ] ***************************************************//
 
procedure HideComponents;
begin
  ISDoneProgressBar1.Hide;
  LabelPct1.Hide;
  LabelCurrFileName.Hide;
  LabelTime1.Hide;
  LabelTime2.Hide;
#ifdef SecondProgressBar
  ISDoneProgressBar2.Hide;
  LabelPct2.Hide;
#endif
end;
 
procedure ShowComponents;
var PBTop:integer;
begin
  PBTop:=WizardForm.ProgressGauge.Top;
  ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
  with ISDoneProgressBar1 do begin
    Parent   := WizardForm.InstallingPage;
    Left     := ScaleX(0);
    Top      := PBTop;
    Width    := ScaleX(365);
    Max      := 1000;
    Height   := WizardForm.ProgressGauge.Height;
  end;
  LabelPct1 := TLabel.Create(WizardForm);
  with LabelPct1 do begin
    Parent    := WizardForm.InstallingPage;
    AutoSize  := False;
    Left      := ISDoneProgressBar1.Width+10;
    Top       := ISDoneProgressBar1.Top + 4;
    Width     := ScaleX(80);
  end;
  LabelCurrFileName := TLabel.Create(WizardForm);
  with LabelCurrFileName do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := ISDoneProgressBar1.Width+ScaleX(30);
    Left     := ScaleX(0);
    Top      := WizardForm.FileNamelabel.Top;
  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(10);
    Top       := ISDoneProgressBar2.Top + ScaleY(4);
    Width     := ScaleX(80);
  end;
#endif
  LabelTime1 := TLabel.Create(WizardForm);
  with LabelTime1 do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := 300;
    Left     := ScaleX(0);
    Top      := PBTop + ScaleY(35);
  end;
  LabelTime2 := TLabel.Create(WizardForm);
  with LabelTime2 do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := 300;
    Left     := ScaleX(0);
    Top      := PBTop + ScaleY(55);
  end;
  LabelTime3 := TLabel.Create(WizardForm);
  with LabelTime3 do begin
    Parent   := WizardForm.FinishedPage;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 10;
    Font.Color:=$000000;
    Font.Style := [fsBold, fsItalic];
    AutoSize := False;
    Alignment := taCenter;
    Width    := 450;
    Left     := 27;
    Top      := 222;
  end;
  LabelTime4 := TLabel.Create(WizardForm);
  with LabelTime4 do begin
    Parent   := WizardForm.FinishedPage;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 10;
    Font.Color:=$FFFFFF;
    Font.Style := [fsBold, fsItalic];
    AutoSize := False;
    Alignment := taCenter;
    Width    := 450;
    Left     := 25;
    Top      := 220;
  end;
  StatusLabel := TLabel.Create(WizardForm);
  with StatusLabel do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := 300;
    Left     := WizardForm.StatusLabel.Left;
    Top      := WizardForm.StatusLabel.Top;
    Caption  := ExpandConstant('{cm:ISDoneTitleBack}');
  end;
end;
 
Procedure UnpackingISDoneFinished(CurPageID: Integer);
Begin
  if (CurPageID = wpFinished) and MyError then
  begin
    LabelTime3.Hide;
    LabelTime4.Hide;
    WizardForm.Caption:= ExpandConstant('{cm:Error}');
    FinishedHeadingLabel.Caption:= ExpandConstant('{cm:ISDoneFinishedHeading}');
    FinishedHeadingLabel.Font.Color:= $000000;
    FinishedHeadingLabel1.Caption:= ExpandConstant('{cm:ISDoneFinishedHeading}');
    FinishedHeadingLabel1.Font.Color:= $0000C0;    // red (красный)
    FinishedLabel.Font.Color:= $000000;
    FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
    FinishedLabel1.Font.Color:= $0000C0;
    FinishedLabel1.Caption:= SetupMessage(msgSetupAborted) ;
  end;
  if (CurPageID = wpFinished) and (Cancel <> 0) then
  begin
    LabelTime3.Hide;
    LabelTime4.Hide;
    WizardForm.Caption:= ExpandConstant('{cm:Error1}');
    FinishedHeadingLabel.Caption:= ExpandConstant('{cm:ISDoneFinishedHeading}');
    FinishedHeadingLabel.Font.Color:= $000000;
    FinishedHeadingLabel1.Caption:= ExpandConstant('{cm:ISDoneFinishedHeading}');
    FinishedHeadingLabel1.Font.Color:= $0000C0;    // red (красный)
    FinishedLabel.Font.Color:= $000000;
    FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
    FinishedLabel1.Font.Color:= $0000C0;
    FinishedLabel1.Caption:= SetupMessage(msgSetupAborted) ;
  end;
end;
 
function CheckError:boolean;
begin
  result:= not MyError;
end;
 
procedure UnpackingISDone(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:longword;
    tmp:integer;
begin
  if CurStep = ssInstall then begin  
    WizardForm.FileNamelabel.Hide;
    WizardForm.ProgressGauge.Hide;
    WizardForm.OnClose:=@Close;
    WizardForm.CancelButton.OnClick:=@CancelButtonOnClick;
    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}\data1.bin'),       ExpandConstant('{app}\tracks\'),            false, '', '', '', notPCFonFLY ) then break;
 
        if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\data2.bin'),       ExpandConstant('{app}\cars'),            false, '', '', '', notPCFonFLY ) then break;
        if not ISSRepExtract   ( 0, 0, ExpandConstant('{app}\cars\data2.srep'), ExpandConstant('{app}\cars\data2.pcf'), true                           ) then break;
        if not ISPrecompExtract( 0, 0, ExpandConstant('{app}\cars\data2.pcf'),  ExpandConstant('{app}\cars\data2.7z'),  true                           ) then break;
        if not IS7ZipExtract   ( 0, 0, ExpandConstant('{app}\cars\data2.7z'),   ExpandConstant('{app}\cars\'),            true,  ''                      ) then break;
 
        if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\data3.bin'),       ExpandConstant('{app}\audio\'),            false, '', '', '', notPCFonFLY ) then break;
         
        if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\data4.bin'),       ExpandConstant('{app}\video\'),            false, '', '', '', notPCFonFLY ) then break;
 
        if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\data5.bin'),       ExpandConstant('{app}\'),            false, '', '', '', notPCFonFLY ) then break;
         
        if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\data6.bin'),       ExpandConstant('{app}\'),            false, '', '', '', notPCFonFLY ) then break;
         
        if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\data7.bin'),       ExpandConstant('{app}\'),            false, '', '', '', notPCFonFLY ) then break;
        if not ISSRepExtract   ( 0, 0, ExpandConstant('{app}\data7.srep'), ExpandConstant('{app}\data7.pcf'), true                           ) then break;
        if not ISPrecompExtract( 0, 0, ExpandConstant('{app}\data7.pcf'),  ExpandConstant('{app}\compat.bin'),  true                           ) then break;
         
//     далее находятся закомментированые примеры различных комбинаций параметров и функций распаковки
 
        //if not IS7ZipExtract   ( 0, 0, ExpandConstant('{src}\data64.7z'),   ExpandConstant('{app}'),        false, ''                     ) then break;
        //if not ISSRepExtract   ( 0, 0, ExpandConstant('{app}\data.srp'),ExpandConstant('{app}\data.pcf'),      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}\data1.bin'),  ExpandConstant('{app}'),           false, '', '', '',notPCFonFLY ) then break;
        //if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\data2.bin'),  ExpandConstant('{app}'),           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.ProgressGauge.Show;
    WizardForm.FileNamelabel.Show;
    WizardForm.CancelButton.Visible:=true;
    WizardForm.CancelButton.Enabled:=false;
    WizardForm.OnClose:=@Close1;
  end;
  if (CurStep=ssPostInstall) and MyError then begin
    Exec(ExpandConstant('{uninstallexe}'), '/SILENT','', sw_Hide, ewWaitUntilTerminated, tmp);
  end;
end;
 
//******************************************** [ конец Элементы ISDone ] ***************************************************//
 
//******************************************* [ начало UninstallingPage ] **************************************************//
 
#ifdef Skin
function InitializeUninstall: Boolean;
begin
  FileCopy(ExpandConstant('{app}\isskin.dll'), ExpandConstant('{tmp}\isskin.dll'), False);
  FileCopy(ExpandConstant('{app}\{#Skin}'), ExpandConstant('{tmp}\{#Skin}'), False);
  LoadSkin(ExpandConstant('{tmp}\{#Skin}'), '');
  Result:=True;
end;
#endif
 
//================== Удаление сохранений ==================//
 
procedure DeleteSavedGames(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep=usUninstall then
  if DirExists(ExpandConstant('{userdocs}')+'\Criterion Games\{#MyAppName}') then
  if MsgBox(ExpandConstant('{cm:DeleteSave}'), mbInformation, MB_YESNO) = idYes then
  DelTree(ExpandConstant('{userdocs}')+'\Criterion Games\{#MyAppName}', True, True, True)
end;
 
//================== Удаление сохранений ==================//
 
//******************************************** [ конец UninstallingPage ] **************************************************//
 
//************************************ [ начало logo - Лого как ссылка внизу слева ] ***************************************//
 
#ifdef logo
procedure LogoLabelOnClick(Sender: TObject);
var
  ErrorCode: Integer;
begin
  ShellExec('open', 'http://forum.ru-board.com/topic.cgi?forum=5&topic=35146', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
 
procedure logo();
begin
  LogoPanel := TPanel.Create(WizardForm);
with LogoPanel do
begin
  Parent := WizardForm;
  Left := ScaleX(7);
  Top := ScaleY(319);
  Width := ScaleX(188);
  Height := ScaleY(44);
  BevelOuter := bvNone;
end;
 
  LogoImage := TBitmapImage.Create(WizardForm);
with LogoImage do
begin
  Parent := LogoPanel;
  Left := ScaleX(0);
  Top := ScaleY(0);
  AutoSize:=true;
  ReplaceColor:=clFuchsia;
  ReplaceWithColor:=clBtnFace;
#ifndef Skin
  ExtractTemporaryFile('logo.bmp');
  Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
#else
  ExtractTemporaryFile('logo1.bmp');
  Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo1.bmp'));
#endif
end;
 
  LogoLabel := TLabel.Create(WizardForm);
with LogoLabel do
 begin
  Parent := LogoPanel;
  Width := LogoPanel.Width;
  Height := LogoPanel.Height;
  Transparent:=True;
  Cursor := crHand;
  OnClick:=@LogoLabelOnClick;
 end;
end;
#endif
 
//************************************ [ конец logo - Лого как ссылка внизу слева ] ***************************************//
 
procedure InitializeWizard();
begin
    Images_labels;
    SpaceLabel;
#ifdef SysReq
    HWREQ_CreatePanelSimple(nil);
#endif
#ifdef logo
    logo;
#endif
#ifdef Music
    InitializeMusic;
#endif
end;
 
Procedure CurPageChanged(CurPageID: Integer);
Begin
  PageNameLabel.Caption:= WizardForm.PageNameLabel.Caption;
    PageDescriptionLabel.Caption:= WizardForm.PageDescriptionLabel.Caption;
    if CurPageID = wpSelectDir then GetFreeSpaceCaption(nil);
    UnpackingISDoneFinished(CurPageID);
#ifdef SysReq
    TestChanged(CurPageID);
#endif
#ifdef Music
    CurPageMusicChanged(CurPageID);
#endif
end;
 
procedure CurStepChanged(CurStep: TSetupStep);
begin
#ifdef FirewallInstallHelper
  if CurStep = ssPostInstall then
    begin
    path:=ExpandConstant('{#path}');
    name:=ExpandConstant('{#MyAppName}');
    AddApplicationToExceptionList(path, name);
  end;
#endif
    UnpackingISDone(CurStep);
  if MyError then begin
    WizardForm.StatusLabel.Hide;
    StatusLabel.Show;
    WizardForm.FileNamelabel.Hide;
    WizardForm.ProgressGauge.Hide;
    HideComponents;
  end;
end;
 
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
    DeleteSavedGames(CurUninstallStep);
#ifdef FirewallInstallHelper
    if CurUninstallStep=usUninstall then
  begin
    path:=ExpandConstant('{#path}');
    RemoveApplicationFromExceptionList(path)
    UnloadDll(ExpandConstant('{app}\FirewallInstallHelper.dll'));
  end;
#endif
end;
 
procedure DeinitializeSetup;
begin
#ifdef Skin
    ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')),0);
      UnloadSkin;
#endif
#ifdef Music
    DeinitializeMusic;
#endif
end;
 
#ifdef Skin
procedure DeinitializeUninstall;
begin
  UnloadSkin;
end;
#endif

Всего записей: 963 | Зарегистр. 15-01-2011 | Отправлено: 19:18 26-05-2011 | Исправлено: R3Pa4eK, 19:19 26-05-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