#define NeedSize "5000000000"
#define NeedMem 512
#define records
#define facompress
#define SrepInside
[Setup]
AppName=Guitar Hero - World Tour
AppVerName=Guitar Hero - World Tour
DefaultDirName={sd}\GAMES\Guitar Hero - World Tour
DefaultGroupName=Aspyr\Guitar Hero - World Tour
DirExistsWarning=no
WizardImageFile=Image.bmp
SetupIconFile=C:\Users\RameR\Desktop\Guitar Hero - World Tour RePack\Icon.ico
OutputDir=.
OutputBaseFilename=Setup
UninstallFilesDir={app}\Uninstall
SolidCompression=yes
#ifdef NeedSize
ExtraDiskSpaceRequired={#NeedSize}
#endif
[Registry]
Root: HKLM; SubKey: SOFTWARE\Aspyr\Guitar Hero World Tour; ValueType: string; ValueName: Language; ValueData: rus; Flags: uninsdeletevalue uninsdeletekeyifempty
[Icons]
Name: {group}\Guitar Hero - World Tour; Filename: {app}\Guitar Hero - World Tour.exe; WorkingDir: {app}; Check: CheckError
Name: {group}\Удалить Guitar Hero - World Tour; Filename: {app}\Uninstall\unins000.exe; WorkingDir: {app}; Check: CheckError
Name: {group}\Управление; Filename: {app}\Управление.txt; WorkingDir: {app}; Check: CheckError
Name: {commondesktop}\Guitar Hero - World Tour; Filename: {app}\Guitar Hero - World Tour.exe; WorkingDir: {app}; Check: CheckError
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
Name: group; Description: В меню пуск; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
[Files]
Source: game files\AWL.dll; DestDir: {app}; Flags: ignoreversion
Source: game files\binkw32.dll; DestDir: {app}; Flags: ignoreversion
Source: game files\fmodex.dll; DestDir: {app}; Flags: ignoreversion
Source: game files\Guitar Hero - World Tour.exe; DestDir: {app}; Flags: ignoreversion
Source: game files\IntelLaptopGaming.dll; DestDir: {app}; Flags: ignoreversion
Source: game files\xmassiveadclientdyn.dll; DestDir: {app}; Flags: ignoreversion
Source: game files\xmassiveadclientdynlogging.dll; DestDir: {app}; Flags: ignoreversion
Source: game files\Управление.txt; DestDir: {app}; Flags: ignoreversion
Source: ISSkin.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISSkin.cjstyles; DestDir: {tmp}; Flags: dontcopy
Source: Include\Russian.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 SrepInside
Source: Include\CLS-srep.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef facompress
Source: Include\facompress.dll; DestDir: {tmp}; Flags: dontcopy
#endif
[Messages]
SetupWindowTitle=%1
WelcomeLabel1=Приветствие
WelcomeLabel2=Добро пожаловать! Вас приветствует мастер установки игры [name].%n Программа установит игру [name] на ваш компьютер.%nНажмите «Далее», чтобы продолжить, или «Отмена», чтобы выйти из програмы установки.
DiskSpaceMBLabel=Требуется места на диске: [mb] Мб
[CustomMessages]
russian.ExtractedFile=Распаковка файлов:
russian.Extracted=Распаковка архивов...
russian.CancelButton=Отмена
russian.Error=Ошибка распаковки!
[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl
[UninstallDelete]
Type: filesandordirs; Name: {app}
Код:
Const
PCFonFLY=true;
notPCFonFLY=false;
Var
LabelPct1,LabelCurrFileName: TLabel;
ISDoneProgressBar1: TNewProgressBar;
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 ISSRepExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISSrepExtract@files:ISDone.dll stdcall delayload';
Function Exec2 (FileName, Param: PAnsiChar;Show:boolean):boolean; external 'Exec2@files:ISDone.dll stdcall delayload';
Function SrepInit(TmpPath:PAnsiChar;VirtMem,MaxSave:Cardinal):boolean; external 'SrepInit@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 SuspendProc:boolean; external 'SuspendProc@files:ISDone.dll stdcall';
Function ResumeProc:boolean; external 'ResumeProc@files:ISDone.dll stdcall';
//************************************************ [Процесс отмены "Прервать установку?"] ***************************************************//
Procedure CancelButtonOnClick(Sender: TObject);
begin
SuspendProc;
if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then ISDoneCancel:=1;
ResumeProc;
end;
//************************************************ [Загрузка скина ISSkin.cjstyles] ***************************************************//
Procedure LoadSkin(lpszPath: String; lpszIniFileName: String); external 'LoadSkin@files:isskin.dll stdcall';
Procedure UnloadSkin(); external 'UnloadSkin@files:isskin.dll stdcall';
Function ShowWindow(hWnd: Integer; uType: Integer): Integer; external 'ShowWindow@user32.dll stdcall';
Function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('ISSkin.cjstyles');
LoadSkin(ExpandConstant('{tmp}\ISSkin.cjstyles'), '');
Result := True;
end;
//************************************************ [Создание прогрессбара и лэйблов] ***************************************************//
Procedure CreateControls;
var PBTop:integer;
begin
PBTop:=ScaleY(534);
ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
with ISDoneProgressBar1 do begin
Parent := WizardForm;
Left := ScaleX(7);
Top := PBTop;
Width := ScaleX(776);
Height := ScaleY(23);
Max := 1000;
end;
LabelPct1 := TLabel.Create(WizardForm);
with LabelPct1 do begin
Parent := WizardForm;
Left := ISDoneProgressBar1.Width+ScaleX(-29);
Top := ISDoneProgressBar1.Top + ScaleY(-13);
Width := ScaleX(80);
end;
LabelCurrFileName := TLabel.Create(WizardForm);
with LabelCurrFileName do begin
Parent := WizardForm;
Left := ScaleX(11);
Top := ISDoneProgressBar1.Top + ScaleY(34);
end;
MyCancelButton:=TButton.Create(WizardForm);
with MyCancelButton do begin
Parent :=WizardForm;
Width :=ScaleX(90);
Height :=ScaleY(23);
Caption :=ExpandConstant('{cm:CancelButton}');
Left :=ScaleX(693);
Top :=ISDoneProgressBar1.Top + ISDoneProgressBar1.Height + ScaleX(8);
OnClick :=@CancelButtonOnClick;
end;
end;
//************************************************ [Обновления прогрессбара и лэйблов] ***************************************************//
Function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
begin
if OveralPct<=1000 then ISDoneProgressBar1.Position := OveralPct;
LabelPct1.Caption := IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
LabelCurrFileName.Caption:=ExpandConstant('{cm:ExtractedFile} ')+MinimizePathName(CurrentFile, LabelCurrFileName.Font, LabelCurrFileName.Width-ScaleX(100));
Result := ISDoneCancel;
end;
//************************************************ [Скрытие прогрессбара и лэйблов] ***************************************************//
Procedure HideControls;
begin
WizardForm.FileNamelabel.Hide;
ISDoneProgressBar1.Hide;
LabelPct1.Hide;
LabelCurrFileName.Hide;
MyCancelButton.Hide;
end;
//************************************************ [Изменение мастера и его страниц] ***************************************************//
Procedure InitializeWizard;
begin
with WizardForm do begin
begin
WizardForm.Width:=796;
WizardForm.Height:=627;
Center;
end;
with WizardForm.OuterNotebook do begin
Width := ScaleX(795);
Height := ScaleY(627);
end;
with WizardForm.WizardBitmapImage do begin
Width := ScaleX(795);
Height := ScaleY(495);
end;
with WizardForm.bevel do begin
WizardForm.bevel.BringToFront;
SetBounds(ScaleX(0), ScaleY(495), ScaleX(790), Height);
end;
with WizardForm.WelcomeLabel1 do
begin
Font.Color := $8F5123;
Font.Height := 16;
Font.Name := 'Segoe UI';
Top := ScaleY(10);
Font.Style := [fsBold];
ParentFont := False;
WordWrap := False;
end;
with WizardForm.WelcomeLabel2 do
begin
Font.Color := $8F5123;
Font.Height := 20;
Font.Name := 'Segoe UI';
Width := ScaleX(675);
Height := ScaleY(60);
Left := ScaleX(10);
Top := ScaleY(498);
Font.Style := [fsBold];
ParentFont := False;
WordWrap := False;
end;
with DiskSpaceLabel do begin
Parent := WizardForm;
SetBounds(ScaleX(8), ScaleY(553), ScaleX(295), Height);
end;
with DirEdit do begin
Parent := WizardForm;
SetBounds(ScaleX(8), ScaleY(567), ScaleX(394), Height);
end;
with DirBrowseButton do begin
Parent := WizardForm;
SetBounds(DirEdit.Left + DirEdit.Width + ScaleX(6), DirEdit.Top - 1, ScaleX(90), Height);
end;
with GroupEdit do begin
Parent := WizardForm;
SetBounds(ScaleX(8), ScaleY(567), ScaleX(394), Height);
end;
with GroupBrowseButton do begin
Parent := WizardForm;
SetBounds(DirEdit.Left + DirEdit.Width + ScaleX(6), DirEdit.Top - 1, ScaleX(90), Height);
end;
with WizardForm.BackButton do begin
WizardForm.BackButton.BringToFront;
SetBounds (DirBrowseButton.Left + DirBrowseButton.Width + ScaleX(5), ScaleY(566), ScaleX(90), Height);
end;
with WizardForm.NextButton do begin
WizardForm.NextButton.BringToFront;
SetBounds (BackButton.Left + BackButton.Width + ScaleX(5), BackButton.Top, ScaleX(90), Height);
end;
with WizardForm.CancelButton do begin
WizardForm.CancelButton.BringToFront;
SetBounds (NextButton.Left + NextButton.Width + ScaleX(5), BackButton.Top, ScaleX(90), Height);
end;
end;
end;
//************************************************ [Скрытие мастера и его страниц] ***************************************************//
Procedure CurPageChanged(CurPageID : integer);
begin
WizardForm.DiskSpaceLabel.Hide;
WizardForm.DirEdit.Hide;
WizardForm.DirBrowseButton.Hide;
WizardForm.GroupEdit.Hide;
WizardForm.GroupBrowseButton.Hide;
case CurPageID of
wpSelectDir : begin
WizardForm.DiskSpaceLabel.Show;
WizardForm.DirEdit.Show;
WizardForm.DirBrowseButton.Show;
end;
wpSelectProgramGroup: begin
WizardForm.GroupEdit.Show;
WizardForm.GroupBrowseButton.Show;
end;
wpFinished: if ISDoneError then begin
WizardForm.Caption:= ExpandConstant('{cm:Error}');
WizardForm.FinishedLabel.Font.Color:= clWhite;
WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
end;
end;
end;
Function CheckError:boolean;
begin
result:= not ISDoneError;
end;
//************************************************ [Основная процедура распаковки] ***************************************************//
Procedure CurStepChanged(CurStep: TSetupStep);
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 SrepInside
ExtractTemporaryFile('CLS-srep.dll');
#endif
#ifdef facompress
ExtractTemporaryFile('facompress.dll'); //ускоряет распаковку .arc архивов.
#endif
#ifdef records
ExtractTemporaryFile('records.inf');
#endif
ExtractTemporaryFile('russian.ini');
//************************************************ [Распаковка файлов архива] ***************************************************//
ISDoneError:=true;
if ISDoneInit(ExpandConstant('{src}\records.inf'), $F777, 0, 0, 0, MainForm.Handle, {#NeedMem}, @ProgressCallback) then begin
repeat
if not SrepInit('',512,0) then break;
if not FileSearchInit(true) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\*.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) 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;