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

Статус
В этой теме нельзя размещать новые ответы.

YURSHAT

Тех. админ
Администратор

Это мощное бесплатное средство для создания установочных пакетов (дистрибутивов) программ. Поддерживается шифрование, установка пароля, различные задачи по завершении установки.
По сравнению с NSIS (основной конкурент на бесплатной основе) проще в настройке, имеет более понятную структуру скрипта, но генерит на 200-300 кб больший инсталятор. На данный момент он конкурирует и даже превосходит многие коммерческие установщики по функциональности и стабильности.

Последние версии:
Inno Setup QuickStart Pack (ansi) 5.5.3 [30.01.2013]
Скачать (1.8 Mb)
Inno Setup QuickStart Pack (unicode) 5.5.3 [30.01.2013]
Скачать (2.2 Mb)
Что нового? |По русски :)| Все сборки
Русский язык для Inno Setup версии 5.5.3 от [USER]Leserg[/USER] [04.02.2013]
Скачать

Расширенная версия от китайских собратьев. Домашняя страница ResTools
Добавляет списку компонентов возможность сворачивать дочерние элементы.
Содержит более удобный редактор, кроме того, компилятор имеет множество других возможностей и новых функций.
На сайте автора также есть дополнительные библиотеки.
Последние версии:
Inno Setup Compiler 5.5.2 build 121216
Скачать (2.96 Mb) | Зеркало (1.7 Mb) - Убраны картинки для уменьшения веса архива
Inno ISCmplr Setup 5.5.1 build 121002
Скачать (1.8 Mb) | Зеркало

Русская справка к версии 5.5.1, автор перевода BagIra, [USER]bugron[/USER]
Скачать

Сборки:
InnoSetup Ultra
Сборка инструментов для работы со скриптами InnoSetup.
Текущая версия компилятора – 5.5.1. Обновлено 2 Октября 2012г.
Содержит в себе все обновленные инструменты для работы, сборка постоянно обновляется.
Автор сборки: [USER]Gnom[/USER]
Скачать | InnoUltra-lite version | Апдейт (миниинсталл)
 
Последнее редактирование модератором:

makst

Новичок
Выдает ошибку, что нет такой функции NextButtonClick2...

Вот полный код.

Код:
[Files]
; Add the ISSkin DLL used for skinning Inno Setup installations.
Source: "C:\Users\Max\Desktop\isskin\ISSkinEx.dll"; DestDir: {app}; Flags: dontcopy

; Add the Visual Style resource contains resources used for skinning,
; you can also use Microsoft Visual Styles (*.msstyles) resources.
Source: "C:\Users\Max\Desktop\isskin\ForestGreen.cjstyles"; DestDir: {tmp}; Flags: dontcopy

[Icons]
Name: {group}\Uninstall =ISSkin; Filename: {app}\unins000.exe

; The following code block is used to load the ISS, pass in
; an empty string ('') as the second parameter to LoadSkin to use
; the Blue color scheme, this is the default color scheme for
; Office2007.cjstyles.
[Code_]
// Importing LoadSkin API from ISSkin.DLL
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:isskinex.dll stdcall';

// Importing UnloadSkin API from ISSkin.DLL
procedure UnloadSkin();
external 'UnloadSkin@files:isskinex.dll stdcall';

// Importing ShowWindow Windows API from User32.DLL
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external 'ShowWindow@user32.dll stdcall';

function InitializeSetup1(): Boolean;
begin
	ExtractTemporaryFile('ForestGreen.cjstyles');
	LoadSkin(ExpandConstant('{tmp}\ForestGreen.cjstyles'), '');
	Result := True;
end;

procedure DeinitializeSetup1();
begin
	// Hide Window before unloading skin so user does not get
	// a glimse of an unskinned window before it is closed.
	ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
	UnloadSkin();
end;

[Setup]


; --- Source: ISDone_Example.iss ------------------------------------------------------------
#define MyAppName "R.A.W. Realms of Ancient War"
#define GameName "R.A.W. Realms of Ancient War"
#define exeName "Realms Of Ancient War - Config.exe"
#define exeDir "\"

;#define NeedSize "7516192768"

#define NeedMem 512

;#define SecondProgressBar

;#define Components

;#define records

#define facompress

;#define PrecompInside
;#define SrepInside
;#define MSCInside
;#define precomp "0.40"
;#define unrar
;#define XDelta
;#define PackZIP

