#define NeedSize "1469280321"
#define NeedMem 512
;#define SecondProgressBar
;#define Components
;#define records
#define facompress
;#define PrecompInside
;#define SrepInside
;#define MSCInside
;#define precomp "0.42"
;#define unrar
;#define XDelta
;#define PackZIP
#include "skin.iss"
#define MyAppName "Blitzkrieg 2"
[Setup]
AppName={#MyAppName}
AppVerName={#MyAppName}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputDir=Output
OutputBaseFilename=Setup
SetupIconFile=icon.ico
UninstallFilesDir={app}\Uninstall
VersionInfoCopyright=Nazbek
SolidCompression=yes
WizardImageFile=Img2.bmp
WizardSmallImageFile=WizardSmallImage.bmp
#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; 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\CDV Software Entertainment AG\Blitzkrieg 2\English"; ValueName: "group"; ValueType: String; ValueData: "Blitzkrieg 2"; Flags: uninsdeletekey; Check: CheckError
Root: HKLM; Subkey: "SOFTWARE\CDV Software Entertainment AG\Blitzkrieg 2\English"; ValueName: "language"; ValueType: String; ValueData: "English"; Flags: uninsdeletekey; Check: CheckError
Root: HKLM; Subkey: "SOFTWARE\CDV Software Entertainment AG\Blitzkrieg 2\English"; ValueName: "patch version"; ValueType: String; ValueData: "3"; Flags: uninsdeletekey; Check: CheckError
Root: HKLM; Subkey: "SOFTWARE\CDV Software Entertainment AG\Blitzkrieg 2\English"; ValueName: "status"; ValueType: String; ValueData: "Installation finished"; Flags: uninsdeletekey; Check: CheckError
Root: HKLM; Subkey: "SOFTWARE\CDV Software Entertainment AG\Blitzkrieg 2\English"; ValueName: "target folder"; ValueType: String; ValueData: "{app}"; Flags: uninsdeletekey; Check: CheckError
Root: HKLM; Subkey: "SOFTWARE\CDV Software Entertainment AG\Blitzkrieg 2\English"; ValueName: "version"; ValueType: String; ValueData: "1.4"; Flags: uninsdeletekey; Check: CheckError
[Icons]
Name: {group}\Blitzkrieg 2; Filename: {app}\EXE\bin\Game.exe; WorkingDir: {app}\EXE\bin; Check: CheckError
Name: {group}\Редактор Карт; Filename: {app}\EXE\bin\B2_MAPEDITOR.exe; WorkingDir: {app}\EXE\bin; Check: CheckError
Name: {group}\Удаление игры; Filename: {uninstallexe}; Check: CheckError
Name: {userdesktop}\Blitzkrieg 2; Filename: {app}\EXE\bin\Game.exe; WorkingDir: {app}\EXE\bin; Check: CheckError
[Tasks]
Name: VCCheck; Description: Установить Microsoft Visual C++
Name: DirectXCheck; Description: Установить DirectX
[Run]
Filename: {src}\Redist\VCredist.exe; Parameters: /q; StatusMsg: Устанавливаем Microsoft Visual C++...; Flags: skipifdoesntexist; Tasks: VCCheck; Check: CheckError
Filename: {src}\Redist\dxwebsetup.exe; StatusMsg: Устанавливаем DirectX...; WorkingDir: {src}\Redist; Flags: skipifdoesntexist; Tasks: DirectXCheck; Check: CheckError
[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: Output\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
Source: Img2.bmp; DestDir: {tmp}; Flags: dontcopy
Source: ISSkin.dll; DestDir: {app}; Attribs: hidden system
Source: PitchBlack.cjstyles; DestDir: {app}; Attribs: hidden system
Source: papka.bmp; DestDir: "{tmp}"; Flags: dontcopy
[Messages]
BeveledLabel=Created by Nazbek
[CustomMessages]
russian.ExtractedFile=Извлекается файл:
russian.Extracted=Распаковка архивов...
russian.CancelButton=Отменить распаковку
russian.Error=Ошибка распаковки!
russian.Error2=Установка %n{#MyAppName} %nне завершена.
russian.Error3=%nВо время установки произошла ошибка, пожалуйста отключите сторонние программы и повторите попытку установки.%n%n%nНажмите «Завершить», чтобы выйти.
russian.ElapsedTime=Прошло:
russian.RemainingTime=Осталось времени:
russian.EstimatedTime=Всего:
russian.AllElapsedTime=Время установки:
russian.WelcomeLabel1=Программа установит игру %n{#MyAppName} на Ваш компьютер.
russian.WelcomeLabel2=Рекомендуется закрыть%n антивирусные пакеты, а%n также все прочие %nприложения перед тем, как%n продолжить.%n%n%nНажмите «Далее», чтобы %nпродолжить,или «Отмена»,%n чтобы выйти из программы %nустановки.
russian.FinisLabel1=Игра %n{#MyAppName}%n установлена на Ваш%n компьютер.
russian.FinisLabel2=%n%nДля ее запуска выберите%n соотвествующий ярлык%n в меню "Пуск" или на Рабочем столе. %n%nНажмите «Завершить», %nчтобы выйти из программы установки.
[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl
[UninstallDelete]
Type: filesandordirs; Name: {app}
Код:
const
PCFonFLY=true;
notPCFonFLY=false;
var
LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2: 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
FinishedHeadingLabel:= TLabel.Create(WizardForm);
FinishedHeadingLabel.Left := ScaleX(271);
FinishedHeadingLabel.Top := ScaleY(91);
FinishedHeadingLabel.Width := ScaleX(210);
FinishedHeadingLabel.Height := ScaleY(100);
FinishedHeadingLabel.AutoSize := False;
FinishedHeadingLabel.WordWrap := True;
FinishedHeadingLabel.Alignment := taCenter;
FinishedHeadingLabel.Font.Size := 8;
FinishedHeadingLabel.Font.Color:= clblack;
FinishedHeadingLabel.Font.Style:= [fsBold]
FinishedHeadingLabel.Font.Name:= 'Georgia'
FinishedHeadingLabel.ShowAccelChar := False;
FinishedHeadingLabel.Caption :=ExpandConstant('{cm:Error2}');
FinishedHeadingLabel.Transparent := True;
FinishedHeadingLabel.Parent := WizardForm.FinishedPage;
FLabel1 := TLabel.Create(WizardForm);
FLabel1.Left := ScaleX(270);
FLabel1.Top := ScaleY(90);
FLabel1.Width := ScaleX(210);
FLabel1.Height := ScaleY(100);
FLabel1.AutoSize := False;
FLabel1.Alignment := taCenter;
FLabel1.WordWrap := True;
FLabel1.Font.Size := 8;
FLabel1.Font.Name := 'Georgia'
FLabel1.Font.Color:= clRed;
FLabel1.Font.Style:= [fsBold]
FLabel1.ShowAccelChar := False;
FLabel1.Caption := ExpandConstant('{cm:Error2}');
FLabel1.Transparent := True;
FLabel1.Parent := WizardForm.FinishedPage;
FinishedHeadingLabel1:= TLabel.Create(WizardForm);
FinishedHeadingLabel1.Left := ScaleX(271);
FinishedHeadingLabel1.Top := ScaleY(149);
FinishedHeadingLabel1.Width := ScaleX(210);
FinishedHeadingLabel1.Height := ScaleY(234);
FinishedHeadingLabel1.AutoSize := False;
FinishedHeadingLabel1.WordWrap := True;
FinishedHeadingLabel1.Alignment := taCenter;
FinishedHeadingLabel1.Font.Size := 8;
FinishedHeadingLabel1.Font.Color:= clblack;
FinishedHeadingLabel1.Font.Style:= [fsBold]
FinishedHeadingLabel1.Font.Name:= 'Georgia'
FinishedHeadingLabel1.ShowAccelChar := False;
FinishedHeadingLabel1.Caption :=ExpandConstant('{cm:Error3}');
FinishedHeadingLabel1.Transparent := True;
FinishedHeadingLabel1.Parent := WizardForm.FinishedPage;
FLabel2 :=TLabel.Create(WizardForm);
FLabel2.Top := ScaleY(150);
FLabel2.Left := ScaleX(270);
FLabel2.Width := ScaleX(210);
FLabel2.Height := ScaleY(234);
FLabel2.AutoSize := False;
FLabel2.WordWrap := True;
FLabel2.Alignment := taCenter;
FLabel2.Font.Size := 8;
FLabel2.Font.Name := 'Georgia'
FLabel2.Font.Style:= [fsBold]
FLabel2.Font.Color:= clred;
FLabel2.ShowAccelChar := False;
FLabel2.Caption := ExpandConstant('{cm:Error3}');
FLabel2.Transparent := True;
FLabel2.Parent := WizardForm.FinishedPage;
//FLabel1 и FLabel2 взяты с вашего скрипта/проекта!
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 //Если необходимо, можно поменять на 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
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 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}\*.bin'), ExpandConstant('{app}'), '', 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;
[/spoiler]
[spoiler=вот skin.iss][code]
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';
const
Color=clwhite;
var
PageNameLabel, PageDescriptionLabel, WelcomeLabel1,WelcomeLabel2,FLabel1, FLabel2, WLabel1, WLabel2, WelcomeLabel4,FinishedHeadingLabel, FinishedHeadingLabel1,WelcomeLabel3: TLabel;
//**************************//Начало растяжения WizardImage//******************************************//
procedure WizardImage();
begin
WizardForm.WizardBitmapImage.Width:= ScaleX(497);
WizardForm.WizardBitmapImage2.Width:= ScaleX(497);
WelcomeLabel1:= TLabel.Create(WizardForm);
WelcomeLabel1.Left := ScaleX(276);
WelcomeLabel1.Top := ScaleY(89);
WelcomeLabel1.Width := ScaleX(205);
WelcomeLabel1.Height := ScaleY(219);
WelcomeLabel1.AutoSize := False;
WelcomeLabel1.WordWrap := True;
WelcomeLabel1.Alignment := taCenter;
WelcomeLabel1.Font.Size := 8;
WelcomeLabel1.Font.Color:= clblack;
WelcomeLabel1.Font.Style:= [fsBold]
WelcomeLabel1.Font.Name:= 'Georgia'
WelcomeLabel1.ShowAccelChar := False;
WelcomeLabel1.Caption :=ExpandConstant('{cm:WelcomeLabel1}');
WelcomeLabel1.Transparent := True;
WelcomeLabel1.Parent := WizardForm.WelcomePage;
WLabel1 := TLabel.Create(WizardForm);
WLabel1.Left := ScaleX(275);
WLabel1.Top := ScaleY(90);
WLabel1.Width := ScaleX(205);
WLabel1.Height := ScaleY(219);
WLabel1.AutoSize := False;
WLabel1.WordWrap := True;
WLabel1.Alignment := taCenter;
WLabel1.Font.Size := 8;
WLabel1.Font.Color:= clwhite;
WLabel1.Font.Style:= [fsBold]
WLabel1.Font.Name:= 'Georgia'
WLabel1.ShowAccelChar := False;
WLabel1.Caption :=ExpandConstant('{cm:WelcomeLabel1}');
WLabel1.Transparent := True;
WLabel1.Parent := WizardForm.WelcomePage;
WelcomeLabel2:= TLabel.Create(WizardForm);
WelcomeLabel2.Left := ScaleX(272);
WelcomeLabel2.Top := ScaleY(150);
WelcomeLabel2.Width := ScaleX(210);
WelcomeLabel2.Height := ScaleY(234);
WelcomeLabel2.AutoSize := False;
WelcomeLabel2.WordWrap := True;
WelcomeLabel2.Alignment := taCenter;
WelcomeLabel2.Font.Size := 8;
WelcomeLabel2.Font.Color:= clblack;
WelcomeLabel2.Font.Style:= [fsBold]
WelcomeLabel2.Font.Name:= 'Georgia'
WelcomeLabel2.ShowAccelChar := False;
WelcomeLabel2.Caption :=ExpandConstant('{cm:WelcomeLabel2}');
WelcomeLabel2.Transparent := True;
WelcomeLabel2.Parent := WizardForm.WelcomePage;
WLabel2 :=TLabel.Create(WizardForm);
WLabel2.Top := ScaleY(149);
WLabel2.Left := ScaleX(271);
WLabel2.Width := ScaleX(210);
WLabel2.Height := ScaleY(234);
WLabel2.AutoSize := False;
WLabel2.WordWrap := True;
WLabel2.Alignment := taCenter;
WLabel2.Font.Size := 8;
WLabel2.Font.Style:= [fsBold]
WLabel2.Font.Color:= clwhite;
WLabel2.Font.Name:= 'Georgia'
WLabel2.ShowAccelChar := False;
WLabel2.Caption := ExpandConstant('{cm:WelcomeLabel2}');
WLabel2.Transparent := True;
WLabel2.Parent := WizardForm.WelcomePage;
FinishedHeadingLabel:= TLabel.Create(WizardForm);
FinishedHeadingLabel.Left := ScaleX(271);
FinishedHeadingLabel.Top := ScaleY(91);
FinishedHeadingLabel.Width := ScaleX(210);
FinishedHeadingLabel.Height := ScaleY(100);
FinishedHeadingLabel.AutoSize := False;
FinishedHeadingLabel.WordWrap := True;
FinishedHeadingLabel.Alignment := taCenter;
FinishedHeadingLabel.Font.Size := 8;
FinishedHeadingLabel.Font.Color:= clblack;
FinishedHeadingLabel.Font.Style:= [fsBold]
FinishedHeadingLabel.Font.Name:= 'Georgia'
FinishedHeadingLabel.ShowAccelChar := False;
FinishedHeadingLabel.Caption :=ExpandConstant('{cm:FinisLabel1}');
FinishedHeadingLabel.Transparent := True;
FinishedHeadingLabel.Parent := WizardForm.FinishedPage;
FLabel1 := TLabel.Create(WizardForm);
FLabel1.Left := ScaleX(270);
FLabel1.Top := ScaleY(90);
FLabel1.Width := ScaleX(210);
FLabel1.Height := ScaleY(100);
FLabel1.AutoSize := False;
FLabel1.Alignment := taCenter;
FLabel1.WordWrap := True;
FLabel1.Font.Size := 8;
FLabel1.Font.Name := 'Georgia'
FLabel1.Font.Color:= clwhite;
FLabel1.Font.Style:= [fsBold]
FLabel1.ShowAccelChar := False;
FLabel1.Caption := ExpandConstant('{cm:FinisLabel1}');
FLabel1.Transparent := True;
FLabel1.Parent := WizardForm.FinishedPage;
FinishedHeadingLabel1:= TLabel.Create(WizardForm);
FinishedHeadingLabel1.Left := ScaleX(271);
FinishedHeadingLabel1.Top := ScaleY(149);
FinishedHeadingLabel1.Width := ScaleX(210);
FinishedHeadingLabel1.Height := ScaleY(234);
FinishedHeadingLabel1.AutoSize := False;
FinishedHeadingLabel1.WordWrap := True;
FinishedHeadingLabel1.Alignment := taCenter;
FinishedHeadingLabel1.Font.Size := 8;
FinishedHeadingLabel1.Font.Color:= clblack;
FinishedHeadingLabel1.Font.Style:= [fsBold]
FinishedHeadingLabel1.Font.Name:= 'Georgia'
FinishedHeadingLabel1.ShowAccelChar := False;
FinishedHeadingLabel1.Caption :=ExpandConstant('{cm:FinisLabel2}');
FinishedHeadingLabel1.Transparent := True;
FinishedHeadingLabel1.Parent := WizardForm.FinishedPage;
FLabel2 :=TLabel.Create(WizardForm);
FLabel2.Top := ScaleY(150);
FLabel2.Left := ScaleX(270);
FLabel2.Width := ScaleX(210);
FLabel2.Height := ScaleY(234);
FLabel2.AutoSize := False;
FLabel2.WordWrap := True;
FLabel2.Alignment := taCenter;
FLabel2.Font.Size := 8;
FLabel2.Font.Name := 'Georgia'
FLabel2.Font.Style:= [fsBold]
FLabel2.Font.Color:= clwhite;
FLabel2.ShowAccelChar := False;
FLabel2.Caption := ExpandConstant('{cm:FinisLabel2}');
FLabel2.Transparent := True;
FLabel2.Parent := WizardForm.FinishedPage;
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.FinishedLabel.Hide;
WizardForm.FinishedHeadingLabel.Hide;
end;
//**************************//Конец растяжения WizardImage//******************************************//
//**************************//Начало растяжения WizardSmallImage//******************************************//
procedure WizardSmallImage();
begin
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, Width, Height);
PageNameLabel.Transparent:= True;
PageNameLabel.Font:= WizardForm.PageNameLabel.Font;
PageNameLabel.Font.Color:= clblack;
PageNameLabel.Parent:= WizardForm.MainPanel;
PageDescriptionLabel:= TLabel.Create(WizardForm);
with PageDescriptionLabel do
begin
Left:= WizardForm.PageDescriptionLabel.Left-12;
Top:= WizardForm.PageDescriptionLabel.Top;
Height:= WizardForm.PageDescriptionLabel.Height;
Width:= ScaleX(280);
AutoSize:= False;
WordWrap:= True;
Font.Name:= WizardForm.PageDescriptionLabel.Font.Name;
Transparent:= True;
Parent:= WizardForm.MainPanel;
end;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
end;
procedure RepaintInstall();
begin
ExtractTemporaryFile('papka.bmp');
WizardForm.Font.Color:=clblack;
WizardForm.Color:=Color;
WizardForm.WelcomePage.Color:=Color;
WizardForm.InnerPage.Color:=Color;
WizardForm.FinishedPage.Color:=Color;
WizardForm.SelectDirPage.Color:=Color;
WizardForm.SelectComponentsPage.Color:=Color;
WizardForm.SelectProgramGroupPage.Color:=Color;
WizardForm.SelectTasksPage.Color:=Color;
WizardForm.ReadyPage.Color:=Color;
WizardForm.InstallingPage.Color:=Color;
WizardForm.PageNameLabel.Color:=Color;
WizardForm.PageNameLabel.Font.Color:=clblack;
WizardForm.MainPanel.Color:=Color;
WizardForm.SelectDirLabel.Color:=Color;
WizardForm.SelectDirBrowseLabel.Color:=Color;
WizardForm.DirEdit.Color:=Color;
WizardForm.DiskSpaceLabel.Color:=Color;
WizardForm.ComponentsList.Color:=Color;
WizardForm.SelectComponentsLabel.Color:=Color;
WizardForm.TypesCombo.Hide;
WizardForm.ComponentsDiskSpaceLabel.Hide;
WizardForm.GroupEdit.Color:=Color;
WizardForm.SelectStartMenuFolderLabel.Color:=Color;
WizardForm.SelectStartMenuFolderBrowseLabel.Color:=Color;
WizardForm.SelectTasksLabel.Color:=Color;
WizardForm.TasksList.Color:=Color;
WizardForm.ReadyMemo.Color:=Color;
WizardForm.ReadyMemo.ScrollBars:= ssNone
WizardForm.ReadyLabel.Color:=Color;
WizardForm.StatusLabel.Color:=Color;
WizardForm.FilenameLabel.Color:=Color;
WizardForm.SelectDirBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\papka.bmp'));
WizardForm.SelectDirBitmapImage.AutoSize:=true;
WizardForm.SelectGroupBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\papka.bmp'));
WizardForm.SelectGroupBitmapImage.AutoSize:=true;
end;
procedure InitializeWizard();
begin
WizardImage();
WizardSmallImage();
end;
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('PitchBlack.cjstyles');
LoadSkin(ExpandConstant('{tmp}\PitchBlack.cjstyles'), '');
Result:= true
end;
function InitializeUninstall(): Boolean;
begin
FileCopy(ExpandConstant('{app}\isskin.dll'),
ExpandConstant('{tmp}\isskin.dll'), False);
FileCopy(ExpandConstant('{app}\PitchBlack.cjstyles'),
ExpandConstant('{tmp}\PitchBlack.cjstyles'), False); LoadSkinU(ExpandConstant('{tmp}\PitchBlack.cjstyles'), '');
Result:=True;
end;
procedure DeinitializeSetup();
begin
UnloadSkin();
end;
procedure DeinitializeUninstall();
begin
UnloadSkinU();
end;
[/spoiler]
Если вам трудно то как в isdone 0.6 final сделать так чтобы при отмене распаковки инсталлятор просто закрывался без выхода финишней страницы
Помогите если не трудно