Profrager
Не подскажеш, можно-ли [more=здесь]#define NeedSize "300000000000"
#define NeedMem 512
#define Components
#define SecondProgressBar
;#define records
;#define precomp04
;#define precomp038
;#define unrar
[Setup]
OutputBaseFilename=SicMin
AppName=SicMin
AppVerName=SicMin 1.1
Uninstallable=false
CreateUninstallRegKey=false
UpdateUninstallLogAppName=false
WizardImageFile=C:\Program Files (x86)\Inno Setup 5\WizModernImage\SetupClassic06.bmp
WizardSmallImageFile=C:\Program Files (x86)\Inno Setup 5\WizModernSmallImage\MicrosoftModernSmall01.bmp
DisableProgramGroupPage=true
UsePreviousGroup=false
AppendDefaultGroupName=false
DisableStartupPrompt=false
FlatComponentsList=false
UsePreviousSetupType=false
ShowTasksTreeLines=true
ShowLanguageDialog=no
LanguageDetectionMethod=none
SetupIconFile=E:\greylink\Downloads\Коллекция иконок(ico)\Bacardi Black\BacardiLinks.ico
CreateAppDir=false
UsePreviousAppDir=false
AllowUNCPath=false
AppendDefaultDirName=false
[Files]
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy
;Source: Include\facompress.dll; DestDir: {tmp}; Flags: dontcopy
;Source: Include\arc.ini; DestDir: {tmp}; Flags: dontcopy
;Source: Include\srep.exe; DestDir: {tmp}; Flags: dontcopy
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp04
Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp04.exe; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp038
Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef unrar
Source: Include\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#endif
Source: {temp}\Chrome.exe; DestDir: {tmp}
Source: {temp}\DotNet.exe; DestDir: {tmp}
Source: {temp}\DX9.7.10.exe; DestDir: {tmp}
Source: {temp}\Firefox.exe; DestDir: {tmp}
Source: {temp}\Flash.exe; DestDir: {tmp}
Source: {temp}\Opera106.exe; DestDir: {tmp}
Source: {temp}\PhysX.exe; DestDir: {tmp}
Source: {temp}\RuntimePack_Lite_x86_x64.exe; DestDir: {tmp}
Source: {temp}\UExtract.exe; DestDir: {tmp}
Source: {temp}\VCR_Ext_x86_x64.exe; DestDir: {tmp}
#ifdef Components
[Types]
Name: full; Description: Full installation; Flags: iscustom
[Run]
Filename: {tmp}\Chrome.exe; WorkingDir: {tmp}; Components: brous\Chrome
Filename: {tmp}\DotNet.exe; WorkingDir: {tmp}; Components: dll\DotNet
Filename: {tmp}\DX9.7.10.exe; WorkingDir: {tmp}; Components: dll\DX9
Filename: {tmp}\Firefox.exe; Parameters: " -y -gm2 -fm0"; WorkingDir: {tmp}; Components: brous\Firefox
Filename: {tmp}\Flash.exe; WorkingDir: {tmp}; Components: brous\Flash
Filename: {tmp}\Opera106.exe; Parameters: " -y -gm2 -fm0"; WorkingDir: {tmp}; Components: brous\Opera
Filename: {tmp}\PhysX.exe; Parameters: " /S"; WorkingDir: {tmp}; Components: dll\PhysX
Filename: {tmp}\RuntimePack_Lite_x86_x64.exe; Parameters: " -y -gm2 -fm0"; WorkingDir: {tmp}; Components: dll\Runtime
Filename: {tmp}\VCR_Ext_x86_x64.exe; Parameters: /S; WorkingDir: {tmp}; Components: dll\VCR
Filename: {tmp}\UExtract.exe; Parameters: " -y -gm2 -fm0"; WorkingDir: {tmp}; Components: UExtract
[Components]
Name: dll; Description: "Системные службы и драйверы"; Types: full;
Name: dll\VCR; Description: "Microsoft Visual C++ 2005-2008-2010 Redistributable Package Extended"; Types: full;
Name: dll\Runtime; Description: Пакет библиотек для исправления ошибок запуска программ; Types: full;
Name: dll\DotNet; Description: Microsoft .NET Framework 1.1-4.0; Types: full;
Name: dll\PhysX; Description: Драйвер PhysX; Types: full;
Name: dll\DX9; Description: DiprectX 9; Types: full;
Name: UExtract; Description: Распаковщик большинства известных архивов; Types: full
Name: brous; Description: Интернет-браузеры; Types: full
Name: brous\Flash; Description: Комплект Flash-плагинов для браузеров; Types: full;
Name: brous\Opera; Description: Браузер Opera; Types: full
Name: brous\Firefox; Description: Браузер Firefox; Types: full
Name: brous\Chrome; Description: Браузер Google Chrome; Types: full
#endif
[CustomMessages]
russian.ExtractedFile=Извлекается файл:
russian.Extracted=Распаковка архивов...
russian.CancelButton=Отменить распаковку
russian.Error=Ошибка распаковки!
russian.ElapsedTime=Прошло:
russian.RemainingTime=Осталось времени:
russian.EstimatedTime=Всего:
russian.AllElapsedTime=Время установки:
[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl
[Code]
const
PCFonFLY=true;
notPCFonFLY=false;
var
LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2,LabelTime3: TLabel;
ISDoneProgressBar1: TNewProgressBar;
#ifdef SecondProgressBar
LabelPct2: TLabel;
ISDoneProgressBar2:TNewProgressBar;
#endif
MyCancelButton: TButton;
Cancel:integer;
MyError:boolean;
PCFVer:double;
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';
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;
Result := Cancel;
end;
procedure CancelButtonOnClick(Sender: TObject);
begin
if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then Cancel:=1;
end;
procedure HideComponents;
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 ShowComponents;
var PBTop:integer;
begin
PBTop:=ScaleY(50);
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+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 MyError 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 MyError;
end;
procedure CurStepChanged(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:longword;
tmp:integer;
begin
if CurStep = ssPostInstall then begin //Если необходимо, можно поменять на ssInstall
WizardForm.ProgressGauge.Hide;
WizardForm.CancelButton.Hide;
ShowComponents;
WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
Cancel:=0;
// Распаковка всех необходимых файлов в папку {tmp}.
// ExtractTemporaryFile('facompress.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('dll\VCR') then Comps1:=Comps1+TmpValue; //компонент 1
TmpValue:=TmpValue*2;
if IsComponentSelected('dll\Runtime') then Comps1:=Comps1+TmpValue; //компонент 2
TmpValue:=TmpValue*2;
if IsComponentSelected('dll\DotNet') then Comps1:=Comps1+TmpValue; //компонент 3
TmpValue:=TmpValue*2;
if IsComponentSelected('dll\PhysX') then Comps1:=Comps1+TmpValue; //компонент 4
TmpValue:=TmpValue*2;
if IsComponentSelected('dll\DX9') then Comps1:=Comps1+TmpValue; //компонент 5
TmpValue:=TmpValue*2;
if IsComponentSelected('UExtract') then Comps1:=Comps1+TmpValue; //компонент 6
TmpValue:=TmpValue*2;
if IsComponentSelected('brous\Flash') then Comps1:=Comps1+TmpValue; //компонент 7
TmpValue:=TmpValue*2;
if IsComponentSelected('brous\Opera') then Comps1:=Comps1+TmpValue; //компонент 8
TmpValue:=TmpValue*2;
if IsComponentSelected('brous\Firefox') then Comps1:=Comps1+TmpValue; //компонент 9
TmpValue:=TmpValue*2;
if IsComponentSelected('brous\Chrome') then Comps1:=Comps1+TmpValue; //компонент 10
#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('{tmp}\*.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}\data64a.srep'),ExpandConstant('{app}\data64.arc'), 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}\CODMW_2.arc'), ExpandConstant('{app}\data1'), 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.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;
[/more] сделать, чтоб установка компонентов отбражалась на втором прогресс-баре?
И если можно, то где я ошибся, вторую неделю уже бьюсь об стену...
Не подскажеш, можно-ли [more=здесь]#define NeedSize "300000000000"
#define NeedMem 512
#define Components
#define SecondProgressBar
;#define records
;#define precomp04
;#define precomp038
;#define unrar
[Setup]
OutputBaseFilename=SicMin
AppName=SicMin
AppVerName=SicMin 1.1
Uninstallable=false
CreateUninstallRegKey=false
UpdateUninstallLogAppName=false
WizardImageFile=C:\Program Files (x86)\Inno Setup 5\WizModernImage\SetupClassic06.bmp
WizardSmallImageFile=C:\Program Files (x86)\Inno Setup 5\WizModernSmallImage\MicrosoftModernSmall01.bmp
DisableProgramGroupPage=true
UsePreviousGroup=false
AppendDefaultGroupName=false
DisableStartupPrompt=false
FlatComponentsList=false
UsePreviousSetupType=false
ShowTasksTreeLines=true
ShowLanguageDialog=no
LanguageDetectionMethod=none
SetupIconFile=E:\greylink\Downloads\Коллекция иконок(ico)\Bacardi Black\BacardiLinks.ico
CreateAppDir=false
UsePreviousAppDir=false
AllowUNCPath=false
AppendDefaultDirName=false
[Files]
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy
;Source: Include\facompress.dll; DestDir: {tmp}; Flags: dontcopy
;Source: Include\arc.ini; DestDir: {tmp}; Flags: dontcopy
;Source: Include\srep.exe; DestDir: {tmp}; Flags: dontcopy
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp04
Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp04.exe; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp038
Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef unrar
Source: Include\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#endif
Source: {temp}\Chrome.exe; DestDir: {tmp}
Source: {temp}\DotNet.exe; DestDir: {tmp}
Source: {temp}\DX9.7.10.exe; DestDir: {tmp}
Source: {temp}\Firefox.exe; DestDir: {tmp}
Source: {temp}\Flash.exe; DestDir: {tmp}
Source: {temp}\Opera106.exe; DestDir: {tmp}
Source: {temp}\PhysX.exe; DestDir: {tmp}
Source: {temp}\RuntimePack_Lite_x86_x64.exe; DestDir: {tmp}
Source: {temp}\UExtract.exe; DestDir: {tmp}
Source: {temp}\VCR_Ext_x86_x64.exe; DestDir: {tmp}
#ifdef Components
[Types]
Name: full; Description: Full installation; Flags: iscustom
[Run]
Filename: {tmp}\Chrome.exe; WorkingDir: {tmp}; Components: brous\Chrome
Filename: {tmp}\DotNet.exe; WorkingDir: {tmp}; Components: dll\DotNet
Filename: {tmp}\DX9.7.10.exe; WorkingDir: {tmp}; Components: dll\DX9
Filename: {tmp}\Firefox.exe; Parameters: " -y -gm2 -fm0"; WorkingDir: {tmp}; Components: brous\Firefox
Filename: {tmp}\Flash.exe; WorkingDir: {tmp}; Components: brous\Flash
Filename: {tmp}\Opera106.exe; Parameters: " -y -gm2 -fm0"; WorkingDir: {tmp}; Components: brous\Opera
Filename: {tmp}\PhysX.exe; Parameters: " /S"; WorkingDir: {tmp}; Components: dll\PhysX
Filename: {tmp}\RuntimePack_Lite_x86_x64.exe; Parameters: " -y -gm2 -fm0"; WorkingDir: {tmp}; Components: dll\Runtime
Filename: {tmp}\VCR_Ext_x86_x64.exe; Parameters: /S; WorkingDir: {tmp}; Components: dll\VCR
Filename: {tmp}\UExtract.exe; Parameters: " -y -gm2 -fm0"; WorkingDir: {tmp}; Components: UExtract
[Components]
Name: dll; Description: "Системные службы и драйверы"; Types: full;
Name: dll\VCR; Description: "Microsoft Visual C++ 2005-2008-2010 Redistributable Package Extended"; Types: full;
Name: dll\Runtime; Description: Пакет библиотек для исправления ошибок запуска программ; Types: full;
Name: dll\DotNet; Description: Microsoft .NET Framework 1.1-4.0; Types: full;
Name: dll\PhysX; Description: Драйвер PhysX; Types: full;
Name: dll\DX9; Description: DiprectX 9; Types: full;
Name: UExtract; Description: Распаковщик большинства известных архивов; Types: full
Name: brous; Description: Интернет-браузеры; Types: full
Name: brous\Flash; Description: Комплект Flash-плагинов для браузеров; Types: full;
Name: brous\Opera; Description: Браузер Opera; Types: full
Name: brous\Firefox; Description: Браузер Firefox; Types: full
Name: brous\Chrome; Description: Браузер Google Chrome; Types: full
#endif
[CustomMessages]
russian.ExtractedFile=Извлекается файл:
russian.Extracted=Распаковка архивов...
russian.CancelButton=Отменить распаковку
russian.Error=Ошибка распаковки!
russian.ElapsedTime=Прошло:
russian.RemainingTime=Осталось времени:
russian.EstimatedTime=Всего:
russian.AllElapsedTime=Время установки:
[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl
[Code]
const
PCFonFLY=true;
notPCFonFLY=false;
var
LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2,LabelTime3: TLabel;
ISDoneProgressBar1: TNewProgressBar;
#ifdef SecondProgressBar
LabelPct2: TLabel;
ISDoneProgressBar2:TNewProgressBar;
#endif
MyCancelButton: TButton;
Cancel:integer;
MyError:boolean;
PCFVer:double;
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';
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;
Result := Cancel;
end;
procedure CancelButtonOnClick(Sender: TObject);
begin
if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then Cancel:=1;
end;
procedure HideComponents;
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 ShowComponents;
var PBTop:integer;
begin
PBTop:=ScaleY(50);
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+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 MyError 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 MyError;
end;
procedure CurStepChanged(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:longword;
tmp:integer;
begin
if CurStep = ssPostInstall then begin //Если необходимо, можно поменять на ssInstall
WizardForm.ProgressGauge.Hide;
WizardForm.CancelButton.Hide;
ShowComponents;
WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
Cancel:=0;
// Распаковка всех необходимых файлов в папку {tmp}.
// ExtractTemporaryFile('facompress.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('dll\VCR') then Comps1:=Comps1+TmpValue; //компонент 1
TmpValue:=TmpValue*2;
if IsComponentSelected('dll\Runtime') then Comps1:=Comps1+TmpValue; //компонент 2
TmpValue:=TmpValue*2;
if IsComponentSelected('dll\DotNet') then Comps1:=Comps1+TmpValue; //компонент 3
TmpValue:=TmpValue*2;
if IsComponentSelected('dll\PhysX') then Comps1:=Comps1+TmpValue; //компонент 4
TmpValue:=TmpValue*2;
if IsComponentSelected('dll\DX9') then Comps1:=Comps1+TmpValue; //компонент 5
TmpValue:=TmpValue*2;
if IsComponentSelected('UExtract') then Comps1:=Comps1+TmpValue; //компонент 6
TmpValue:=TmpValue*2;
if IsComponentSelected('brous\Flash') then Comps1:=Comps1+TmpValue; //компонент 7
TmpValue:=TmpValue*2;
if IsComponentSelected('brous\Opera') then Comps1:=Comps1+TmpValue; //компонент 8
TmpValue:=TmpValue*2;
if IsComponentSelected('brous\Firefox') then Comps1:=Comps1+TmpValue; //компонент 9
TmpValue:=TmpValue*2;
if IsComponentSelected('brous\Chrome') then Comps1:=Comps1+TmpValue; //компонент 10
#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('{tmp}\*.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}\data64a.srep'),ExpandConstant('{app}\data64.arc'), 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}\CODMW_2.arc'), ExpandConstant('{app}\data1'), 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.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;
[/more] сделать, чтоб установка компонентов отбражалась на втором прогресс-баре?
И если можно, то где я ошибся, вторую неделю уже бьюсь об стену...