убрал скобку чтоб на форум удобнее!:)
[code];
;#define AppID "{{E171B120-5F14-4591-8F3E-B77E2516CA47}"
#define MyAppName "Medal of Honor - Allied Assault"
#define AppVerName "v1.11"
#define DefaultGroupName "nikitis47"
#define IconFile "4.ico"
#define NeedMem 512
;мегабайты
#define NeedSize "1295"
#define TotalNeedSize "1295"
#define MyAppExeName "MOHAA.exe"
#define path "{app}\Medal of Honor - Allied Assault"
#define FinishImage "3.bmp"
#define FirewallInstallHelper
;-------------------------------------------------------------------
#define Components
;-------------------------------------------------------------------
;#define records
;-------------------------------------------------------------------
#define facompress
;-------------------------------------------------------------------
#define CancelOnWelcome
;-------------------------------------------------------------------
#define ComponentsInfo
;-------------------------------------------------------------------
;#define PrecompInside
;#define SrepInside
;#define MSCInside
;#define precomp "0.42"
;#define unrar
;#define XDelta
;#define PackZIP
[Setup]
;AppID={#AppId}
AppName={#MyAppName}
AppVerName={#AppVerName}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName= {#DefaultGroupName}/{#MyAppName}
OutputDir=D:\RePack\Medal of Honor - Allied Assault
OutputBaseFilename=Setup
AllowNoIcons=true
SetupIconFile=Files\{#IconFile}
VersionInfoCopyright=Dr.DLL
Compression=none
SolidCompression=true
WizardImageFile=Files\1.bmp
WizardSmallImageFile=Files\2.bmp
;DirExistsWarning=no
UninstallFilesDir={app}\Uninstall
ShowTasksTreeLines=true
#ifdef NeedSize
ExtraDiskSpaceRequired={#NeedSize}
#endif
DisableReadyPage=true
DisableProgramGroupPage=no
#ifdef Components
[Types]
Name: full; Description: Full installation; Flags: iscustom
[Components]
Name: Text; Description: "Язык текста:"; Types: full; Flags: fixed;
Name: Text\rus; Description: Русский; Flags: exclusive; ExtraDiskSpaceRequired: 50000000;
Name: Text\eng; Description: Английский; Flags: exclusive; ExtraDiskSpaceRequired: 60000000;
Name: Sound; Description: "Язык озвучки:"; Flags: fixed; Types: full;
Name: Sound\rus; Description: Русский; Flags: exclusive; ExtraDiskSpaceRequired: 500000000;
Name: Sound\eng; Description: Английский; Flags: exclusive; ExtraDiskSpaceRequired: 600000000;
#endif
[Registry]
Root: HKLM; Subkey: Software\{#MyAppName}; ValueName: path; ValueType: String; ValueData: {app}; Flags: uninsdeletekey; Check: CheckError
Root: HKLM; Subkey: Software\{#MyAppName}; ValueName: name; ValueType: String; ValueData: {#AppVerName}; Flags: uninsdeletekey; Check: CheckError
Root: HKLM; SubKey: SOFTWARE\{#MyAppName}; ValueType: string; ValueName: ; ValueData: 6376973694892677932214
[Icons]
Name: {group}\Medal of Honor - Allied Assault; Filename: {app}\MOHAA.exe; WorkingDir: {app}; Check: CheckError
Name: {group}\Удаление Medal of Honor - Allied Assault; Filename: {app}\Uninstall\unins000.exe; WorkingDir: {app}; Check: CheckError
Name: {commondesktop}\Удаление Medal of Honor - Allied Assault; Filename: {app}\Uninstall\unins000.exe; WorkingDir: {app}; Check: CheckError
Name: {commondesktop}\Medal of Honor - Allied Assault; Filename: {app}\MOHAA.exe; WorkingDir: {app}; Check: CheckError
[Tasks]
Name: VCCheck; Description: Установить Microsoft Visual C++ 2010 Redist SP1
Name: NET; Description: Установить Microsoft .NET Framework 4.0
;Name: PhysX; Description:Nvidia PhysX;
Name: DirectX64; Description: DirectX(x64); Flags: exclusive
Name: DirectX86; Description: DirectX(x86); Flags: exclusive
[Run]
Filename: {src}\Redist\vcredist_x86_vs2010sp1.exe; Parameters: /qn; StatusMsg: Устанавливаем Microsoft Visual C++ 2010 Redist SP1...; Flags: skipifdoesntexist; Tasks: VCCheck; Check: CheckError
Filename: {src}\Redist\dotNetFx40_Full_setup.exe; Parameters: /qn; StatusMsg: Устанавливаем Microsoft .NET Framework 4.0 ...; Flags: skipifdoesntexist; Tasks: NET; Check: CheckError
Filename: {src}\Redist\DirectXx64.exe; Parameters: /qn; StatusMsg: Устанавливаем DirectX...; Flags: skipifdoesntexist; Tasks: DirectX64; Check: CheckError
Filename: {src}\Redist\DirectXx86.exe; Parameters: /qn; StatusMsg: Устанавливаем DirectX...; Flags: skipifdoesntexist; Tasks: DirectX86; Check: CheckError
;Filename: {src}\Redist\Nvidia PhysX v9.12.0213.msi; Parameters: -i {tmp}\Nvidia PhysX v9.12.0213.msi /q; StatusMsg: Устанавливаем Nvidia PhysX...; Flags: skipifdoesntexist; Tasks: PhysX; Check: CheckError;
;Filename: {src}\Redist\Nvidia PhysX v9.12.0213.msi; WorkingDir:{tmp}\PhysiX; Parameters:/qn; StatusMsg: Установка PhysX...; Tasks: PhysX;
;Filename: msiexec.exe; Parameters:</passive | /i><{src}\Redist\Nvidia PhysX v9.12.0213.msi> /qn; StatusMsg: Установка PhysX...; Tasks: PhysX;
;Filename: msiexec.exe; Parameters: "-i ""{src}\Redist\Nvidia PhysX v9.12.0213.msi"" -qn"; WorkingDir: "{src}\Redist"; StatusMsg: Установка PhysX
[Files]
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: 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
#ifdef FirewallInstallHelper
Source: Files\FirewallInstallHelper.dll; DestDir: {app}; Flags: ignoreversion
#endif
Source: Files\{#FinishImage}; DestDir: {tmp}; Flags: dontcopy
Source: Files\ISSkin.dll; DestDir: {app}; Attribs: hidden system
Source: Files\skin.skin; DestDir: {app}; Attribs: hidden system
Source: Files\Logo.bmp; DestDir: {tmp}; Flags: dontcopy
Source: Files\descctrl.dll; DestDir: {tmp}; Flags: dontcopy
[CustomMessages]
russian.Extracted=Распаковка локального кэша ...
russian.Error=Установка — {#MyAppName}
russian.ElapsedTime=Прошло:
russian.RemainingTime=Осталось времени:
russian.EstimatedTime=Всего:
russian.FinishLabel={#MyAppName} установлена на Ваш компьютер.
russian.WelcomeLabel=Программа установит {#MyAppName} на Ваш компьютер.
russian.FinishedLabel=Установка {#MyAppName} была прервана.
;russian.DeleteSave=Удалить сохраненные игры и профили?
[Languages]
Name: russian; MessagesFile: Files\Russian.isl
[UninstallDelete]
Type: filesandordirs; Name: {app}
;убрал скобку
Code]
const
PCFonFLY=true;
notPCFonFLY=false;
var
WelcomeLabel, FinishedLabel, PageNameLabel: TLabel;
TotalNeedSpaceLabel,NeedSpaceLabel,FreeSpaceLabel: TLabel;
LabelPct1,LabelTime1,LabelTime2: TLabel;
FreeMB, TotalMB: Cardinal;
SizeStr: String;
SizeInt: Integer;
SymbolNumber: Integer;
NeedSize, TotalNeedSize, ISDoneCancel: Integer;
ISDoneProgressBar1: TNewProgressBar;
MyCancelButton: TButton;
ISDoneError:boolean;
PCFVer:double;
BtnPanel: TPanel;
BtnImage: TBitmapImage;
Info: TNewStaticText;
InfoCaption: TNewStaticText;
InfoPanel: TPanel;
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 GetSize(): Integer;
begin
SizeStr:= WizardForm.DiskSpaceLabel.Caption;
for SymbolNumber:= 97 to 122 do begin
while (Pos(Chr(SymbolNumber), SizeStr) > 0) do Delete(SizeStr, Pos(Chr(SymbolNumber), SizeStr),1); //Находим все символы нижнего регистра и удаляем
while (Pos(AnsiUppercase(Chr(SymbolNumber)), SizeStr) > 0) do Delete(SizeStr, Pos(AnsiUppercase(Chr(SymbolNumber)), SizeStr),1); end; //Находим все символы верхнего регистра и удаляем
for SymbolNumber:= 192 to 255 do begin
while (Pos(Chr(SymbolNumber), SizeStr) > 0) do Delete(SizeStr, Pos(Chr(SymbolNumber), SizeStr),1); end; //Находим все символы нижнего регистра и удаляем
while (Pos('.', SizeStr) > 0) do Delete(SizeStr, Pos('.', SizeStr), 1) //Удаляем точки
Delete(SizeStr, Pos(',', SizeStr), 5) //Удаляем дробную часть
Result:= StrToInt(Trim(SizeStr)); //Переводим в число
end;
function CompareNum(FirstNum, SecondNum: Integer): Boolean;
begin
if FirstNum < SecondNum then Result:= False else Result:= True;
end;
#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
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: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 enabledesc(ComponentsListHandle: HWND; DescLabelHandle: HWND; DescStrings: PChar): BOOL; external 'enabledesc@files:descctrl.dll stdcall';
function disabledesc(): BOOL; external 'disabledesc@files:descctrl.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)+'%';
LabelTime1.Caption:=ExpandConstant('{cm:ElapsedTime} ')+TimeStr2;
LabelTime2.Caption:=ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
Result := ISDoneCancel;
end;
function CheckError:boolean;
begin
result:= not ISDoneError;
end;
///////////////////////////////////////Изоображения///////////////////////////////////////////////
procedure InitializeWizard1();
begin
ExtractTemporaryFile('{#FinishImage}');
WizardForm.WizardBitmapImage.Width:= ScaleX(497);
WizardForm.WizardBitmapImage2.Width:= ScaleX(497);
WizardForm.WizardBitmapImage2.Bitmap.LoadFromFile(ExpandConstant('{tmp}\{#FinishImage}'));
WelcomeLabel:= TLabel.Create(WizardForm);
WelcomeLabel.AutoSize:= False;
with WizardForm.WelcomeLabel2 do
WelcomeLabel.SetBounds(Left-70, Top+50, Width, Height);
WelcomeLabel.Alignment := taCenter;
WelcomeLabel.Font:= WizardForm.WelcomeLabel2.Font
WelcomeLabel.Font.Color:= clWhite;
WelcomeLabel.Font.Size:=10
WelcomeLabel.Transparent:= True;
WelcomeLabel.WordWrap:= true;
WelcomeLabel.Caption:= ExpandConstant('{cm:WelcomeLabel}');
WelcomeLabel.Parent:= WizardForm.WelcomePage
WelcomeLabel.Font.Style:=[fsBold];
FinishedLabel:= TLabel.Create(WizardForm);
FinishedLabel.AutoSize:= False;
with WizardForm.FinishedLabel do
FinishedLabel.SetBounds(Left-70, Top+70, Width, Height);
FinishedLabel.Font:= WizardForm.FinishedLabel.Font
FinishedLabel.Font.Color:= clWhite;
FinishedLabel.Transparent:= True;
FinishedLabel.WordWrap:= true;
FinishedLabel.Caption:=ExpandConstant('{cm:FinishLabel}');
FinishedLabel.Parent:= WizardForm.FinishedPage
FinishedLabel.Font.Style:=[fsBold];
FinishedLabel.Alignment := taCenter;
FinishedLabel.Font.Size:=10;
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.FinishedLabel.Hide;
WizardForm.FinishedHeadingLabel.Hide;
end;
/////////////////////////////////
procedure InitializeWizard2();
begin
WizardForm.MainPanel.Height:=150;
WizardForm.WizardSmallBitmapImage.SetBounds(ScaleX(0), ScaleY(0), WizardForm.MainPanel.Width, WizardForm.MainPanel.Height);
PageNameLabel:= TLabel.Create(WizardForm)
with WizardForm.PageNameLabel do
PageNameLabel.SetBounds(Left, Top+50, Width, Height);
PageNameLabel.Transparent:= True;
PageNameLabel.Font:= WizardForm.PageNameLabel.Font;
PageNameLabel.Font.Color:= clWhite; //цвет надписи
PageNameLabel.Parent:= WizardForm.MainPanel;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
///////////////////////////////////////Изоображения///////////////////////////////////////////////
WizardForm.ComponentsList.Color:=WizardForm.SelectDirPage.Color
WizardForm.BackButton.Left:=0;
WizardForm.NextButton.Left:=WizardForm.CancelButton.Left+10;
WizardForm.NextButton.Top:=WizardForm.Bevel.Top+5;
WizardForm.NextButton.Height:=40;
WizardForm.BackButton.Top:=WizardForm.Bevel.Top+5;
WizardForm.BackButton.Height:=40;
WizardForm.SelectDirBrowseLabel.Hide;
WizardForm.CancelButton.Height:=40;
WizardForm.CancelButton.Top:=WizardForm.Bevel.Top+5;
WizardForm.CancelButton.Left:=WizardForm.CancelButton.Left+10;
WizardForm.CancelButton.Hide;
WizardForm.SelectDirBitmapImage.Hide
WizardForm.SelectGroupBitmapImage.Hide
WizardForm.SelectDirLabel.Left:=WizardForm.SelectDirBitmapImage.Left
WizardForm.SelectDirLabel.Top:=100
WizardForm.DirEdit.Top:=140
WizardForm.DirBrowseButton.Top:=140
WizardForm.GroupEdit.Top:=140
WizardForm.GroupBrowseButton.Top:=140
WizardForm.SelectComponentsLabel.Hide;
WizardForm.ComponentsDiskSpaceLabel.Hide;
WizardForm.SelectStartMenuFolderBrowseLabel.Hide;
WizardForm.SelectStartMenuFolderLabel.Left:=WizardForm.SelectDirBitmapImage.Left;
WizardForm.SelectStartMenuFolderLabel.Top:=100;
WizardForm.SelectTasksLabel.Hide;
WizardForm.ComponentsList.Top:=100;
WizardForm.ComponentsList.Height:=120;
WizardForm.TasksList.Top:=100;
WizardForm.TasksList.Height:=120;
WizardForm.StatusLabel.Top:=100;
end;
///////////////////////////////////////Место для установки//////////////////////////////////////////////
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(NeedSize)
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
NeedSize := {#NeedSize};
TotalNeedSize := {#TotalNeedSize};
FreeSpaceLabel := TLabel.Create(WizardForm);
FreeSpaceLabel.Parent := WizardForm.SelectDirPage;
FreeSpaceLabel.SetBounds(ScaleX(0), ScaleY(180), ScaleX(209), ScaleY(13));
TotalNeedSpaceLabel := TLabel.Create(WizardForm);
TotalNeedSpaceLabel.Parent := WizardForm.SelectDirPage;
TotalNeedSpaceLabel.SetBounds(ScaleX(0), ScaleY(200), ScaleX(209), ScaleY(13));
NeedSpaceLabel := TLabel.Create(WizardForm);
NeedSpaceLabel.Parent := WizardForm.SelectDirPage;
NeedSpaceLabel.SetBounds(ScaleX(0), ScaleY(220), ScaleX(209), ScaleY(13));
WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
WizardForm.DiskSpaceLabel.Hide;
end;
///////////////////////////////////////Место для установки//////////////////////////////////////////////
///////////////////////////////////////ISDone////////////////////////
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;
LabelTime1.Hide;
LabelTime2.Hide;
MyCancelButton.Hide;
end;
procedure CreateControls;
var PBTop:integer;
begin
PBTop:=ScaleY(50);
ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
with ISDoneProgressBar1 do begin
Parent := WizardForm;
Height := WizardForm.CancelButton.Height-10
Left := ScaleX(0);
Top := WizardForm.BackButton.Top+5;
Width := ScaleX(405);
Max := 1000;
end;
LabelPct1 := TLabel.Create(WizardForm);
with LabelPct1 do begin
Parent := ISDoneProgressBar1;
AutoSize := True;
Left := 10;
Top := 3;
Font.Size := 14;
Width := ScaleX(80);
Transparent:=True;
end;
LabelTime1 := TLabel.Create(WizardForm);
with LabelTime1 do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := ISDoneProgressBar1.Width div 2;
Left := ScaleX(0);
Top := 200;
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:=TNewButton.Create(WizardForm);
with MyCancelButton do begin
Parent:=WizardForm;
Width:=WizardForm.CancelButton.Width;
Caption:='Отмена';
Left:=WizardForm.CancelButton.Left;
Height:=40;
Top:=WizardForm.Bevel.Top+5;
OnClick:=@CancelButtonOnClick;
end;
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 //Если необходимо, можно поменять на 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:=Comps+TmpValue; //компонент 1
TmpValue:=TmpValue*2;
if IsComponentSelected('text\eng') then Comps1:=Comps+TmpValue; //компонент 2
TmpValue:=TmpValue*2;
if IsComponentSelected('sound\rus') then Comps1:=Comps+TmpValue; //компонент 3
TmpValue:=TmpValue*2;
if IsComponentSelected('sound\eng') then Comps1:=Comps+TmpValue; //компонент 4
// .....
// см. справку
#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,PCFVer) then break;
if not FileSearchInit(true) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\GameData.arc'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
if not ISArcExtract ( 1, 0, ExpandConstant('{src}\TextRus.arc'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
if not ISArcExtract ( 2, 0, ExpandConstant('{src}\TextEng.arc'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
if not ISArcExtract ( 3, 0, ExpandConstant('{src}\SoundRus.arc'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
if not ISArcExtract ( 4, 0, ExpandConstant('{src}\SoundEng.arc'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) 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;
BtnPanel.Show;
end;
if (CurStep=ssPostInstall) and ISDoneError then begin
Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
end;
end;
/////////////////////////////////////////////ISDone/////////////////////
//////////////////////////////Лого/////////////////////////////
procedure TestButtonOnClick(Sender: TObject);
begin
MsgBox('RePack by nikitis47' + #10#13 , mbInformation, MB_OK)
end;
procedure InitializeWizard3();
begin
BtnPanel:=TPanel.Create(WizardForm)
with BtnPanel do begin
Left:=180
Top:=320
Width:=132
Height:=35
Cursor:=crHand
OnClick:=@TestButtonOnClick
Parent:=WizardForm
end
BtnImage:=TBitmapImage.Create(WizardForm)
with BtnImage do begin
AutoSize:=True
Enabled:=False
ExtractTemporaryFile('Logo.bmp')
Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\Logo.bmp')
Parent:=BtnPanel
end
end;
/////////////////////////////////Лого///////////////////////////////////////
/////////////////////////////////Описание компонентов//////////////////////////
#ifdef ComponentsInfo
procedure InitializeWizard4();
begin
WizardForm.TYPESCOMBO.Visible:= false;
InfoPanel := TPanel.Create(WizardForm);
InfoPanel.Parent := WizardForm.SelectComponentsPage;
InfoPanel.Caption := '';
InfoPanel.Top := WizardForm.ComponentsList.Top;
InfoPanel.Left := ScaleX(216);
InfoPanel.Width := ScaleX(201);
InfoPanel.Height := WizardForm.ComponentsList.Height;
InfoPanel.BevelInner := bvRaised;
InfoPanel.BevelOuter := bvLowered;
InfoCaption := TNewStaticText.Create(WizardForm);
InfoCaption.Parent := WizardForm.SelectComponentsPage;
InfoCaption.Caption := 'Информация:';
InfoCaption.Left := ScaleX(224);
InfoCaption.Top := InfoPanel.Top - ScaleY(5);
InfoCaption.Font.Color := clWhite;//clActiveCaption;
Info := TNewStaticText.Create(WizardForm);
Info.Parent := InfoPanel;
Info.Font.Color:=clBlack;
Info.AutoSize := False;
Info.Left := ScaleX(6);
Info.Width := ScaleX(188);
Info.Top := ScaleY(12);
Info.Height := WizardForm.ComponentsList.Height - ScaleY(17);
Info.Caption := 'Наведите на компонент, чтобы получить дополнительную информацию';
Info.WordWrap := true;
Info.Font.Color:=clWhite;
enabledesc(WizardForm.ComponentsList.Handle,Info.Handle,
'Язык текста в игре (меню, субтитры);'+
'Русский текст;'+
'Английский текст;'+
'Язык озвучки в игре (диалоги);'+
'Русская озвучка;'+
'Английская озвучка;'
);
end;
#endif
/////////////////////////////////Описание компонентов//////////////////////////
//////////////////////////// Удаление сохранений ///////////////////////////
//procedure DeleteSavedGames(CurUninstallStep: TUninstallStep);
//begin
//if CurUninstallStep=usUninstall then
//if DirExists(ExpandConstant('{userdocs}')+'\My Games\Skyrim') then
//if MsgBox(ExpandConstant('{cm:DeleteSave}'), mbInformation, MB_YESNO) = idYes then
//DelTree(ExpandConstant('{userdocs}')+'\My Games\Skyrim', True, True, True)
//end;
//////////////////////////// Удаление сохранений ///////////////////////////
////////////////////////////////Скин////////////////////////////////////////
procedure LoadSkin(lpszPath: String; lpszIniFileName: String); external 'LoadSkin@files:isskin.dll stdcall delayload setuponly';
procedure UnloadSkin(); external 'UnloadSkin@files:isskin.dll stdcall delayload setuponly';
procedure LoadSkinU(lpszPath: String; lpszIniFileName: String); external 'LoadSkin@{tmp}\isskin.dll stdcall delayload uninstallonly';
procedure UnloadSkinU(); external 'UnloadSkin@{tmp}\isskin.dll stdcall delayload uninstallonly';
////////////////////////////////Скин////////////////////////////////////////
procedure InitializeWizard();
begin
InitializeWizard1();
InitializeWizard2();
InitializeWizard3();
#ifdef ComponentsInfo
InitializeWizard4();
#endif
SpaceLabel;
end;
Procedure CurPageChanged(CurPageID: Integer);
Begin
#ifdef CancelOnWelcome
if CurPageID = wpWelcome then
begin
WizardForm.CancelButton.Left:=0;
end;
if CurPageID = wpsELECTdIR then
begin
WizardForm.CancelButton.Left:=WizardForm.NextButton.Left;
end;
#endif
if CurPageID = wpSelectTasks then
begin
WizardForm.NextButton.Caption:='Установить';
end;
PageNameLabel.Caption:= WizardForm.PageNameLabel.Caption;
if CurPageID = wpSelectDir then GetFreeSpaceCaption(nil);
if (CurPageID = wpFinished) and ISDoneError then
begin
WizardForm.Caption:= ExpandConstant('{cm:Error}');
FinishedLabel.Font.Color:= clRed;
FinishedLabel.Caption:= ExpandConstant('{cm:FinishedLabel}');
end;
end;
procedure InitializeUninstallProgressForm;
begin
UninstallProgressForm.CancelButton.Hide;
UninstallProgressForm.Bevel.Hide;
UninstallProgressForm.Bevel1.Hide;
UninstallProgressForm.ClientHeight := 100;
UninstallProgressForm.Position:=poScreenCenter
UninstallProgressForm.MainPanel.Hide;
UninstallProgressForm.InnerNotebook.Top:=0
UninstallProgressForm.InnerNotebook.Left:=0
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
path: String;
begin
//DeleteSavedGames(CurUninstallStep);
if CurUninstallStep=usUninstall then
begin
path:=ExpandConstant('{#path}');
RemoveApplicationFromExceptionList(path)
UnloadDll(ExpandConstant('{app}\FirewallInstallHelper.dll'));
end;
end;
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('skin.skin');
LoadSkin(ExpandConstant('{tmp}\skin.skin'), '');
Result:= true
end;
function InitializeUninstall(): Boolean;
begin
FileCopy(ExpandConstant('{app}\isskin.dll'),
ExpandConstant('{tmp}\isskin.dll'), False);
FileCopy(ExpandConstant('{app}\skin.skin'),
ExpandConstant('{tmp}\skin.skin'), False); LoadSkinU(ExpandConstant('{tmp}\orange.skin'), '');
Result:=True;
end;
procedure DeinitializeSetup();
begin
UnloadSkin();
#ifdef ComponentsInfo
disabledesc();
#endif
end;
procedure DeinitializeUninstall();
begin
UnloadSkinU();
end;