Вот, столкнулся с такой ошибкой:
Помогите исправить...
Скрипт:
[more]#define AppId "{{287A12F0-915C-492F-867E-9511075DB83D}"
#define MyAppName "Need for Speed(TM) Hot Pursuit"
#define NeedSize "4936"
#define TotalNeedSize "8162"
#define NeedMem "600"
#define FinishImage "2.bmp"
#define MyAppExeName "NFS11.exe"
#define path "{app}\NFS11.exe"
#define IconFile "NFSHP.ico"
;#define Components
;#define FirewallInstallHelper
#define SecondProgressBar
;#define records
;#define precomp04
;#define precomp038
;#define unrar
[Setup]
AppId={#AppId}
AppName={#MyAppName}
AppVerName={#MyAppName}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=Setup
Compression=none
SolidCompression=true
AllowNoIcons=true
VersionInfoCopyright=AntonOVS
SetupIconFile=Files\{#IconFile}
WizardImageFile=Files\WizardImage.bmp
WizardSmallImageFile=Files\WizardSmallImage.bmp
DirExistsWarning=no
UninstallFilesDir={app}\Uninstall
ShowTasksTreeLines=true
#ifdef NeedSize
ExtraDiskSpaceRequired={#TotalNeedSize}
#endif
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[CustomMessages]
rus.ExtractedFile=Извлекается файл:
rus.Extracted=Распаковка архивов...
rus.Error=Ошибка распаковки!
rus.ElapsedTime=Прошло времени:
rus.RemainingTime=Осталось времени:
rus.EstimatedTime=Всего:
rus.AllElapsedTime=Время установки:
rus.Welcome1=Вас приветствует %nМастер установки игры %n{#MyAppName}
rus.Welcome2=Программа установит игру %n{#MyAppName} на Ваш компьютер.%n%nРекомендуется закрыть антивирусные пакеты, %nа также все прочие приложения перед тем, %nкак продолжить.%n%n%nНажмите «Далее», чтобы продолжить, или %n«Отмена», чтобы выйти из программы установки.
rus.Finished1=Установка игры %n{#MyAppName} %nуспешно завершена.
rus.Finished2=Игра {#MyAppName} %nбыла успешно установлена на Ваш компьютер. %n%nДля ее запуска выберите соответствующий ярлык в меню «Пуск» или на Рабочем столе.
rus.Finished3=Нажмите «Завершить», чтобы выйти из программы установки.
rus.ISDoneFinishedHeading=Установка игры %n{#MyAppName} %nне завершена!
rus.ISDoneTitleBack=Откат установки...
rus.DeleteSave=Удалить сохраненные игры и профили?
[Files]
Source: Files\*; Flags: dontcopy
Source: Files\ISDone.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\facompress.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\facompress_mt.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\5.ico; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system
#ifdef FirewallInstallHelper
Source: Files\FirewallInstallHelper.dll; DestDir: {app}; Flags: ignoreversion
#endif
;Source: Include\arc.ini; DestDir: {tmp}; Flags: dontcopy
;Source: Include\srep.exe; DestDir: {tmp}; Flags: dontcopy
;Source: {win}\help\*; DestDir: {app}\Files; Flags: external recursesubdirs createallsubdirs; Check: CheckError;
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp04
Source: Files\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Files\precomp04.exe; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp038
Source: Files\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Files\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
Source: Files\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef unrar
Source: Files\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#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; ExtraDiskSpaceRequired: 100000000
Name: text\eng; Description: Английский; Flags: exclusive; ExtraDiskSpaceRequired: 200000000
Name: voice; Description: Язык озвучки; Types: full; Flags: fixed
Name: voice\rus; Description: Русский; Flags: exclusive; ExtraDiskSpaceRequired: 500000000
Name: voice\eng; Description: Английский; Flags: exclusive; ExtraDiskSpaceRequired: 600000000
#endif
[Registry]
Root: HKLM; Subkey: SOFTWARE\Electronic Arts; Flags: uninsdeletekeyifempty
Root: HKLM; Subkey: SOFTWARE\Electronic Arts\Need for Speed(TM) Hot Pursuit; ValueName: DisplayName; ValueType: String; ValueData: Need for Speed(TM) Hot Pursuit; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: CheckError
Root: HKLM; Subkey: SOFTWARE\Electronic Arts\Need for Speed(TM) Hot Pursuit; ValueName: CD Drive; ValueType: String; ValueData: {drive:{src}}; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: CheckError
Root: HKLM; Subkey: SOFTWARE\Electronic Arts\Need for Speed(TM) Hot Pursuit; ValueName: ProductName; ValueType: String; ValueData: Need for Speed(TM) Hot Pursuit; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: CheckError
Root: HKLM; Subkey: SOFTWARE\Electronic Arts\Need for Speed(TM) Hot Pursuit; ValueName: Folder; ValueType: String; ValueData: {group}\Need for Speed(TM) Hot Pursuit\; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: CheckError
Root: HKLM; Subkey: SOFTWARE\Electronic Arts\Need for Speed(TM) Hot Pursuit; ValueName: Install Dir; ValueType: String; ValueData: {app}\; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: CheckError
Root: HKLM; Subkey: SOFTWARE\Electronic Arts\Need for Speed(TM) Hot Pursuit; ValueName: Installed From; ValueType: String; ValueData: {drive:{src}}; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: CheckError
Root: HKLM; Subkey: SOFTWARE\Electronic Arts\Need for Speed(TM) Hot Pursuit; ValueName: Locale; ValueType: String; ValueData: ru; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: CheckError
Root: HKLM; Subkey: SOFTWARE\Electronic Arts\Need for Speed(TM) Hot Pursuit; ValueName: Language; ValueType: String; ValueData: Russian; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: CheckError
Root: HKLM; Subkey: SOFTWARE\Electronic Arts\Need for Speed(TM) Hot Pursuit; ValueName: Product GUID; ValueType: String; ValueData: {{83A606F5-BF6F-42ED-9F33-B9F74297CDED}; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: CheckError
Root: HKLM; Subkey: SOFTWARE\Electronic Arts\Need for Speed(TM) Hot Pursuit; ValueName: Suppression Exe; ValueType: String; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: CheckError
Root: HKLM; Subkey: SOFTWARE\Electronic Arts\Need for Speed(TM) Hot Pursuit; ValueName: Registration; ValueType: String; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: CheckError
Root: HKLM; Subkey: SOFTWARE\Electronic Arts\Need for Speed(TM) Hot Pursuit\1.0; ValueName: DisplayName; ValueType: String; ValueData: Need for Speed(TM) Hot Pursuit; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: CheckError
Root: HKLM; Subkey: SOFTWARE\Electronic Arts\Need for Speed(TM) Hot Pursuit\1.0; ValueName: Language; ValueType: Dword; ValueData: $10; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: CheckError
Root: HKLM; Subkey: SOFTWARE\Electronic Arts\Need for Speed(TM) Hot Pursuit\1.0; ValueName: LanguageName; ValueType: String; ValueData: Russian; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: CheckError
Root: HKLM; Subkey: SOFTWARE\Electronic Arts\Need for Speed(TM) Hot Pursuit\1.0; ValueName: ProgramGroup; ValueType: String; ValueData: {group}\Electronic Arts\; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: CheckError
[Icons]
Name: {group}\{#MyAppName}; Filename: {app}\Launcher.exe; WorkingDir: {app}; IconFilename: {#path}; Comment: {#MyAppName}; Check: CheckError
Name: {group}\Настройки; Filename: {app}\ConfigTool.exe; WorkingDir: {app}; IconFilename: {#path}; Comment: Настройки игры; Check: CheckError
Name: {group}\Удалить игру; Filename: {uninstallexe}; WorkingDir: {app}\Uninstall\; IconFilename: {app}\5.ico; Comment: Удалить игру {#MyAppName}; Check: CheckError
Name: {commondesktop}\{#MyAppName}; Filename: {app}\Launcher.exe; WorkingDir: {app}; IconFilename: {#path}; Comment: {#MyAppName}; Check: CheckError
[Tasks]
Name: desktopicon; Description: Добавить ярлык на рабочий стол; GroupDescription: Создание ярлыков:
Name: Redist; Description: Дополнительное программное обеспечение:
Name: Redist\VCCheck; Description: Установить Microsoft Visual C++ 2005 Redist
Name: Redist\PhysXCheck; Description: Установить Nvidia PhysX
[Run]
Filename: {src}\Redist\vcredist_x86.exe; Parameters: /q; StatusMsg: Устанавливаем Microsoft Visual C++ 2005 Redist...; Flags: skipifdoesntexist; Tasks: VCCheck; Check: CheckError
Filename: {src}\Redist\PhysX.exe; Parameters: /q; StatusMsg: Устанавливаем Nvidia PhysX...; Flags: skipifdoesntexist; Tasks: PhysXCheck; Check: CheckError
[UninstallDelete]
Type: filesandordirs; Name: {app}
[Code]
const
PCFonFLY=true;
oneMb = 1048576;
notPCFonFLY=false;
var
LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2,LabelTime3,LabelTime4,PageNameLabel,PageNameLabel1,PageDescriptionLabel,
PageDescriptionLabel1,WelcomeLabel1,WelcomeLabel2,WelcomeLabel3,WelcomeLabel4,TotalNeedSpaceLabel,NeedSpaceLabel,FreeSpaceLabel,
FinishedHeadingLabel,FinishedHeadingLabel1,FinishedLabel,FinishedLabel1,FinishedLabel2,FinishedLabel3,StatusLabel: TLabel;
BmpFile: TBitmapImage;
ISDoneProgressBar1: TNewProgressBar;
#ifdef SecondProgressBar
LabelPct2: TLabel;
ISDoneProgressBar2:TNewProgressBar;
#endif
MyCancelButton: TButton;
FreeMB, TotalMB: Cardinal;
MyError:boolean;
PCFVer:double;
NeedSize, TotalNeedSize,Cancel: Integer;
path, name: String;
type
TCallback = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
function ISArcExtract(CurComponent:longword; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password, CfgFile, WorkPath: AnsiString; ExtractPCF: BOOL ):BOOL; external 'ISArcExtract@files:ISDone.dll stdcall';
function IS7ZipExtract(CurComponent:longword; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):BOOL; external 'IS7zipExtract@files:ISDone.dll stdcall';
function ISRarExtract(CurComponent:longword; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):BOOL; external 'ISRarExtract@files:ISDone.dll stdcall';
function ISPrecompExtract(CurComponent:longword; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):BOOL; external 'ISPrecompExtract@files:ISDone.dll stdcall';
function ISSRepExtract(CurComponent:longword; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):BOOL; external 'ISSrepExtract@files:ISDone.dll stdcall';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):BOOL; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall';
function ISDoneInitialize(RecordFileName:AnsiString; TimeType,Comp1,Comp2,Comp3:longword; PrecompVers: double; RecursiveSubDir:boolean; WinHandle, NeededMem:longint; callback:TCallback):BOOL; external 'ISDoneInitialize@files:ISDone.dll stdcall';
function ISDoneStop:BOOL; external 'ISDoneStop@files:ISDone.dll stdcall';
#ifdef FirewallInstallHelper
function AddApplicationToExceptionList(path: String; name: String): Boolean; external 'AddApplicationToExceptionListA@files:FirewallInstallHelper.dll stdcall setuponly';
function RemoveApplicationFromExceptionList(path: String): Boolean; external 'RemoveApplicationFromExceptionListA@{app}\FirewallInstallHelper.dll stdcall uninstallonly';
#endif
function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
begin
if OveralPct<=1000 then ISDoneProgressBar1.Position := OveralPct;
LabelPct1.Caption := IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
#ifdef SecondProgressBar
if CurrentPct<=1000 then
ISDoneProgressBar2.Position := CurrentPct;
LabelPct2.Caption := IntToStr(CurrentPct div 10)+'.'+chr(48 + CurrentPct mod 10)+'%';
#endif
LabelCurrFileName.Caption:=MinimizePathName(ExpandConstant('{cm:ExtractedFile} ')+CurrentFile, LabelCurrFileName.Font, LabelCurrFileName.Width);
LabelTime1.Caption:=ExpandConstant('{cm:ElapsedTime} ')+TimeStr2;
LabelTime2.Caption:=ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
LabelTime3.Caption:=ExpandConstant('{cm:AllElapsedTime} ')+TimeStr3;
LabelTime4.Caption:=ExpandConstant('{cm:AllElapsedTime} ')+TimeStr3;
Result := Cancel;
end;
// Перевод числа в строку с точностью 3 знака (%.3n) с округлением дробной части, если она есть
Function NumToStr(Float: Extended): String;
Begin
Result:= Format('%.2n', [Float]); StringChange(Result, ',', '.');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;
Function Size64(Hi, Lo: Integer): Extended;
Begin
Result:= Lo;
if Lo<0 then Result:= Result + $7FFFFFFF + $7FFFFFFF + 2;
for Hi:= Hi-1 Downto 0 do
Result:= Result + $7FFFFFFF + $7FFFFFFF + 2;
End;
procedure CancelButtonOnClick(Sender: TObject);
begin
if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then Cancel:=1;
end;
//******************************************* [ начало изображения 497 360 ] ***************************************************//
procedure Images_labels();
var
Page: TWizardPage;
begin
WizardForm.WizardBitmapImage.Width:=497
WizardForm.WelcomeLabel1.Visible:=False
WizardForm.WelcomeLabel2.Visible:=False
WizardForm.WizardBitmapImage2.Visible:=False
WizardForm.FinishedLabel.Visible:=False
WizardForm.FinishedHeadingLabel.Visible:=False
//******************************************* [ конец 497 360 изображения ] ***************************************************//
//******************************************* [ начало 497 58 изображения ] ***************************************************//
PageNameLabel:= TLabel.Create(WizardForm);
with PageNameLabel do
begin
Left:= WizardForm.PageNameLabel.Left;
Top:= WizardForm.PageNameLabel.Top;
Width:= WizardForm.PageNameLabel.Width;
Height:= WizardForm.PageNameLabel.Height;
AutoSize:= False;
WordWrap:= True;
Font.Name:= WizardForm.PageNameLabel.Font.Name;
Font.Style:= [fsBold];
Transparent:= True;
Parent:= WizardForm.MainPanel;
end;
PageDescriptionLabel:= TLabel.Create(WizardForm);
with PageDescriptionLabel do
begin
Left:= WizardForm.PageDescriptionLabel.Left-12;
Top:= WizardForm.PageDescriptionLabel.Top;
Height:= WizardForm.PageDescriptionLabel.Height;
Width:= ScaleX(260);
AutoSize:= False;
WordWrap:= True;
Font.Name:= WizardForm.PageDescriptionLabel.Font.Name;
Transparent:= True;
Parent:= WizardForm.MainPanel;
end;
with WizardForm do
begin
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
with MainPanel do
begin
with WizardSmallBitmapImage do
begin
Left:= ScaleX(0);
Top:= ScaleY(0);
Width:= Mainpanel.Width;
Height:= MainPanel.Height;
end;
end;
end;
//******************************************* [конец 497 58 изображения ] ***************************************************//
ExtractTemporaryFile('{#FinishImage}');
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\{#FinishImage}'));
BmpFile.Top:= ScaleY(0);
BmpFile.Left:= ScaleX(0);
BmpFile.Width:= ScaleX(497);
BmpFile.Height:= ScaleY(313);
BmpFile.Stretch:= true;
BmpFile.Parent:= WizardForm.FinishedPage;
////////////////////// begin WelcomePage //////////////////////
WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do begin
AutoSize:=False;
SetBounds(ScaleX(-26), ScaleY(31), ScaleX(550), ScaleY(70));
WordWrap:=True;
Alignment := taCenter;
Transparent:=True;
Font.Name:='Georgia';
Font.Size:= 14;
Font.Color:=$000000;
Font.Style:=[fsBold];
Caption:= ExpandConstant('{cm:Welcome1}');
Parent:=WizardForm.WelcomePage;
end;
WelcomeLabel2:= TLabel.Create(WizardForm);
with WelcomeLabel2 do begin
AutoSize:=False;
SetBounds(ScaleX(-27), ScaleY(30), ScaleX(550), ScaleY(70));
WordWrap:=True;
Alignment := taCenter;
Transparent:=True;
Font.Name:='Georgia';
Font.Size:= 14;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption:= ExpandConstant('{cm:Welcome1}');
Parent:=WizardForm.WelcomePage;
end;
WelcomeLabel3:=TLabel.Create(WizardForm);
with WelcomeLabel3 do begin
AutoSize:=False;
SetBounds(ScaleX(-26), ScaleY(121), ScaleX(550), ScaleY(200));
WordWrap:=True;
Alignment := taCenter;
Transparent:=True;
Font.Name:='Georgia';
Font.Size:= 10;
Font.Color:=$000000;
Font.Style := [fsBold, fsItalic];
Caption:= ExpandConstant('{cm:Welcome2}');
Parent:=WizardForm.WelcomePage;
end;
WelcomeLabel4:=TLabel.Create(WizardForm);
with WelcomeLabel4 do begin
AutoSize:=False;
SetBounds(ScaleX(-27), ScaleY(120), ScaleX(550), ScaleY(200));
WordWrap:=True;
Alignment := taCenter;
Transparent:=True;
Font.Name:='Georgia';
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style := [fsBold, fsItalic];
Caption:= ExpandConstant('{cm:Welcome2}');
Parent:=WizardForm.WelcomePage;
end;
////////////////////// end WelcomePage //////////////////////
////////////////////// begin SelectDirPage //////////////////////
WizardForm.DirEdit.Text:= MinimizePathName(WizardForm.DirEdit.Text, WizardForm.DirEdit.Font, WizardForm.DirEdit.Width);
////////////////////// end SelectDirPage //////////////////////
////////////////////// begin FinishedPage //////////////////////
FinishedHeadingLabel:= TLabel.Create(WizardForm);
with FinishedHeadingLabel do begin
SetBounds(ScaleX(-29), ScaleY(11), ScaleX(550), ScaleY(65));
AutoSize:= false;
Alignment := taCenter;
Transparent:= true;
WordWrap:= true;
Font.Name:='Georgia';
Font.Size:= 13;
Font.Color:=$00000;
Font.Style := [fsBold];
Caption:= ExpandConstant('{cm:Finished1}');
Parent:=WizardForm.FinishedPage;
end;
FinishedHeadingLabel1:= TLabel.Create(WizardForm);
with FinishedHeadingLabel1 do begin
SetBounds(ScaleX(-30), ScaleY(10), ScaleX(550), ScaleY(65));
AutoSize:= false;
Alignment := taCenter;
Transparent:= true;
WordWrap:= true;
Font.Name:='Georgia';
Font.Size:= 13;
Font.Color:=$FFFFFF;
Font.Style := [fsBold];
Caption:= ExpandConstant('{cm:Finished1}');
Parent:=WizardForm.FinishedPage;
end;
FinishedLabel:=TLabel.Create(WizardForm);
with FinishedLabel do begin
AutoSize:=False;
SetBounds(ScaleX(26), ScaleY(121), ScaleX(450), ScaleY(200));
WordWrap:=True;
Alignment := taCenter;
Transparent:=True;
Font.Name:='Georgia';
Font.Size:= 10;
Font.Color:=$000000;
Font.Style := [fsBold, fsItalic];
Caption:= ExpandConstant('{cm:Finished2}');
Parent:=WizardForm.FinishedPage;
end;
FinishedLabel1:=TLabel.Create(WizardForm);
with FinishedLabel1 do begin
AutoSize:=False;
SetBounds(ScaleX(25), ScaleY(120), ScaleX(450), ScaleY(200));
WordWrap:=True;
Alignment := taCenter;
Transparent:=True;
Font.Name:='Georgia';
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style := [fsBold, fsItalic];
Caption:= ExpandConstant('{cm:Finished2}');
Parent:=WizardForm.FinishedPage;
end;
FinishedLabel2:=TLabel.Create(WizardForm);
with FinishedLabel2 do begin
AutoSize:=False;
SetBounds(ScaleX(26), ScaleY(261), ScaleX(450), ScaleY(200));
WordWrap:=True;
Alignment := taCenter;
Transparent:=True;
Font.Name:='Georgia';
Font.Size:= 10;
Font.Color:=$000000;
Font.Style := [fsBold, fsItalic];
Caption:= ExpandConstant('{cm:Finished3}');
Parent:=WizardForm.FinishedPage;
end;
FinishedLabel3:=TLabel.Create(WizardForm);
with FinishedLabel3 do begin
AutoSize:=False;
SetBounds(ScaleX(25), ScaleY(260), ScaleX(450), ScaleY(200));
WordWrap:=True;
Alignment := taCenter;
Transparent:=True;
Font.Name:='Georgia';
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style := [fsBold, fsItalic];
Caption:= ExpandConstant('{cm:Finished3}');
Parent:=WizardForm.FinishedPage;
end;
end;
////////////////////// end FinishedPage //////////////////////
//******************************************* [ начало Место для установки ] ***************************************************//
Function MbOrTb(Byte: Extended): String;
begin
if Byte < 1024 then Result:= NumToStr(Byte) + ' Мб' else
if Byte/1024 < 1024 then Result:= NumToStr(round(Byte/1024*100)/100) + ' Гб' else
Result:= NumToStr(round((Byte/(1024*1024))*100)/100) + ' Тб'
end;
procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: String;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
NeedSpaceLabel.Caption := 'Игра займет на диске: '+ MbOrTb(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:=$000000;
end;
procedure SpaceLabel();
begin
NeedSize := {#NeedSize};
TotalNeedSize := {#TotalNeedSize};
WizardForm.DiskSpaceLabel.Hide;
FreeSpaceLabel := TLabel.Create(WizardForm);
FreeSpaceLabel.Parent := WizardForm.SelectDirPage;
FreeSpaceLabel.SetBounds(ScaleX(5), ScaleY(180), ScaleX(209), ScaleY(13));
TotalNeedSpaceLabel := TLabel.Create(WizardForm);
TotalNeedSpaceLabel.Parent := WizardForm.SelectDirPage;
TotalNeedSpaceLabel.SetBounds(ScaleX(5), ScaleY(200), ScaleX(209), ScaleY(13));
NeedSpaceLabel := TLabel.Create(WizardForm);
NeedSpaceLabel.Parent := WizardForm.SelectDirPage;
NeedSpaceLabel.SetBounds(ScaleX(5), ScaleY(220), ScaleX(209), ScaleY(13));
WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
end;
//******************************************* [ конец Место для установки ] ***************************************************//
//******************************************* [ начало элементы ISDone ] ***************************************************//
procedure HideComponents;
begin
ISDoneProgressBar1.Hide;
LabelPct1.Hide;
LabelCurrFileName.Hide;
LabelTime1.Hide;
LabelTime2.Hide;
MyCancelButton.Hide;
#ifdef SecondProgressBar
ISDoneProgressBar2.Hide;
LabelPct2.Hide;
#endif
end;
procedure ShowComponents;
var PBTop:integer;
begin
PBTop:=WizardForm.ProgressGauge.Top;
ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
with ISDoneProgressBar1 do begin
Parent := WizardForm.InstallingPage;
Left := ScaleX(0);
Top := PBTop;
Width := ScaleX(365);
Max := 1000;
Height := WizardForm.ProgressGauge.Height;
end;
LabelPct1 := TLabel.Create(WizardForm);
with LabelPct1 do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Left := ISDoneProgressBar1.Width+10;
Top := ISDoneProgressBar1.Top + 4;
Width := ScaleX(80);
end;
LabelCurrFileName := TLabel.Create(WizardForm);
with LabelCurrFileName do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := ISDoneProgressBar1.Width+ScaleX(30);
Left := ScaleX(0);
Top := WizardForm.FileNamelabel.Top;
end;
#ifdef SecondProgressBar
PBTop:=PBTop+ScaleY(25);
ISDoneProgressBar2 := TNewProgressBar.Create(WizardForm);
with ISDoneProgressBar2 do begin
Parent := WizardForm.InstallingPage;
Left := ScaleX(0);
Top := PBTop+ScaleY(8);
Width := ISDoneProgressBar1.Width;
Max := 1000;
Height := WizardForm.ProgressGauge.Height;
end;
LabelPct2 := TLabel.Create(WizardForm);
with LabelPct2 do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Left := ISDoneProgressBar2.Width+ScaleX(10);
Top := ISDoneProgressBar2.Top + ScaleY(4);
Width := ScaleX(80);
end;
#endif
LabelTime1 := TLabel.Create(WizardForm);
with LabelTime1 do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := 300;
Left := ScaleX(0);
Top := PBTop + ScaleY(35);
end;
LabelTime2 := TLabel.Create(WizardForm);
with LabelTime2 do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := 300;
Left := ScaleX(0);
Top := PBTop + ScaleY(55);
end;
LabelTime3 := TLabel.Create(WizardForm);
with LabelTime3 do begin
Parent := WizardForm.FinishedPage;
Transparent:=True;
Font.Name:='Georgia';
Font.Size:= 10;
Font.Color:=$000000;
Font.Style := [fsBold, fsItalic];
AutoSize := False;
Alignment := taCenter;
Width := 450;
Left := 27;
Top := 222;
end;
LabelTime4 := TLabel.Create(WizardForm);
with LabelTime4 do begin
Parent := WizardForm.FinishedPage;
Transparent:=True;
Font.Name:='Georgia';
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style := [fsBold, fsItalic];
AutoSize := False;
Alignment := taCenter;
Width := 450;
Left := 25;
Top := 220;
end;
StatusLabel := TLabel.Create(WizardForm);
with StatusLabel do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := 300;
Left := WizardForm.StatusLabel.Left;
Top := WizardForm.StatusLabel.Top;
Caption := ExpandConstant('{cm:ISDoneTitleBack}');
end;
MyCancelButton:=TButton.Create(WizardForm);
with MyCancelButton do begin
Parent:=WizardForm;
Width:=WizardForm.Cancelbutton.Width;
Caption:=WizardForm.Cancelbutton.Caption;
Left:=WizardForm.Cancelbutton.Left;
Top:=WizardForm.Cancelbutton.top;
OnClick:=@CancelButtonOnClick;
end;
end;
Procedure CurPageChanged(CurPageID: Integer);
Begin
PageNameLabel.Caption:= WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption:= WizardForm.PageDescriptionLabel.Caption;
if CurPageID = wpSelectDir then GetFreeSpaceCaption(nil);
if (CurPageID = wpFinished) and MyError then
begin
LabelTime3.Hide;
LabelTime4.Hide;
WizardForm.Caption:= ExpandConstant('{cm:Error}');
FinishedHeadingLabel.Caption:= ExpandConstant('{cm:ISDoneFinishedHeading}');
FinishedHeadingLabel.Font.Color:= $000000;
FinishedHeadingLabel1.Caption:= ExpandConstant('{cm:ISDoneFinishedHeading}');
FinishedHeadingLabel1.Font.Color:= $0000C0; // red (красный)
FinishedLabel.Font.Color:= $000000;
FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
FinishedLabel1.Font.Color:= $0000C0;
FinishedLabel1.Caption:= SetupMessage(msgSetupAborted) ;
end;
end;
function CheckError:boolean;
begin
result:= not MyError;
end;
procedure UnpackingISDone(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:longword;
tmp:integer;
begin
if CurStep = ssInstall then begin //Если необходимо, можно поменять на ssPostInstall
WizardForm.FileNamelabel.Hide;
WizardForm.ProgressGauge.Hide;
WizardForm.CancelButton.Hide;
ShowComponents;
WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
Cancel:=0;
// Распаковка всех необходимых файлов в папку {tmp}.
ExtractTemporaryFile('facompress.dll'); //ускоряет распаковку .arc архивов.
ExtractTemporaryFile('facompress_mt.dll'); //ускоряет распаковку .arc архивов.
// ExtractTemporaryFile('arc.ini');
// ExtractTemporaryFile('srep.exe');
#ifdef records
ExtractTemporaryFile('records.inf');
#endif
#ifdef precomp04
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('RTconsole.exe');
ExtractTemporaryFile('precomp04.exe');
#endif
#ifdef precomp038
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('RTconsole.exe');
ExtractTemporaryFile('precomp038.exe');
ExtractTemporaryFile('zlib1.dll');
#endif
#ifdef unrar
ExtractTemporaryFile('Unrar.dll');
#endif
// Подготавливаем переменную, содержащую всю информацию о выделенных компонентах для ISDone.dll
// максимум 96 компонентов.
Comps1:=0; Comps2:=0; Comps3:=0;
#ifdef Components
TmpValue:=1;
if IsComponentSelected('text\rus') then Comps1:=Comps1+TmpValue; //компонент 1
TmpValue:=TmpValue*2;
if IsComponentSelected('text\eng') then Comps1:=Comps1+TmpValue; //компонент 2
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\rus') then Comps1:=Comps1+TmpValue; //компонент 3
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\eng') then Comps1:=Comps1+TmpValue; //компонент 4
// .....
#endif
#ifdef precomp04
PCFVer:=0.4;
#else
#ifdef precomp038
PCFVer:=0.38;
#else
PCFVer:=0;
#endif
#endif
repeat
MyError:=true;
if not ISDoneInitialize(ExpandConstant('{src}\records.inf'), $F777, Comps1,Comps2,Comps3, PCFVer, false, MainForm.Handle, {#NeedMem}, @ProgressCallback) then break;
repeat
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data.bin'), ExpandConstant('{app}'), false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
// далее находятся закомментированые примеры различных комбинаций параметров и функций распаковки
//if not IS7ZipExtract ( 0, 0, ExpandConstant('{src}\data64.7z'), ExpandConstant('{app}'), false, '' ) then break;
if not ISSRepExtract ( 0, 0, ExpandConstant('{app}\data.srp'),ExpandConstant('{app}\data.pcf'), true ) then break;
//if not ISArcExtract ( 0, 0, ExpandConstant('{app}\data64.arc'), ExpandConstant('{app}\'), true, '', '', '',notPCFonFLY ) then break;
if not ISPrecompExtract( 0, 0, ExpandConstant('{app}\data.pcf'), ExpandConstant('{app}\data.7z'), true ) then break;
if not IS7ZipExtract ( 0, 0, ExpandConstant('{app}\data.7z'), ExpandConstant('{app}\'), true, '' ) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data1.bin'), ExpandConstant('{app}'), false, '', '', '',notPCFonFLY ) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data2.bin'), ExpandConstant('{app}'), false, '', '', '',notPCFonFLY ) then break;
(* if not ISSRepExtract ( 0, 0, ExpandConstant('{app}\data1\CODMW2.srep'), ExpandConstant('{app}\data1\CODMW2.pcf'), true ) then break;
if not ISPrecompExtract( 0, 0, ExpandConstant('{app}\data1\CODMW2.pcf'), ExpandConstant('{app}\data1\CODMW2.7z'), true ) then break;
if not IS7ZipExtract ( 0, 0, ExpandConstant('{app}\data1\CODMW2.7z'), ExpandConstant('{app}\data1'), true, '' ) then break;
// примеры использования компонентов и всплывающего запроса следующего диска:
if not ShowChangeDiskWindow('Пожалуйста, вставьте диск 2 и дождитесь его инициализации.', ExpandConstant('{src}'),'CODMW2_Disk2.arc' ) then break;
if not ISArcExtract ( 1, 0, ExpandConstant('{src}\rustext.arc'), ExpandConstant('{app}'), false, '', '', '', notPCFonFLY ) then break;
if not ISArcExtract ( 2, 0, ExpandConstant('{src}\engtext.arc'), ExpandConstant('{app}'), false, '', '', '', notPCFonFLY ) then break;
if not ISArcExtract ( 3, 0, ExpandConstant('{src}\rusvoice.arc'), ExpandConstant('{app}'), false, '', '', '', notPCFonFLY ) then break;
if not ISArcExtract ( 4, 0, ExpandConstant('{src}\engvoice.arc'), ExpandConstant('{app}'), false, '', '', '', notPCFonFLY ) then break;
if not ShowChangeDiskWindow('Пожалуйста, вставьте первый диск и дождитесь его инициализации.', ExpandConstant('{src}'),'CODMW_2.arc' ) then break;
// просто различные комбинации параметров в функциях распаковки
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\sds_ru2.arc'), ExpandConstant('{app}\data1'), false, '', '', ExpandConstant('{app}\data1'), PCFonFLY) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\sds_ru.arc'), ExpandConstant('{app}\data1'), false, '', '', ExpandConstant('{app}\data1'), PCFonFLY) then break;
if not ISPrecompExtract( 0, 0, ExpandConstant('{src}\data1\*.pcf'), ExpandConstant('{src}\data1'), false) then break;
if not IS7ZipExtract ( 0, 0, ExpandConstant('{src}\data1\sds_ru.7z'), ExpandConstant('{src}\data1'), true, '') then break;
if not ISRarExtract ( 0, 0, ExpandConstant('{src}\data_*.rar'), ExpandConstant('{app}'), false, '' ) then break;
if not ISRarExtract ( 0, 0, ExpandConstant('{src}\*part1.rar'), ExpandConstant('{app}'), false, 'Password' ) then break;
if not IS7ZipExtract ( 0, 0, ExpandConstant('{src}\data*.7z'), ExpandConstant('{app}\data1'), false, '' ) then break;
if not IS7ZipExtract ( 0, 0, ExpandConstant('{src}\sound.7z'), ExpandConstant('{app}\data1'), false, '' ) then break;
if not ISArcExtract ( 0, 33, ExpandConstant('{src}\dataR.arc'), ExpandConstant('{app}\data1'), false, '', '', '',notPCFonFLY) then break;
if not ISArcExtract ( 0, 33, ExpandConstant('{src}\CODMW_*.arc'), ExpandConstant('{app}\data1'), false, '', '', '',notPCFonFLY) then break;
if not ISArcExtract ( 0, 34, ExpandConstant('{src}\dataR.arc'), ExpandConstant('{app}\data1\'), false, '', '', '',notPCFonFLY) then break;
if not ISPrecompExtract( 0, 0, ExpandConstant('{src}\*.pcf'), ExpandConstant('{app}\data1'), false) then break;
if not ISPrecompExtract( 0, 0, ExpandConstant('{src}\data0.pcf'), ExpandConstant('{app}\data1'), false) then break;
if not ISSRepExtract ( 0, 0, ExpandConstant('{src}\*.srep'), ExpandConstant('{app}\data1\'), false) then break;
if not ISSRepExtract ( 0, 0, ExpandConstant('{src}\data02.srep'), ExpandConstant('{app}\data1\data.pcf'), false) then break;
*)
MyError:=false;
until true;
ISDoneStop;
until true;
HideComponents;
WizardForm.ProgressGauge.Show;
WizardForm.FileNamelabel.Show;
WizardForm.CancelButton.Visible:=true;
WizardForm.CancelButton.Enabled:=false;
end;
if (CurStep=ssPostInstall) and MyError then begin
Exec(ExpandConstant('{uninstallexe}'), '/SILENT','', sw_Hide, ewWaitUntilTerminated, tmp);
end;
end;
//******************************************* [ конец элементы ISDone ] ***************************************************//
//================== Удаление сохранений ==================//
procedure DeleteSavedGames(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep=usUninstall then
if DirExists(ExpandConstant('{userdocs}')+'\Criterion Games\{#MyAppName}') then
if MsgBox(ExpandConstant('{cm:DeleteSave}'), mbInformation, MB_YESNO) = idYes then
DelTree(ExpandConstant('{userdocs}')+'\Criterion Games\{#MyAppName}', True, True, True)
end;
//================== Удаление сохранений ==================//
procedure InitializeWizard();
begin
Images_labels;
SpaceLabel;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
#ifdef FirewallInstallHelper
if CurStep = ssPostInstall then
begin
path:=ExpandConstant('{#path}');
name:=ExpandConstant('{#MyAppName}');
AddApplicationToExceptionList(path, name);
end;
#endif
UnpackingISDone(CurStep);
if MyError then begin
WizardForm.StatusLabel.Hide;
StatusLabel.Show;
WizardForm.FileNamelabel.Hide;
WizardForm.ProgressGauge.Hide;
HideComponents;
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
DeleteSavedGames(CurUninstallStep);
#ifdef FirewallInstallHelper
if CurUninstallStep=usUninstall then
begin
path:=ExpandConstant('{#path}');
RemoveApplicationFromExceptionList(path)
UnloadDll(ExpandConstant('{app}\FirewallInstallHelper.dll'));
end;
#endif
end;[/more]
И в этот же скрипт помогите добавить DirectX.
Заранее благодарен.