Новый участник
Сообщения: 29
Благодарности: 2
|
Профиль
|
Отправить PM
| Цитировать
Вот скрипт
читать дальше »
PHP код:
#define NeedSize "1073741820"
#define NeedMem 0
;#define SecondProgressBar
;#define Components
#define records
#define facompress
[Setup]
SourceDir=.
OutputDir=J:FEARBUILD
AppName=FEAR 2 Project Origin
AppVerName=FEAR 2 Project Origin
AppVersion=FEAR 2 Project Origin
DefaultDirName={pf}FEAR 2 Project Origin
DefaultGroupName=FEAR 2 Project Origin
AllowNoIcons=yes
OutputBaseFilename=FEAR2setup
WizardImageFile=C:путьккартинке
WizardSmallImageFile=C:путьккартинке
SetupIconFile=C:путьккартинке
WindowVisible=no
WindowShowCaption=no
WindowResizable=no
Compression=none
SolidCompression=no
DiskSpanning=yes
SlicesPerDisk=3
DiskSliceSize=1566000000
#ifdef NeedSize
ExtraDiskSpaceRequired={#NeedSize}
#endif
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[Tasks]
Name: "LangEng"; Description: "Английский"; GroupDescription: "Язык интерфейса"; Flags: exclusive
Name: "LangRus"; Description: "Русский"; GroupDescription: "Язык интерфейса"; Flags: exclusive
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
[Icons]
Name: "{group}\FEAR 2 Project Origin"; Filename: "{app}\FEAR2.exe"; WorkingDir: "{app}";
Name: "{userdesktop}\FEAR 2 Project Origin"; Filename: "{app}\FEAR2.exe"; WorkingDir: "{app}"; Tasks: desktopicon;
Name: "{group}\{cm:UninstallProgram,FEAR 2 Project Origin}"; Filename: "{uninstallexe}"
[Registry]
Root: HKCU; Subkey: "SOFTWARE\Monolith Productions"; Flags: uninsdeletekeyifempty
Root: HKCU; Subkey: "SOFTWARE\Monolith Productions\FEAR2"; Flags: uninsdeletekey
Root: HKCU; Subkey: "SOFTWARE\Monolith Productions\FEAR2\1.00.0000"; ValueName: "LANGUAGE"; ValueType: String; ValueData: "ru"; Tasks: LangRus; Flags: uninsdeletekey
Root: HKCU; Subkey: "SOFTWARE\Monolith Productions\FEAR2\1.00.0000"; ValueName: "LANGUAGE"; ValueType: String; ValueData: "en"; Tasks: LangEng; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\Monolith Productions, Inc."; Flags: uninsdeletekeyifempty
Root: HKLM; Subkey: "SOFTWARE\Monolith Productions\F.E.A.R. 2 Project Origin"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\Monolith Productions\F.E.A.R. 2 Project Origin\1.00.0000"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\FEAR2Game"; ValueName: "AppPath"; ValueType: String; ValueData: "{app}"; Flags: uninsdeletekey
[Files]
Source: "J:\FEAR 2 Project Origin\*"; DestDir: "{app}"; Flags: ignoreversion
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef facompress
Source: Includefacompress.dll; DestDir: {tmp}; Flags: dontcopy
#endif
[CustomMessages]
russian.ExtractedFile=Извлекается файл:
russian.Extracted=Распаковка игровых архивов...
russian.CancelButton=Отменить распаковку
russian.Error=Ошибка распаковки!
russian.ElapsedTime=Прошло:
russian.RemainingTime=Осталось времени:
russian.EstimatedTime=Всего:
russian.AllElapsedTime=Время установки:
[UninstallDelete]
Type: filesandordirs; Name: {app}
[code]
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 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):boolean; external 'ISExec@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 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;
LabelTime3.Caption:=ExpandConstant('{cm:AllElapsedTime}')+TimeStr3;
Result := ISDoneCancel;
end;
procedure CancelButtonOnClick(Sender: TObject);
begin
if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then ISDoneCancel:=1;
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;
LabelTime3 := TLabel.Create(WizardForm);
with LabelTime3 do begin
Parent := WizardForm.FinishedPage;
AutoSize := False;
Width := 300;
Left := 180;
Top := 200;
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
LabelTime3.Hide;
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 = ssPostInstall then begin //Если необходимо, можно поменять на ssPostInstall
WizardForm.ProgressGauge.Hide;
WizardForm.CancelButton.Hide;
CreateControls;
WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
ISDoneCancel:=0;
// Распаковка всех необходимых файлов в папку {tmp}.
#ifdef facompress
ExtractTemporaryFile('facompress.dll'); //ускоряет распаковку .arc архивов.
#endif
#ifdef records
ExtractTemporaryFile('records.inf');
#endif
ISDoneError:=true;
if ISDoneInit(ExpandConstant('{src}\records.inf'), $F777, Comps1,Comps2,Comps3, MainForm.Handle, {#NeedMem}, @ProgressCallback) then begin
repeat
if not FileSearchInit(false) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{app}\*.arc'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
if not ISExec(0, 0, 0, 'cmd.exe', ' /C del /F /Q PACK1.arc', ExpandConstant('{app}'), '...') then break;
if not ISExec(0, 0, 0, 'cmd.exe', ' /C del /F /Q PACK2.arc', ExpandConstant('{app}'), '...') then break;
if not ISExec(0, 0, 0, ExpandConstant('{app}\rep.exe'), ' "Layer10.pcf.rep"',ExpandConstant('{app}'), 'Layer10.pcf') then break;
if not ISExec(0, 0, 0, 'cmd.exe', ' /C del /F /Q Layer10.pcf.rep', ExpandConstant('{app}'), '...') then break;
if not ISExec(0, 0, 0, ExpandConstant('{app}\precomp.exe'), ExpandConstant('-r -o"{app}\Layer10.Arch01" "{app}\Layer10.pcf"'), ExpandConstant('{app}'), 'Layer10.Arch01') then break;
if not ISExec(0, 0, 0, 'cmd.exe', ' /C del /F /Q Layer10.pcf', ExpandConstant('{app}'), '...') then break;
if not ISExec(0, 0, 0, ExpandConstant('{app}\rep.exe'), ' "Layer15.pcf.rep"',ExpandConstant('{app}'), 'Layer15.pcf') then break;
if not ISExec(0, 0, 0, 'cmd.exe', ' /C del /F /Q Layer15.pcf.rep', ExpandConstant('{app}'), '...') then break;
if not ISExec(0, 0, 0, ExpandConstant('{app}\precomp.exe'), ExpandConstant('-r -o"{app}\Layer15.Arch01" "{app}\Layer15.pcf"'), ExpandConstant('{app}'), 'Layer15.Arch01') then break;
if not ISExec(0, 0, 0, 'cmd.exe', ' /C del /F /Q Layer15.pcf rep.exe msvcr80.dll packjpg_dll.dll zlib1.dll precomp.exe', ExpandConstant('{app}'), '...') 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;
Раньше с многодисковыми установками сталкиваться не приходилось, потому вобще не представляю в чём дело.
У меня подозрения только на использование ssPostInstall а не штатного значения ssInstall
|