[Setup]
AppName={#MyAppName}
AppVerName={#MyAppName}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputDir=.
OutputBaseFilename=setup
SetupIconFile=C:\Users\Max\Desktop\ISDone0.6final\Session Manager.ico
WizardImageFile=wizardimage.bmp
WizardSmallImageFile=wizardsmallimage.bmp
AllowNoIcons=True
#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; 
Name: text\eng; Description: Àíãëèéñêèé; Flags: exclusive;
#endif
           
[Messages]
DiskSpaceMBLabel=Äëÿ óñòàíîâêè ïîòðåáóåòñÿ ~1.5 Ãá ñâîáîäíîãî äèñêîâîãî ïðîñòðàíñòâà.
BeveledLabel=    MC_WRX

;[Registry]
; ôàéë ñîçäàí ïðîãðàììîé Converter v.0.1.4 - 28 èþëÿ 2012ã., â 21 ÷àñ. 24 ìèí. 44 ñåê.
;Root: HKLM; SubKey: SOFTWARE\Wow6432Node\Activision\Prototype 2; ValueType: string; ValueName: InstallPath; ValueData: D:\Games\Prototype 2; Flags: uninsdeletevalue uninsdeletekeyifempty
;Root: HKLM; SubKey: SOFTWARE\Wow6432Node\Activision\Prototype 2; ValueType: string; ValueName: SPExePath; ValueData: D:\Games\Prototype 2\prototype2.exe; Flags: uninsdeletevalue uninsdeletekeyifempty
;Root: HKLM; SubKey: SOFTWARE\Wow6432Node\Activision\Prototype 2; ValueType: string; ValueName: Version; ValueData: 1.0; Flags: uninsdeletevalue uninsdeletekeyifempty
;Root: HKLM; SubKey: SOFTWARE\Wow6432Node\Activision\Prototype 2; ValueType: string; ValueName: language; ValueData: 69; Flags: uninsdeletevalue uninsdeletekeyifempty
; çàòðà÷åííîå âðåìÿ: 31 ìñåê.

[Icons]
Name: {userdesktop}\{#GameName}; Filename: {app}\{#exeName}; WorkingDir: {app}\; Tasks: icons\Desktop; Comment: {#GameName}; Check: CheckError

[Tasks]
Name: icon; Description: {cm:Icons}
Name: icons\Desktop; Description: {cm:DesktopIcons}
Name: Soft; Description: Óñòàíîâêà äîï. ÏÎ
Name: Soft\DirectX; Description: Óñòàíîâèòü/Îáíîâèòü DirectX
Name: Soft\VCRedist; Description: Óñòàíîâèòü Microsoft Visual C++

[Run]
Filename: {src}\Redist\dxwebsetup.exe; Parameters: /q; WorkingDir: {src}\Redist\; Tasks: Soft\DirectX; Check: CheckError
Filename: {src}\Redist\vcredist_x86.exe; Parameters: /q; WorkingDir: {src}\Redist\; Tasks: Soft\VCRedist; Check: not IsWin64 and CheckError
Filename: {src}\Redist\vcredist_x64.exe; Parameters: /q; WorkingDir: {src}\Redist\; Tasks: Soft\VCRedist; Check: IsWin64 and CheckError

[Files]
Source: "C:\Users\Max\Desktop\ISDone0.6final\logo.png"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression   
Source: "C:\Users\Max\Desktop\ISDone0.6final\wizardimage.bmp"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "isgsg.dll"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: Include\English.ini; DestDir: {tmp}; Flags: dontcopy
Source: Include\unarc.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy
#ifdef records
Source: "C:\Users\Max\Desktop\ISDone0.6final\records.inf"; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef PrecompInside
Source: Include\CLS-precomp.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\packjpg_dll1.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef SrepInside
Source: Include\CLS-srep.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef MSCInside
Source: Include\CLS-MSC.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef facompress
Source: Include\facompress.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp
  #if precomp == "0.38"
  Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
  #else
    #if precomp == "0.4"
    Source: Include\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
    #else
      #if precomp == "0.41"
      Source: Include\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
      #else
        #if precomp == "0.42"
        Source: Include\precomp042.exe; DestDir: {tmp}; Flags: dontcopy
        #else
        Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
        Source: Include\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
        Source: Include\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
        Source: Include\precomp042.exe; DestDir: {tmp}; Flags: dontcopy
        #endif
      #endif
    #endif
  #endif
#endif
#ifdef unrar
Source: Include\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef XDelta
Source: Include\XDelta3.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef PackZIP
Source: Include\7z.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\packZIP.exe; DestDir: {tmp}; Flags: dontcopy
#endif

[CustomMessages]
russian.ExtractedFile=Èçâëåêàåòñÿ ôàéë:
russian.Extracted=Ðàñïàêîâêà àðõèâîâ...
russian.CancelButton=Îòìåíèòü ðàñïàêîâêó
russian.Error=Îøèáêà ðàñïàêîâêè!
russian.ElapsedTime=Ïðîøëî:
russian.RemainingTime=Îñòàëîñü âðåìåíè:
russian.EstimatedTime=Âñåãî:
russian.AllElapsedTime=Âðåìÿ óñòàíîâêè:

russian.RunGame=Çàïóñòèòü èãðó
russian.UninsGame=Óäàëèòü

russian.Icons=ßðëûêè:
russian.DesktopIcons=Ñîçäàòü ÿðëûê íà ðàáî÷åì ñòîëå
russian.StartMenuIcons=Ñîçäàòü ÿðëûê â ìåíþ ïóñê

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

[UninstallDelete]
Type: filesandordirs; Name: {app}

[Code ]
{ RedesignWizardFormBegin } // Don't remove this line!
// Don't modify this section. It is generated automatically.
var
  OldEvent_NextButtonClick2: TNotifyEvent;
  OldEvent_BackButtonClick2: TNotifyEvent;

procedure WizardFormCreate(Sender: TObject); forward;
procedure _NextButtonClick2(Sender: TObject); forward;
procedure _BackButtonClick2(Sender: TObject); forward;

procedure RedesignWizardForm;
begin
  with WizardForm do
  begin
    OnCreate := @WizardFormCreate;
  end;

  with WizardForm.CancelButton do
  begin
    Left := ScaleX(376);
  end;

  with WizardForm.NextButton do
  begin
    Left := ScaleX(287);
    OldEvent_NextButtonClick2 := OnClick;
    OnClick := @_NextButtonClick2;
  end;

  with WizardForm.BackButton do
  begin
    Left := ScaleX(198);
    OldEvent_BackButtonClick2 := OnClick;
    OnClick := @_BackButtonClick2;
  end;

{ ReservationBegin }
  // This part is for you. Add your specialized code here.

{ ReservationEnd }
end;
// Don't modify this section. It is generated automatically.
{ RedesignWizardFormEnd } // Don't remove this line!

procedure _BackButtonClick2(Sender: TObject);
begin
  OldEvent_BackButtonClick2(Sender);
end;

procedure WizardFormCreate(Sender: TObject);
begin

end;

procedure _NextButtonClick2(Sender: TObject);
begin
  OldEvent_NextButtonClick2(Sender);
end;

function GetWindowLong(hWnd: HWND; nIndex: Integer): Longint; external 'GetWindowLongA@user32.dll stdcall delayload';
function ssInitialize(hParent:HWND;ssTimeShow:integer;FadeOut:boolean;StretchMode:integer;BkgColor:DWORD):boolean; external 'ssInitialize@files:isgsg.dll stdcall delayload';
procedure ssDeInitialize; external 'ssDeInitialize@files:isgsg.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';

procedure InitializeWizard2;
begin
  RedesignWizardForm;
  with Wizardform.WizardSmallBitmapImage do begin
   Width := WizardForm.MainPanel.Width;
   Left := WizardForm.MainPanel.Left;
end;
  Wizardform.PageNameLabel.Hide;
  Wizardform.PageDescriptionLabel.Hide;

  ExtractTemporaryFile('logo.png');
  ExtractTemporaryFile('wizardimage.bmp');
  ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}')+'\logo.png',1000,3000,1000,0,255,False,$FFFFFF,10);
  ssInitialize(GetWindowLong(MainForm.Handle,-8),0,False,2,$FF000000);
  
  WizardForm.WizardBitmapImage.Width:= ScaleX(497);
  WizardForm.WizardBitmapImage2.Width:= ScaleX(497);
  WizardForm.WizardBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\wizardimage.bmp'));
  WizardForm.WizardBitmapImage2.Bitmap.LoadFromFile(ExpandConstant('{tmp}\wizardimage.bmp'));

  WizardForm.WelcomeLabel1.Hide;
  WizardForm.WelcomeLabel2.Hide;
  WizardForm.FinishedLabel.Hide;
  WizardForm.FinishedHeadingLabel.Hide;
end;

procedure DeinitializeSetup2;
begin
  ssDeInitialize;
end;

const
  PCFonFLY=true;
  notPCFonFLY=false;
var
  LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2,LabelTime3: TLabel;
  ISDoneProgressBar1: TNewProgressBar;
#ifdef SecondProgressBar
  LabelPct2: TLabel;
  ISDoneProgressBar2:TNewProgressBar;
#endif
  MyCancelButton: TButton;
  ISDoneCancel:integer;
  ISDoneError:boolean;
  PCFVer:double;

type
  TCallback = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;

function WrapCallback(callback:TCallback; paramcount:integer):longword;external 'wrapcallback@files:ISDone.dll stdcall delayload';

function ISArcExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath, ExtractedPath: AnsiString; DeleteInFile:boolean; Password, CfgFile, WorkPath: AnsiString; ExtractPCF: boolean ):boolean; external 'ISArcExtract@files:ISDone.dll stdcall delayload';
function IS7ZipExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean; external 'IS7zipExtract@files:ISDone.dll stdcall delayload';
function ISRarExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean; external 'ISRarExtract@files:ISDone.dll stdcall delayload';
function ISPrecompExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISPrecompExtract@files:ISDone.dll stdcall delayload';
function ISSRepExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISSrepExtract@files:ISDone.dll stdcall delayload';
function ISxDeltaExtract(CurComponent:Cardinal; PctOfTotal:double; minRAM,maxRAM:integer; InName, DiffFile, OutFile: AnsiString; DeleteInFile, DeleteDiffFile:boolean):boolean; external 'ISxDeltaExtract@files:ISDone.dll stdcall delayload';
function ISPackZIP(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString;ComprLvl:integer; DeleteInFile:boolean):boolean; external 'ISPackZIP@files:ISDone.dll stdcall delayload';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):boolean; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall delayload';

function Exec2 (FileName, Param: PAnsiChar;Show:boolean):boolean; external 'Exec2@files:ISDone.dll stdcall delayload';
function ISFindFiles(CurComponent:Cardinal; FileMask:AnsiString; var ColFiles:integer):integer; external 'ISFindFiles@files:ISDone.dll stdcall delayload';
function ISPickFilename(FindHandle:integer; OutPath:AnsiString; var CurIndex:integer; DeleteInFile:boolean):boolean; external 'ISPickFilename@files:ISDone.dll stdcall delayload';
function ISGetName(TypeStr:integer):PAnsichar; external 'ISGetName@files:ISDone.dll stdcall delayload';
function ISFindFree(FindHandle:integer):boolean; external 'ISFindFree@files:ISDone.dll stdcall delayload';
function ISExec(CurComponent:Cardinal; PctOfTotal,SpecifiedProcessTime:double; ExeName,Parameters,TargetDir,OutputStr:AnsiString;Show:boolean):boolean; external 'ISExec@files:ISDone.dll stdcall delayload';

function SrepInit(TmpPath:PAnsiChar;VirtMem,MaxSave:Cardinal):boolean; external 'SrepInit@files:ISDone.dll stdcall delayload';
function PrecompInit(TmpPath:PAnsiChar;VirtMem:cardinal;PrecompVers:single):boolean; external 'PrecompInit@files:ISDone.dll stdcall delayload';
function FileSearchInit(RecursiveSubDir:boolean):boolean; external 'FileSearchInit@files:ISDone.dll stdcall delayload';
function ISDoneInit(RecordFileName:AnsiString; TimeType,Comp1,Comp2,Comp3:Cardinal; WinHandle, NeededMem:longint; callback:TCallback):boolean; external 'ISDoneInit@files:ISDone.dll stdcall';
function ISDoneStop:boolean; external 'ISDoneStop@files:ISDone.dll stdcall';
function ChangeLanguage(Language:AnsiString):boolean; external 'ChangeLanguage@files:ISDone.dll stdcall delayload';
function SuspendProc:boolean; external 'SuspendProc@files:ISDone.dll stdcall';
function ResumeProc:boolean; external 'ResumeProc@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:=ExpandConstant('{cm:ExtractedFile} ')+MinimizePathName(CurrentFile, LabelCurrFileName.Font, LabelCurrFileName.Width-ScaleX(100));
  LabelTime1.Caption:=ExpandConstant('{cm:ElapsedTime} ')+TimeStr2;
  LabelTime2.Caption:=ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
  Result := ISDoneCancel;
end;

procedure CancelButtonOnClick(Sender: TObject);
begin
  SuspendProc;
  if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then ISDoneCancel:=1;
  ResumeProc;
end;

procedure HideControls;
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 CreateControls;
var PBTop:integer;
begin
  PBTop:=ScaleY(50);
  ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
  with ISDoneProgressBar1 do begin
    Parent   := WizardForm.InstallingPage;
    Height   := WizardForm.ProgressGauge.Height;
    Left     := ScaleX(0);
    Top      := PBTop;
    Width    := ScaleX(365);
    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(2);
    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      := ScaleY(30);
  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(0);
    Top      := PBTop + ScaleY(35);
  end;
  LabelTime2 := TLabel.Create(WizardForm);
  with LabelTime2 do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := LabelTime1.Width+ScaleX(40);
    Left     := ISDoneProgressBar1.Width div 2;
    Top      := LabelTime1.Top;
  end;
  MyCancelButton:=TButton.Create(WizardForm);
  with MyCancelButton do begin
    Parent:=WizardForm;
    Width:=ScaleX(135);
    Caption:=ExpandConstant('{cm:CancelButton}');
    Left:=ScaleX(360);
    Top:=WizardForm.cancelbutton.top;
    OnClick:=@CancelButtonOnClick;
  end;
end;

Procedure CurPageChanged2(CurPageID: Integer);
Begin
  if (CurPageID = wpFinished) and ISDoneError then
  begin
    WizardForm.Caption:= ExpandConstant('{cm:Error}');
    WizardForm.FinishedLabel.Font.Color:= clRed;
    WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
  end;
end;

function CheckError:boolean;
begin
  result:= not ISDoneError;
end;

procedure CurStepChanged2(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:cardinal;
    FindHandle1,ColFiles1,CurIndex1,tmp:integer;
    ExecError:boolean;
    InFilePath,OutFilePath,OutFileName:PAnsiChar;
begin
  if CurStep = ssInstall then begin  //Åñëè íåîáõîäèìî, ìîæíî ïîìåíÿòü íà ssPostInstall
    WizardForm.ProgressGauge.Hide;
    WizardForm.CancelButton.Hide;
    CreateControls;
    WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
    ISDoneCancel:=0;

// Ðàñïàêîâêà âñåõ íåîáõîäèìûõ ôàéëîâ â ïàïêó {tmp}.

ExtractTemporaryFile('unarc.dll');

#ifdef PrecompInside
ExtractTemporaryFile('CLS-precomp.dll');
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('packjpg_dll1.dll');
ExtractTemporaryFile('precomp.exe');
ExtractTemporaryFile('zlib1.dll');
#endif
#ifdef SrepInside
ExtractTemporaryFile('CLS-srep.dll');
#endif
#ifdef MSCInside
ExtractTemporaryFile('CLS-MSC.dll');
#endif
#ifdef facompress
    ExtractTemporaryFile('facompress.dll'); //óñêîðÿåò ðàñïàêîâêó .arc àðõèâîâ.
#endif
#ifdef records
    ExtractTemporaryFile('records.inf');
#endif
#ifdef precomp
  #if precomp == "0.38"
    ExtractTemporaryFile('precomp038.exe');
  #else
    #if precomp == "0.4"
      ExtractTemporaryFile('precomp040.exe');
    #else
      #if precomp == "0.41"
        ExtractTemporaryFile('precomp041.exe');
      #else
        #if precomp == "0.42"
          ExtractTemporaryFile('precomp042.exe');
        #else
          ExtractTemporaryFile('precomp038.exe');
          ExtractTemporaryFile('precomp040.exe');
          ExtractTemporaryFile('precomp041.exe');
          ExtractTemporaryFile('precomp042.exe');
        #endif
      #endif
    #endif
  #endif
#endif
#ifdef unrar
    ExtractTemporaryFile('Unrar.dll');
#endif
#ifdef XDelta
    ExtractTemporaryFile('XDelta3.dll');
#endif
#ifdef PackZIP
    ExtractTemporaryFile('7z.dll');
    ExtractTemporaryFile('PackZIP.exe');
#endif

    ExtractTemporaryFile('English.ini');

// Ïîäãîòàâëèâàåì ïåðåìåííóþ, ñîäåðæàùóþ âñþ èíôîðìàöèþ î âûäåëåííûõ êîìïîíåíòàõ äëÿ 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
//  .....
// ñì. ñïðàâêó
#endif

#ifdef precomp
  PCFVer:={#precomp};
#else
  PCFVer:=0;
#endif
    ISDoneError:=true;
    if ISDoneInit(ExpandConstant('{src}\records.inf'), $F777, Comps1,Comps2,Comps3, MainForm.Handle, {#NeedMem}, @ProgressCallback) then begin
      repeat
//        ChangeLanguage('English');
        if not SrepInit('',512,0) then break;
        if not PrecompInit('',128,0.40) then break;
        if not FileSearchInit(false) then break;
        
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\setup-1.bin'), ExpandConstant('{app}\Dx9\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\setup-2.bin'), ExpandConstant('{app}\Dx9\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\videos.bin'), ExpandConstant('{app}\Dx9\Videos\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\setup-3.bin'), ExpandConstant('{app}\'), '', false, '', '', '', notPCFonFLY) then break;
(*      if not ISArcExtract ( 0, 0, ExpandConstant('{src}\setup4.bin'), ExpandConstant('{app}\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 1, 0, ExpandConstant('{src}\rus.bin'), ExpandConstant('{app}\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 2, 0, ExpandConstant('{src}\eng.bin'), ExpandConstant('{app}'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\sd-6.bin'), ExpandConstant('{app}'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\sd-7.bin'), ExpandConstant('{app}\Data\Audio\HK\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\sd-8.bin'), ExpandConstant('{app}\Data\Audio\HK\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\sd-9.bin'), ExpandConstant('{app}\Data\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\ds2-4.bin'), ExpandConstant('{app}'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
        if not ISSRepExtract( 0, 0, ExpandConstant('{app}\anim_streams.srep'),ExpandConstant('{app}\anim_streams.pcf'), true                         ) then break;
        if not ISPrecompExtract ( 0, 0, ExpandConstant('{app}\anim_streams.pcf'), ExpandConstant('{app}\media\anim_streams.upak'), true                         ) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\ds2-5.bin'), ExpandConstant('{app}'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
        if not ISSRepExtract( 0, 0, ExpandConstant('{app}\maps.srep'),ExpandConstant('{app}\maps.pcf'), true                         ) then break;
        if not ISPrecompExtract ( 0, 0, ExpandConstant('{app}\maps.pcf'), ExpandConstant('{app}\media\maps.upak'), true                         ) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\ds2-6.bin'), ExpandConstant('{app}'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
        if not ISSRepExtract( 0, 0, ExpandConstant('{app}\media.srep'),ExpandConstant('{app}\media.pcf'), true                         ) then break;
        if not ISPrecompExtract ( 0, 0, ExpandConstant('{app}\media.pcf'), ExpandConstant('{app}\media\media.upak'), true                         ) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\ds2-7.bin'), ExpandConstant('{app}\media\sounds_streamed\PC\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\ds2-8.bin'), ExpandConstant('{app}\media\sounds_streamed\PC\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\ds2-9.bin'), ExpandConstant('{app}\media\video\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\ds2-10.bin'), ExpandConstant('{app}\media\video\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\ds2-11.bin'), ExpandConstant('{app}\media\video\'), '', false, '', '', '', notPCFonFLY) then break;
*)
        
        
        //if not ISArcExtract ( 0, 0, ExpandConstant('{app}\files.bin'),ExpandConstant('{app}\'), '', true, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
        //if not ISArcExtract ( 0, 0, ExpandConstant('{src}\setup7.bin'), ExpandConstant('{app}'), '', false, '', '', '', notPCFonFLY) then break;

//      if not ISArcExtract ( 0, 0, ExpandConstant('{app}\file.bin'), ExpandConstant('{app}\'), '', true, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
//      if not ISArcExtract ( 0, 0, ExpandConstant('{src}\DLC1.arc'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
//      if not ISSRepExtract( 0, 0, ExpandConstant('{app}\DLC.srep'),ExpandConstant('{app}\DLC.pcf'), true                         ) then break;
//      if not ISPrecompExtract ( 0, 0, ExpandConstant('{app}\DLC.pcf'), ExpandConstant('{app}\DLC.arc'), true                         ) then break;
//      if not ISArcExtract ( 0, 0, ExpandConstant('{app}\DLC.arc'), ExpandConstant('{app}\DLC\'), '', true, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;

//      if not ISArcExtract ( 0, 0, ExpandConstant('{src}\envs.arc'), ExpandConstant('{app}\envs.srep'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
//      if not ISSRepExtract ( 0, 0, ExpandConstant('{src}\envs.srep'), ExpandConstant('{app}\envs.pcf'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
//      if not ISPrecompExtract ( 0, 0, ExpandConstant('{src}\envs.pcf'), ExpandConstant('{app}\'), '', false, '', '', ExpandConstant('{app}\Sounds.arc'), notPCFonFLY {PCFonFLY}) then break;
//      if not ISArcExtract ( 0, 0, ExpandConstant('{src}\Sounds.arc'), ExpandConstant('{app}\Sounds.srep'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
//      if not ISSRepExtract ( 0, 0, ExpandConstant('{src}\Sounds.srep'), ExpandConstant('{app}\Sounds.pcf'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
//      if not ISPrecompExtract ( 0, 0, ExpandConstant('{src}\Sounds.pcf'), ExpandConstant('{app}\'), '', false, '', '', ExpandConstant('{app}\TheBlob.arc'), notPCFonFLY {PCFonFLY}) then break;
//      if not ISArcExtract ( 0, 0, ExpandConstant('{src}\TheBlob.arc'), ExpandConstant('{app}\TheBlob.srep'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
//      if not ISPrecompExtract ( 0, 0, ExpandConstant('{src}\TheBlob.pcf'), ExpandConstant('{app}\envs\'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;

//    äàëåå íàõîäÿòñÿ çàêîììåíòèðîâàíûå ïðèìåðû ðàçëè÷íûõ ôóíêöèé ðàñïàêîâêè (÷òîáû êàæäûé ðàç íå ëàçèòü â ñïðàâêó çà ïðèìåðàìè)
(*
        if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\arc.arc'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
        if not IS7ZipExtract   ( 0, 0, ExpandConstant('{src}\CODMW2.7z'), ExpandConstant('{app}\data1'), false, '') then break;
        if not ISRarExtract    ( 0, 0, ExpandConstant('{src}\data_*.rar'), ExpandConstant('{app}'), false, '') then break;
        if not ISSRepExtract   ( 0, 0, ExpandConstant('{app}\data1024_1024.srep'),ExpandConstant('{app}\data1024.arc'), true) then break;
        if not ISPrecompExtract( 0, 0, ExpandConstant('{app}\data.pcf'),    ExpandConstant('{app}\data.7z'), true) then break;
        if not ISxDeltaExtract ( 0, 0, 0, 640, ExpandConstant('{app}\in.pcf'), ExpandConstant('{app}\*.diff'),   ExpandConstant('{app}\out.dat'), false, false) then break;
        if not ISPackZIP       ( 0, 0, ExpandConstant('{app}\1a1\*'), ExpandConstant('{app}\1a1.pak'), 2, false ) then break;
        if not ISExec          ( 0, 0, 0, ExpandConstant('{tmp}\Arc.exe'), ExpandConstant('x -o+ "{src}\001.arc" "{app}\"'), ExpandConstant('{tmp}'), '...',false) then break;
        if not ShowChangeDiskWindow ('Ïîæàëóéñòà, âñòàâüòå âòîðîé äèñê è äîæäèòåñü åãî èíèöèàëèçàöèè.', ExpandConstant('{src}'),'CODMW_2.arc') then break;

//    ðàñïàêîâêà ãðóïïû ôàéëîâ ïîñðåäñòâîì âíåøíåãî ïðèëîæåíèÿ

        FindHandle1:=ISFindFiles(0,ExpandConstant('{app}\*.ogg'),ColFiles1);
        ExecError:=false;
        while not ExecError and ISPickFilename(FindHandle1,ExpandConstant('{app}\'),CurIndex1,true) do begin
          InFilePath:=ISGetName(0);
          OutFilePath:=ISGetName(1);
          OutFileName:=ISGetName(2);
          ExecError:=not ISExec(0, 0, 0, ExpandConstant('{tmp}\oggdec.exe'), '"'+InFilePath+'" -w "'+OutFilePath+'"',ExpandConstant('{tmp}'),OutFileName,false);
        end;
        ISFindFree(FindHandle1);
        if ExecError then break;
*)

        ISDoneError:=false;
      until true;
      ISDoneStop;
    end;
    HideControls;
    WizardForm.CancelButton.Visible:=true;
    WizardForm.CancelButton.Enabled:=false;
  end;
  if (CurStep=ssPostInstall) and ISDoneError then begin
    Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
  end;
end;

[ISFormDesigner]
WizardForm=FF0A005457495A415244464F524D0030105003000054504630F10B5457697A617264466F726D0A57697A617264466F726D0C436C69656E744865696768740368010B436C69656E74576964746803F101084F6E437265617465071057697A617264466F726D4372656174650C4578706C696369744C65667402000B4578706C69636974546F7002000D4578706C6963697457696474680301020E4578706C69636974486569676874038F010D506978656C73506572496E636802600A54657874486569676874020D00F10A544E6577427574746F6E0C43616E63656C427574746F6E044C6566740378010C4578706C696369744C6566740378010000F10A544E6577427574746F6E0A4E657874427574746F6E044C656674031F01074F6E436C69636B07105F4E657874427574746F6E436C69636B0C4578706C696369744C656674031F010000F10A544E6577427574746F6E0A4261636B427574746F6E044C65667403C600074F6E436C69636B07105F4261636B427574746F6E436C69636B0C4578706C696369744C65667403C6000000F10C544E65774E6F7465626F6F6B0D4F757465724E6F7465626F6F6B00F110544E65774E6F7465626F6F6B506167650B57656C636F6D65506167650D4578706C69636974576964746803F1010E4578706C696369744865696768740339010000F110544E65774E6F7465626F6F6B5061676509496E6E6572506167650D4578706C69636974576964746803F1010E4578706C6963697448656967687403390100F10C544E65774E6F7465626F6F6B0D496E6E65724E6F7465626F6F6B00F110544E65774E6F7465626F6F6B506167650B4C6963656E7365506167650D4578706C69636974576964746803A1010E4578706C6963697448656967687403ED000000F110544E65774E6F7465626F6F6B506167650D53656C656374446972506167650D4578706C69636974576964746803A1010E4578706C6963697448656967687403ED000000F110544E65774E6F7465626F6F6B506167650E496E7374616C6C696E67506167650D4578706C69636974576964746803A1010E4578706C6963697448656967687403ED0000000000F110544E65774E6F7465626F6F6B506167650C46696E6973686564506167650D4578706C69636974576964746803F1010E4578706C6963697448656967687403390100000000



[Setup]


; --- Dispatching code ------------------------------------------------------------

[Code ]

function InitializeSetup(): Boolean;
begin
  Result := InitializeSetup1(); if not Result then exit;
end;

procedure DeinitializeSetup();
begin
  DeinitializeSetup1();
  DeinitializeSetup2();
end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
  Result := NextButtonClick2(CurPageID); if not Result then exit;
end;

function BackButtonClick(CurPageID: Integer): Boolean;
begin
  Result := BackButtonClick2(CurPageID); if not Result then exit;
end;

procedure InitializeWizard();
begin
  InitializeWizard2();
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  CurPageChanged2(CurPageID);
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  CurStepChanged2(CurStep);
end;
 

LexBell

Борода
Супер модератор
Вот на мой взгляд наиболее правильный принцип объединения функций и процедур:
Вопрос:
Я правильно понял, что процедуры InitializeWizard можно переименовать, а оставить только одну. И вот в неё вставить обращение к этим, переименованным. Причем, в коде сначала должны идти переименованные процедуры, а только потом главная, т.е. так как ты показал в своем примере. Или порядок не играет роли? Хотя нет, наверное порядок важен.
Ответ:
с процедурами - все правильно. переименовывая - ты вместо встроенной получаешь свои, которые вызываешь тогда, когда тебе нужно. с функциями-же - все совершенно неоднозначно. просто приведи содержимое своих функций и я покажу, как нужно сделать именно в твоем случае, поскольку с функциями всегда разное решение их объединения.
А модульное строение скрипта - это да, но от объединения все равно никуда не уйти, компилятор все равно обрабатывает все это как одну портянку, и соответственно дублирования не допустит.
Тоесть, в плане объединения функций невозможно что-то советовать не видя кода. с процедурами - проще: переименовал дублирующиеся и вызывай их когда тебе нужно. Более подробно описать объединение дублирующихся функций и процедур невозможно. Понять смысл объединения тоже невозможно до тех пор, пока не вобъешь себе в голову правильное понятие. Не объединение, а вызов нужной процедуры в нужный момент.
 

Devils Night

Ветеран
kkels, Блин за что ты так скрипт изуродовал :o?

Код:
[Setup]
; --- Source: ISDone_Example.iss ------------------------------------------------------------
#define MyAppName "R.A.W. Realms of Ancient War"
#define GameName "R.A.W. Realms of Ancient War"
#define exeName "Realms Of Ancient War - Config.exe"
#define exeDir "\"

;#define NeedSize "7516192768"

#define NeedMem 512

;#define SecondProgressBar

;#define Components

;#define records

#define facompress

;#define PrecompInside
;#define SrepInside
;#define MSCInside
;#define precomp "0.40"
;#define unrar
;#define XDelta
;#define PackZIP


AppName={#MyAppName}
AppVerName={#MyAppName}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputDir=.
OutputBaseFilename=setup
SetupIconFile=C:\Users\Max\Desktop\ISDone0.6final\Session Manager.ico
WizardImageFile=wizardimage.bmp
WizardSmallImageFile=wizardsmallimage.bmp
AllowNoIcons=True
#ifdef NeedSize
ExtraDiskSpaceRequired={#NeedSize}
#endif

#ifdef Components

[Types]
Name: full; Description: Full installation; Flags: iscustom

[Components]
Name: text; Description: ?cue noaoeo?ia; Types: full; Flags: fixed
Name: text\rus; Description: ?onneee; Flags: exclusive;
Name: text\eng; Description: Aiaeeeneee; Flags: exclusive;
#endif

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

[Messages]
DiskSpaceMBLabel=Aey onoaiiaee iio?aaoaony ~1.5 Aa naiaiaiiai aeneiaiai i?ino?ainoaa.
BeveledLabel=    MC_WRX

[CustomMessages]
russian.ExtractedFile=Ecaeaeaaony oaee:
russian.Extracted=?aniaeiaea a?oeaia...
russian.CancelButton=Ioiaieou ?aniaeiaeo
russian.Error=Ioeaea ?aniaeiaee!
russian.ElapsedTime=I?ioei:
russian.RemainingTime=Inoaeinu a?aiaie:
russian.EstimatedTime=Anaai:
russian.AllElapsedTime=A?aiy onoaiiaee:

russian.RunGame=Caionoeou ea?o
russian.UninsGame=Oaaeeou

russian.Icons=??euee:
russian.DesktopIcons=Nicaaou y?eue ia ?aai?ai noiea
russian.StartMenuIcons=Nicaaou y?eue a iai? ione


;[Registry]
; oaee nicaai i?ia?aiiie Converter v.0.1.4 - 28 e?ey 2012a., a 21 ?an. 24 iei. 44 nae.
;Root: HKLM; SubKey: SOFTWARE\Wow6432Node\Activision\Prototype 2; ValueType: string; ValueName: InstallPath; ValueData: D:\Games\Prototype 2; Flags: uninsdeletevalue uninsdeletekeyifempty
;Root: HKLM; SubKey: SOFTWARE\Wow6432Node\Activision\Prototype 2; ValueType: string; ValueName: SPExePath; ValueData: D:\Games\Prototype 2\prototype2.exe; Flags: uninsdeletevalue uninsdeletekeyifempty
;Root: HKLM; SubKey: SOFTWARE\Wow6432Node\Activision\Prototype 2; ValueType: string; ValueName: Version; ValueData: 1.0; Flags: uninsdeletevalue uninsdeletekeyifempty
;Root: HKLM; SubKey: SOFTWARE\Wow6432Node\Activision\Prototype 2; ValueType: string; ValueName: language; ValueData: 69; Flags: uninsdeletevalue uninsdeletekeyifempty
; cao?a?aiiia a?aiy: 31 inae.

[Icons]
Name: {userdesktop}\{#GameName}; Filename: {app}\{#exeName}; WorkingDir: {app}\; Tasks: icons\Desktop; Comment: {#GameName}; Check: CheckError
Name: {group}\Uninstall =ISSkin; Filename: {app}\unins000.exe

; The following code block is used to load the ISS, pass in
; an empty string ('') as the second parameter to LoadSkin to use
; the Blue color scheme, this is the default color scheme for
; Office2007.cjstyles.

[UninstallDelete]
Type: filesandordirs; Name: {app}

[Tasks]
Name: icon; Description: {cm:Icons}
Name: icons\Desktop; Description: {cm:DesktopIcons}
Name: Soft; Description: Onoaiiaea aii. II
Name: Soft\DirectX; Description: Onoaiiaeou/Iaiiaeou DirectX
Name: Soft\VCRedist; Description: Onoaiiaeou Microsoft Visual C++

[Run]
Filename: {src}\Redist\dxwebsetup.exe; Parameters: /q; WorkingDir: {src}\Redist\; Tasks: Soft\DirectX; Check: CheckError
Filename: {src}\Redist\vcredist_x86.exe; Parameters: /q; WorkingDir: {src}\Redist\; Tasks: Soft\VCRedist; Check: not IsWin64 and CheckError
Filename: {src}\Redist\vcredist_x64.exe; Parameters: /q; WorkingDir: {src}\Redist\; Tasks: Soft\VCRedist; Check: IsWin64 and CheckError

[Files]
; Add the ISSkin DLL used for skinning Inno Setup installations.
Source: "C:\Users\Max\Desktop\isskin\ISSkinEx.dll"; DestDir: {app}; Flags: dontcopy
;---------------------------------------------------------------------
; Add the Visual Style resource contains resources used for skinning,
; you can also use Microsoft Visual Styles (*.msstyles) resources.
Source: "C:\Users\Max\Desktop\isskin\ForestGreen.cjstyles"; DestDir: {tmp}; Flags: dontcopy
;---------------------------------------------------------------------

Source: "C:\Users\Max\Desktop\ISDone0.6final\logo.png"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "C:\Users\Max\Desktop\ISDone0.6final\wizardimage.bmp"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "isgsg.dll"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: Include\English.ini; DestDir: {tmp}; Flags: dontcopy
Source: Include\unarc.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy
#ifdef records
Source: "C:\Users\Max\Desktop\ISDone0.6final\records.inf"; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef PrecompInside
Source: Include\CLS-precomp.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\packjpg_dll1.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef SrepInside
Source: Include\CLS-srep.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef MSCInside
Source: Include\CLS-MSC.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef facompress
Source: Include\facompress.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp
  #if precomp == "0.38"
  Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
  #else
    #if precomp == "0.4"
    Source: Include\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
    #else
      #if precomp == "0.41"
      Source: Include\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
      #else
        #if precomp == "0.42"
        Source: Include\precomp042.exe; DestDir: {tmp}; Flags: dontcopy
        #else
        Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
        Source: Include\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
        Source: Include\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
        Source: Include\precomp042.exe; DestDir: {tmp}; Flags: dontcopy
        #endif
      #endif
    #endif
  #endif
#endif
#ifdef unrar
Source: Include\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef XDelta
Source: Include\XDelta3.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef PackZIP
Source: Include\7z.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\packZIP.exe; DestDir: {tmp}; Flags: dontcopy
#endif


[*Code]
{ RedesignWizardFormBegin } // Don't remove this line!
// Don't modify this section. It is generated automatically.
var
  OldEvent_NextButtonClick: TNotifyEvent;
  OldEvent_BackButtonClick: TNotifyEvent;

procedure WizardFormCreate(Sender: TObject); forward;
procedure _NextButtonClick(Sender: TObject); forward;
procedure _BackButtonClick(Sender: TObject); forward;

procedure RedesignWizardForm;
begin
  with WizardForm do
  begin
    OnCreate := @WizardFormCreate;
  end;

  with WizardForm.CancelButton do
  begin
    Left := ScaleX(376);
  end;

  with WizardForm.NextButton do
  begin
    Left := ScaleX(287);
    OldEvent_NextButtonClick := OnClick;
    OnClick := @_NextButtonClick;
  end;

  with WizardForm.BackButton do
  begin
    Left := ScaleX(198);
    OldEvent_BackButtonClick := OnClick;
    OnClick := @_BackButtonClick;
  end;

{ ReservationBegin }
  // This part is for you. Add your specialized code here.

{ ReservationEnd }
end;
// Don't modify this section. It is generated automatically.
{ RedesignWizardFormEnd } // Don't remove this line!

procedure _BackButtonClick(Sender: TObject);
begin
  OldEvent_BackButtonClick(Sender);
end;

procedure WizardFormCreate(Sender: TObject);
begin

end;

procedure _NextButtonClick(Sender: TObject);
begin
  OldEvent_NextButtonClick(Sender);
end;

function GetWindowLong(hWnd: HWND; nIndex: Integer): Longint; external 'GetWindowLongA@user32.dll stdcall delayload';
function ssInitialize(hParent:HWND;ssTimeShow:integer;FadeOut:boolean;StretchMode:integer;BkgColor:DWORD):boolean; external 'ssInitialize@files:isgsg.dll stdcall delayload';
procedure ssDeInitialize; external 'ssDeInitialize@files:isgsg.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';

procedure InitializeWizard;
begin
  RedesignWizardForm;
  with Wizardform.WizardSmallBitmapImage do begin
   Width := WizardForm.MainPanel.Width;
   Left := WizardForm.MainPanel.Left;
end;
  Wizardform.PageNameLabel.Hide;
  Wizardform.PageDescriptionLabel.Hide;

  ExtractTemporaryFile('logo.png');
  ExtractTemporaryFile('wizardimage.bmp');
  ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}')+'\logo.png',1000,3000,1000,0,255,False,$FFFFFF,10);
  ssInitialize(GetWindowLong(MainForm.Handle,-8),0,False,2,$FF000000);

  WizardForm.WizardBitmapImage.Width:= ScaleX(497);
  WizardForm.WizardBitmapImage2.Width:= ScaleX(497);
  WizardForm.WizardBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\wizardimage.bmp'));
  WizardForm.WizardBitmapImage2.Bitmap.LoadFromFile(ExpandConstant('{tmp}\wizardimage.bmp'));

  WizardForm.WelcomeLabel1.Hide;
  WizardForm.WelcomeLabel2.Hide;
  WizardForm.FinishedLabel.Hide;
  WizardForm.FinishedHeadingLabel.Hide;
end;


const
  PCFonFLY=true;
  notPCFonFLY=false;
var
  LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2,LabelTime3: TLabel;
  ISDoneProgressBar1: TNewProgressBar;
#ifdef SecondProgressBar
  LabelPct2: TLabel;
  ISDoneProgressBar2:TNewProgressBar;
#endif
  MyCancelButton: TButton;
  ISDoneCancel:integer;
  ISDoneError:boolean;
  PCFVer:double;

type
  TCallback = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;

function WrapCallback(callback:TCallback; paramcount:integer):longword;external 'wrapcallback@files:ISDone.dll stdcall delayload';

function ISArcExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath, ExtractedPath: AnsiString; DeleteInFile:boolean; Password, CfgFile, WorkPath: AnsiString; ExtractPCF: boolean ):boolean; external 'ISArcExtract@files:ISDone.dll stdcall delayload';
function IS7ZipExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean; external 'IS7zipExtract@files:ISDone.dll stdcall delayload';
function ISRarExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean; external 'ISRarExtract@files:ISDone.dll stdcall delayload';
function ISPrecompExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISPrecompExtract@files:ISDone.dll stdcall delayload';
function ISSRepExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISSrepExtract@files:ISDone.dll stdcall delayload';
function ISxDeltaExtract(CurComponent:Cardinal; PctOfTotal:double; minRAM,maxRAM:integer; InName, DiffFile, OutFile: AnsiString; DeleteInFile, DeleteDiffFile:boolean):boolean; external 'ISxDeltaExtract@files:ISDone.dll stdcall delayload';
function ISPackZIP(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString;ComprLvl:integer; DeleteInFile:boolean):boolean; external 'ISPackZIP@files:ISDone.dll stdcall delayload';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):boolean; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall delayload';

function Exec2 (FileName, Param: PAnsiChar;Show:boolean):boolean; external 'Exec2@files:ISDone.dll stdcall delayload';
function ISFindFiles(CurComponent:Cardinal; FileMask:AnsiString; var ColFiles:integer):integer; external 'ISFindFiles@files:ISDone.dll stdcall delayload';
function ISPickFilename(FindHandle:integer; OutPath:AnsiString; var CurIndex:integer; DeleteInFile:boolean):boolean; external 'ISPickFilename@files:ISDone.dll stdcall delayload';
function ISGetName(TypeStr:integer):PAnsichar; external 'ISGetName@files:ISDone.dll stdcall delayload';
function ISFindFree(FindHandle:integer):boolean; external 'ISFindFree@files:ISDone.dll stdcall delayload';
function ISExec(CurComponent:Cardinal; PctOfTotal,SpecifiedProcessTime:double; ExeName,Parameters,TargetDir,OutputStr:AnsiString;Show:boolean):boolean; external 'ISExec@files:ISDone.dll stdcall delayload';

function SrepInit(TmpPath:PAnsiChar;VirtMem,MaxSave:Cardinal):boolean; external 'SrepInit@files:ISDone.dll stdcall delayload';
function PrecompInit(TmpPath:PAnsiChar;VirtMem:cardinal;PrecompVers:single):boolean; external 'PrecompInit@files:ISDone.dll stdcall delayload';
function FileSearchInit(RecursiveSubDir:boolean):boolean; external 'FileSearchInit@files:ISDone.dll stdcall delayload';
function ISDoneInit(RecordFileName:AnsiString; TimeType,Comp1,Comp2,Comp3:Cardinal; WinHandle, NeededMem:longint; callback:TCallback):boolean; external 'ISDoneInit@files:ISDone.dll stdcall';
function ISDoneStop:boolean; external 'ISDoneStop@files:ISDone.dll stdcall';
function ChangeLanguage(Language:AnsiString):boolean; external 'ChangeLanguage@files:ISDone.dll stdcall delayload';
function SuspendProc:boolean; external 'SuspendProc@files:ISDone.dll stdcall';
function ResumeProc:boolean; external 'ResumeProc@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:=ExpandConstant('{cm:ExtractedFile} ')+MinimizePathName(CurrentFile, LabelCurrFileName.Font, LabelCurrFileName.Width-ScaleX(100));
  LabelTime1.Caption:=ExpandConstant('{cm:ElapsedTime} ')+TimeStr2;
  LabelTime2.Caption:=ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
  Result := ISDoneCancel;
end;

procedure CancelButtonOnClick(Sender: TObject);
begin
  SuspendProc;
  if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then ISDoneCancel:=1;
  ResumeProc;
end;

procedure HideControls;
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 CreateControls;
var PBTop:integer;
begin
  PBTop:=ScaleY(50);
  ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
  with ISDoneProgressBar1 do begin
    Parent   := WizardForm.InstallingPage;
    Height   := WizardForm.ProgressGauge.Height;
    Left     := ScaleX(0);
    Top      := PBTop;
    Width    := ScaleX(365);
    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(2);
    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      := ScaleY(30);
  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(0);
    Top      := PBTop + ScaleY(35);
  end;
  LabelTime2 := TLabel.Create(WizardForm);
  with LabelTime2 do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := LabelTime1.Width+ScaleX(40);
    Left     := ISDoneProgressBar1.Width div 2;
    Top      := LabelTime1.Top;
  end;
  MyCancelButton:=TButton.Create(WizardForm);
  with MyCancelButton do begin
    Parent:=WizardForm;
    Width:=ScaleX(135);
    Caption:=ExpandConstant('{cm:CancelButton}');
    Left:=ScaleX(360);
    Top:=WizardForm.cancelbutton.top;
    OnClick:=@CancelButtonOnClick;
  end;
end;

Procedure CurPageChanged(CurPageID: Integer);
Begin
  if (CurPageID = wpFinished) and ISDoneError then
  begin
    WizardForm.Caption:= ExpandConstant('{cm:Error}');
    WizardForm.FinishedLabel.Font.Color:= clRed;
    WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
  end;
end;

function CheckError:boolean;
begin
  result:= not ISDoneError;
end;

procedure CurStepChanged(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:cardinal;
    FindHandle1,ColFiles1,CurIndex1,tmp:integer;
    ExecError:boolean;
    InFilePath,OutFilePath,OutFileName:PAnsiChar;
begin
  if CurStep = ssInstall then begin  //Anee iaiaoiaeii, ii?ii iiiaiyou ia ssPostInstall
    WizardForm.ProgressGauge.Hide;
    WizardForm.CancelButton.Hide;
    CreateControls;
    WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
    ISDoneCancel:=0;

// ?aniaeiaea anao iaiaoiaeiuo oaeeia a iaieo {tmp}.

ExtractTemporaryFile('unarc.dll');

#ifdef PrecompInside
ExtractTemporaryFile('CLS-precomp.dll');
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('packjpg_dll1.dll');
ExtractTemporaryFile('precomp.exe');
ExtractTemporaryFile('zlib1.dll');
#endif
#ifdef SrepInside
ExtractTemporaryFile('CLS-srep.dll');
#endif
#ifdef MSCInside
ExtractTemporaryFile('CLS-MSC.dll');
#endif
#ifdef facompress
    ExtractTemporaryFile('facompress.dll'); //onei?yao ?aniaeiaeo .arc a?oeaia.
#endif
#ifdef records
    ExtractTemporaryFile('records.inf');
#endif
#ifdef precomp
  #if precomp == "0.38"
    ExtractTemporaryFile('precomp038.exe');
  #else
    #if precomp == "0.4"
      ExtractTemporaryFile('precomp040.exe');
    #else
      #if precomp == "0.41"
        ExtractTemporaryFile('precomp041.exe');
      #else
        #if precomp == "0.42"
          ExtractTemporaryFile('precomp042.exe');
        #else
          ExtractTemporaryFile('precomp038.exe');
          ExtractTemporaryFile('precomp040.exe');
          ExtractTemporaryFile('precomp041.exe');
          ExtractTemporaryFile('precomp042.exe');
        #endif
      #endif
    #endif
  #endif
#endif
#ifdef unrar
    ExtractTemporaryFile('Unrar.dll');
#endif
#ifdef XDelta
    ExtractTemporaryFile('XDelta3.dll');
#endif
#ifdef PackZIP
    ExtractTemporaryFile('7z.dll');
    ExtractTemporaryFile('PackZIP.exe');
#endif

    ExtractTemporaryFile('English.ini');

// Iiaaioaaeeaaai ia?aiaiio?, niaa??auo? an? eioi?iaoe? i auaaeaiiuo eiiiiiaioao aey ISDone.dll
// iaeneioi 96 eiiiiiaioia.
    Comps1:=0; Comps2:=0; Comps3:=0;
#ifdef Components
    TmpValue:=1;
    if IsComponentSelected('text\rus') then Comps1:=Comps1+TmpValue;     //eiiiiiaio 1
    TmpValue:=TmpValue*2;
    if IsComponentSelected('text\eng') then Comps1:=Comps1+TmpValue;     //eiiiiiaio 2
//  .....
// ni. ni?aaeo
#endif

#ifdef precomp
  PCFVer:={#precomp};
#else
  PCFVer:=0;
#endif
    ISDoneError:=true;
    if ISDoneInit(ExpandConstant('{src}\records.inf'), $F777, Comps1,Comps2,Comps3, MainForm.Handle, {#NeedMem}, @ProgressCallback) then begin
      repeat
//        ChangeLanguage('English');
        if not SrepInit('',512,0) then break;
        if not PrecompInit('',128,0.40) then break;
        if not FileSearchInit(false) then break;

        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\setup-1.bin'), ExpandConstant('{app}\Dx9\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\setup-2.bin'), ExpandConstant('{app}\Dx9\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\videos.bin'), ExpandConstant('{app}\Dx9\Videos\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\setup-3.bin'), ExpandConstant('{app}\'), '', false, '', '', '', notPCFonFLY) then break;
(*      if not ISArcExtract ( 0, 0, ExpandConstant('{src}\setup4.bin'), ExpandConstant('{app}\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 1, 0, ExpandConstant('{src}\rus.bin'), ExpandConstant('{app}\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 2, 0, ExpandConstant('{src}\eng.bin'), ExpandConstant('{app}'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\sd-6.bin'), ExpandConstant('{app}'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\sd-7.bin'), ExpandConstant('{app}\Data\Audio\HK\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\sd-8.bin'), ExpandConstant('{app}\Data\Audio\HK\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\sd-9.bin'), ExpandConstant('{app}\Data\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\ds2-4.bin'), ExpandConstant('{app}'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
        if not ISSRepExtract( 0, 0, ExpandConstant('{app}\anim_streams.srep'),ExpandConstant('{app}\anim_streams.pcf'), true                         ) then break;
        if not ISPrecompExtract ( 0, 0, ExpandConstant('{app}\anim_streams.pcf'), ExpandConstant('{app}\media\anim_streams.upak'), true                         ) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\ds2-5.bin'), ExpandConstant('{app}'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
        if not ISSRepExtract( 0, 0, ExpandConstant('{app}\maps.srep'),ExpandConstant('{app}\maps.pcf'), true                         ) then break;
        if not ISPrecompExtract ( 0, 0, ExpandConstant('{app}\maps.pcf'), ExpandConstant('{app}\media\maps.upak'), true                         ) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\ds2-6.bin'), ExpandConstant('{app}'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
        if not ISSRepExtract( 0, 0, ExpandConstant('{app}\media.srep'),ExpandConstant('{app}\media.pcf'), true                         ) then break;
        if not ISPrecompExtract ( 0, 0, ExpandConstant('{app}\media.pcf'), ExpandConstant('{app}\media\media.upak'), true                         ) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\ds2-7.bin'), ExpandConstant('{app}\media\sounds_streamed\PC\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\ds2-8.bin'), ExpandConstant('{app}\media\sounds_streamed\PC\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\ds2-9.bin'), ExpandConstant('{app}\media\video\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\ds2-10.bin'), ExpandConstant('{app}\media\video\'), '', false, '', '', '', notPCFonFLY) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\ds2-11.bin'), ExpandConstant('{app}\media\video\'), '', false, '', '', '', notPCFonFLY) then break;
*)


        //if not ISArcExtract ( 0, 0, ExpandConstant('{app}\files.bin'),ExpandConstant('{app}\'), '', true, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
        //if not ISArcExtract ( 0, 0, ExpandConstant('{src}\setup7.bin'), ExpandConstant('{app}'), '', false, '', '', '', notPCFonFLY) then break;

//      if not ISArcExtract ( 0, 0, ExpandConstant('{app}\file.bin'), ExpandConstant('{app}\'), '', true, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
//      if not ISArcExtract ( 0, 0, ExpandConstant('{src}\DLC1.arc'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
//      if not ISSRepExtract( 0, 0, ExpandConstant('{app}\DLC.srep'),ExpandConstant('{app}\DLC.pcf'), true                         ) then break;
//      if not ISPrecompExtract ( 0, 0, ExpandConstant('{app}\DLC.pcf'), ExpandConstant('{app}\DLC.arc'), true                         ) then break;
//      if not ISArcExtract ( 0, 0, ExpandConstant('{app}\DLC.arc'), ExpandConstant('{app}\DLC\'), '', true, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;

//      if not ISArcExtract ( 0, 0, ExpandConstant('{src}\envs.arc'), ExpandConstant('{app}\envs.srep'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
//      if not ISSRepExtract ( 0, 0, ExpandConstant('{src}\envs.srep'), ExpandConstant('{app}\envs.pcf'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
//      if not ISPrecompExtract ( 0, 0, ExpandConstant('{src}\envs.pcf'), ExpandConstant('{app}\'), '', false, '', '', ExpandConstant('{app}\Sounds.arc'), notPCFonFLY {PCFonFLY}) then break;
//      if not ISArcExtract ( 0, 0, ExpandConstant('{src}\Sounds.arc'), ExpandConstant('{app}\Sounds.srep'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
//      if not ISSRepExtract ( 0, 0, ExpandConstant('{src}\Sounds.srep'), ExpandConstant('{app}\Sounds.pcf'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
//      if not ISPrecompExtract ( 0, 0, ExpandConstant('{src}\Sounds.pcf'), ExpandConstant('{app}\'), '', false, '', '', ExpandConstant('{app}\TheBlob.arc'), notPCFonFLY {PCFonFLY}) then break;
//      if not ISArcExtract ( 0, 0, ExpandConstant('{src}\TheBlob.arc'), ExpandConstant('{app}\TheBlob.srep'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
//      if not ISPrecompExtract ( 0, 0, ExpandConstant('{src}\TheBlob.pcf'), ExpandConstant('{app}\envs\'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;

//    aaeaa iaoiayony caeiiiaioe?iaaiua i?eia?u ?acee?iuo ooieoee ?aniaeiaee (?oiau ea?aue ?ac ia eaceou a ni?aaeo ca i?eia?aie)
(*
        if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\arc.arc'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
        if not IS7ZipExtract   ( 0, 0, ExpandConstant('{src}\CODMW2.7z'), ExpandConstant('{app}\data1'), false, '') then break;
        if not ISRarExtract    ( 0, 0, ExpandConstant('{src}\data_*.rar'), ExpandConstant('{app}'), false, '') then break;
        if not ISSRepExtract   ( 0, 0, ExpandConstant('{app}\data1024_1024.srep'),ExpandConstant('{app}\data1024.arc'), true) then break;
        if not ISPrecompExtract( 0, 0, ExpandConstant('{app}\data.pcf'),    ExpandConstant('{app}\data.7z'), true) then break;
        if not ISxDeltaExtract ( 0, 0, 0, 640, ExpandConstant('{app}\in.pcf'), ExpandConstant('{app}\*.diff'),   ExpandConstant('{app}\out.dat'), false, false) then break;
        if not ISPackZIP       ( 0, 0, ExpandConstant('{app}\1a1\*'), ExpandConstant('{app}\1a1.pak'), 2, false ) then break;
        if not ISExec          ( 0, 0, 0, ExpandConstant('{tmp}\Arc.exe'), ExpandConstant('x -o+ "{src}\001.arc" "{app}\"'), ExpandConstant('{tmp}'), '...',false) then break;
        if not ShowChangeDiskWindow ('Ii?aeoenoa, anoaauoa aoi?ie aene e ai?aeoanu aai eieoeaeecaoee.', ExpandConstant('{src}'),'CODMW_2.arc') then break;

//    ?aniaeiaea a?oiiu oaeeia iin?aanoaii aiaoiaai i?eei?aiey

        FindHandle1:=ISFindFiles(0,ExpandConstant('{app}\*.ogg'),ColFiles1);
        ExecError:=false;
        while not ExecError and ISPickFilename(FindHandle1,ExpandConstant('{app}\'),CurIndex1,true) do begin
          InFilePath:=ISGetName(0);
          OutFilePath:=ISGetName(1);
          OutFileName:=ISGetName(2);
          ExecError:=not ISExec(0, 0, 0, ExpandConstant('{tmp}\oggdec.exe'), '"'+InFilePath+'" -w "'+OutFilePath+'"',ExpandConstant('{tmp}'),OutFileName,false);
        end;
        ISFindFree(FindHandle1);
        if ExecError then break;
*)

        ISDoneError:=false;
      until true;
      ISDoneStop;
    end;
    HideControls;
    WizardForm.CancelButton.Visible:=true;
    WizardForm.CancelButton.Enabled:=false;
  end;
  if (CurStep=ssPostInstall) and ISDoneError then begin
    Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
  end;
end;

// Importing LoadSkin API from ISSkin.DLL
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:isskinex.dll stdcall';

// Importing UnloadSkin API from ISSkin.DLL
procedure UnloadSkin();
external 'UnloadSkin@files:isskinex.dll stdcall';

// Importing ShowWindow Windows API from User32.DLL
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external 'ShowWindow@user32.dll stdcall';

function InitializeSetup(): Boolean;
begin
	ExtractTemporaryFile('ForestGreen.cjstyles');
	LoadSkin(ExpandConstant('{tmp}\ForestGreen.cjstyles'), '');
	Result := True;
end;

procedure DeinitializeSetup();
begin
	// Hide Window before unloading skin so user does not get
	// a glimse of an unskinned window before it is closed.
	ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
	UnloadSkin();
  ssDeInitialize;
end;

kkels, если твой скрипт лежит в той же где и остальные файлы, то лучшее решение в скрипте в секции Files писать не
Код:
C:\Users\Имя_Пользователя\Desktop\ISDone0.6final\Session Manager.ico
а
Код:
ISDone0.6final\Session Manager.ico
или
Код:
Session Manager.ico
, ну т.е получится универсальный путь, он будет работать откуда угодно, с тем учётом если всё будет в одной папке.
Например захочешь ты поменяешь имя пользователя учётной записи скажем на MyComp, то уже
Код:
C:\Users\Ванька-Встанька\Desktop\ISDone0.6final\Session Manager.ico
не подойдёт и выдаст ошибку:
Код:
Строка XX:
Could not read "C:\Users\Ванька-Встанька\Desktop\ISDone0.6final\Session Manager.ico"

Error: Не удаётся найти указанный файл.
 
Последнее редактирование:

RUSSIA_23

Новичок
Прошу помочь... Пытался добавить установку доп. софта в инсталлятор (PhysX), но квадратик, в который должна встать галочка, отсутствует!
Какую команду надо прописать?
 

RUSSIA_23

Новичок
Спасибо! Прописал...
Только вот, получилось так, что этот квадратик теперь есть на каждой странице установщика (Приветствие, Система, Каталог, Меню "Пуск", Установка, Завершение)
Код:
  PhysXCheck:=BtnCreate(WizardForm.Handle,ScaleX(75),ScaleY(393),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\CheckBox.png'),8,True);
  BtnSetEvent(PhysXCheck,BtnClickEventID,WrapBtnCallback(@PhysXClick,1));
  BtnSetEvent(PhysXCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
  BtnSetCursor(PhysXCheck,GetSysCursorHandle(32649));
 
Последнее редактирование:

YURSHAT

Тех. админ
Администратор
RUSSIA_23, в процедуре ShowComponents, на нужной странице
Код:
BtnSetVisibility(PhysXCheck,True);
а в процедуре CurPageChanged
Код:
BtnSetVisibility(PhysXCheck,False);
 

RUSSIA_23

Новичок
YURSHAT, спасибо!
И, наверное, последний вопрос... После нажатия на кнопку "Установить", инсталл переходит на "клон" своей страницы (только пустой)...
Как избавиться от лишней (пустой) страницы?
 

RUSSIA_23

Новичок
Тогда скрипт не компилируется вообще... Ошибку выдает: "Directive or parameter "Tasks" expression error: Parameter "Tasks" includes an unknown task."
В секции [Tasks] у меня записано следующее:
Код:
Name: PhysX; Description: Установить PhysX;
 

makst

Новичок
RUSSIA_23, попробуй прописать это в секцию Components

Код:
Name: Redist; Description: {cm:Redist}; Types: full; Flags: collapsed
Name: Redist\PhysX; Description: {cm:PhysX}; Types: full;
 

GVS276

Старожил
Проверенный
RUSSIA_23, Значит где то указан Tasks, посмотри в секции [Icon] или [Run], если увидишь Tasks, то убери(удали) её
И вообще показывай скрипт, прежде чем задавать вопрос!
 

makst

Новичок
А кто мне может объяснить как при удалений чтоб WizardSmallImage тоже был растянут. А то у меня он только при установке такой.
 

Mailchik

Старожил
Проверенный
kkels,
[SOURCE="inno"][Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application

Код:
procedure InitializeUninstallProgressForm();
 begin
  with UninstallProgressForm do
   begin
    PageNameLabel.Hide;
    PageDescriptionLabel.Hide;
    WizardSmallBitmapImage.SetBounds(ScaleX(0), ScaleY(0), MainPanel.Width, MainPanel.Height);
   end;
end;[/SOURCE][/SPOILER]
 

RUSSIA_23

Новичок
RUSSIA_23, попробуй прописать это в секцию Components

Код:
Name: Redist; Description: {cm:Redist}; Types: full; Flags: collapsed
Name: Redist\PhysX; Description: {cm:PhysX}; Types: full;
Выдало ошибку какую-то... Что-то про Redist

RUSSIA_23, Значит где то указан Tasks, посмотри в секции [Icon] или [Run], если увидишь Tasks, то убери(удали) её
И вообще показывай скрипт, прежде чем задавать вопрос!
Больше Tasks нигде не указан. Вот скрипт: http://rghost.ru/40932425
 

GVS276

Старожил
Проверенный
RUSSIA_23,
Это что?
Оказывается есть Tasks: "PhysX";, вот из за этого и выдаёт ошибку!
Держи: http://rghost.ru/40932784
 

RUSSIA_23

Новичок
Странно. Прогресс установки завершается на ~70%, после начинает обновляться PhysX, а потом компьютер автоматически перезагружается. Где искать проблему?
 

Snoopak96

Старожил
Прогресс установки завершается на ~70%
Смотри модуль IsDone.iss, возможно там ручная расстановка процентов.
после начинает обновляться PhysX, а потом компьютер автоматически перезагружается. Где искать проблему?
Код:
[Setup]
RestartIfNeededByRun=no
 

RUSSIA_23

Новичок
Смотри модуль IsDone.iss, возможно там ручная расстановка процентов.

Код:
[Setup]
RestartIfNeededByRun=no
Но раньше ведь всё было нормально и без этой команды (RestartIfNeededByRun=no)...
P.S. В IsDone тоже ничего не менял. До этого всё шло хорошо

UPD: После добавления RestartIfNeededByRun=no всё снова впорядке
 
Последнее редактирование:
Статус
В этой теме нельзя размещать новые ответы.
Сверху