Войти

Показать полную графическую версию : Скрипты Inno Setup. Помощь и советы [часть 8]


Страниц : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 [96] 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126

pist0n
17-03-2017, 21:22
Кнопка завершить это этап ssDone, вот в нём и пишите удаление папок (DelTree) или файлов (DeleteFile). »
спс - чёт не додумался - теперь всё вроде норм удаляет после нажатия кнопки завершить - так вписал
function NextButtonClick( CurPageID: Integer ): Boolean;
var
_nErr: Integer;
begin
case CurPageID of
wpFinished: if FileExists (ExpandConstant( '{app}\movies\en.pak' ) ) then
Result := DeleteFile( ExpandConstant('{app}\movies\en.pak'))
else Result := True;
else Result := True;
end;
end;
а не будет типа конфликта или ошибки какой-нибудь, если будет выбран другой компонент установки, при котором этого файла для удаления не будет?

Dodakaedr
17-03-2017, 21:31
а не будет типа конфликта или ошибки какой-нибудь, если будет выбран другой компонент установки, при котором этого файла для удаления не будет? »
Не будет. Во первых идет проверка файла (FileExists), во вторых результат всегда будет true не зависимо от наличия файла.
При вашем коде переменная integer не нужна
function NextButtonClick( CurPageID: Integer ): Boolean;
begin
case CurPageID of
wpFinished: if FileExists (ExpandConstant( '{app}\movies\en.pak' ) ) then
Result := DeleteFile( ExpandConstant('{app}\movies\en.pak'))
else Result := True;
else Result := True;
end;
end;

saurn
18-03-2017, 11:09
а первый вариант что-то в код пытался вставить в эту же процедуру, но ошибку выдаёт »
Ну правильно, это самодостаточный пример, однако, я не видел Ваш скрипт, и не знаю, как он построен.
у меня просто в исдоне функции IS7ZipExtract и ISExec стоят с ssPostInstall »
Выполняйте на шаге ssInstal. Таким образом выше означеные функции будут обработаны до выполнение заданий, заданных в секции Run. Впрочем, об этом уже писалось ранее.

pist0n
18-03-2017, 11:32
Выполняйте на шаге ssInstal. Таким образом выше означеные функции будут обработаны до выполнение заданий, заданных в секции Run. Впрочем, об этом уже писалось ранее. »
в том то и дело, что я изменил ssInstal на ssPostInstall, тк это нужно, чтобы эти функции выполнялись после распаковки из [Files], а то не будет файлов для выполнения этих функций
Ну правильно, это самодостаточный пример, однако, я не видел Ваш скрипт, и не знаю, как он построен. »

#define NeedSize "1048000000"

#define NeedMem 512

;#define SecondProgressBar

#define Components

#define records

#define facompress

;#define PrecompInside
;#define SrepInside
#define SevenZip
#define Delta
;#define MSCInside
;#define precomp "0.42"
;#define unrar
;#define XDelta
#define PackZIP

[Setup]
DirExistsWarning=no
Uninstallable=False
CreateUninstallRegKey=False
AppendDefaultDirName=False
InfoBeforeFile=1.txt
AppName=Русификатор Dead Space
AppVerName=Русификатор Dead Space
DefaultDirName={pf}\Steam\steamapps\common\Dead Space
DefaultGroupName=Dead Space
OutputDir=.
ShowComponentSizes=false
WizardImageFile=1.bmp
WizardSmallImageFile=2.bmp
SetupIconFile=1.ico
OutputBaseFilename=Setup
VersionInfoCopyright=ProFrager
SolidCompression=true
#ifdef NeedSize
ExtraDiskSpaceRequired={#NeedSize}
#endif
#ifdef Components

[Types]
Name: full; Description: Full installation; Flags: iscustom

[Components]
Name: voice; Description: Язык игры; Types: full; Flags: fixed
Name: voice\rus; Description: Русский текст + Русская озвучка; Flags: exclusive;
Name: voice\eng; Description: Русский текст + Английская озвучка; Flags: exclusive;
#endif

[Registry]

[Icons]

[Files]
Source: rus\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
Source: patch\settings.txt; DestDir: {localappdata}\Electronic Arts\Dead Space\; Flags: ignoreversion recursesubdirs createallsubdirs
Source: patch\ru.diff; DestDir: {app}\movies\; Components: voice\rus; Flags: ignoreversion recursesubdirs createallsubdirs deleteafterinstall
Source: en\localetable.txt; DestDir: {app}\text\; Components: voice\eng; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ru\*; DestDir: {app}; Components: voice\rus; Flags: ignoreversion recursesubdirs createallsubdirs
Source: logo.bmp; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
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: 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 SevenZip
Source: Include\7z.exe; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef Delta
Source: Include\delta.exe; 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

[CustomMessages]
russian.ExtractedFile=Обработка файлов:
russian.Extracted=Русификация игры...
russian.CancelButton=Отменить
russian.Error=Ошибка распаковки!
russian.ElapsedTime=Прошло:
russian.RemainingTime=Осталось времени:
russian.EstimatedTime=Всего:

[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl

[Tasks]

[Run]

[UninstallDelete]
Type: filesandordirs; Name: {app}

[Codе]
const
PCFonFLY=true;
notPCFonFLY=false;
var
LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2, WelcomeLabel2, FinishedLabel: TLabel;
ISDoneProgressBar1: TNewProgressBar;
#ifdef SecondProgressBar
LabelPct2: TLabel;
ISDoneProgressBar2:TNewProgressBar;
#endif
MyCancelButton: TButton;
ISDoneCancel:integer;
ISDoneError:boolean;
PCFVer:double;
Logo:TBitmapImage;

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: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(80);
Height:=ScaleX(23);
Caption:=ExpandConstant('{cm:CancelButton}');
Left:=WizardForm.cancelbutton.left;
Top:=WizardForm.cancelbutton.top;
OnClick:=@CancelButtonOnClick;
end;
end;

function NextButtonClick( CurPageID: Integer ): Boolean;
begin
case CurPageID of
wpFinished: if FileExists (ExpandConstant( '{app}\movies\en.pak' ) ) then
Result := DeleteFile( ExpandConstant('{app}\movies\en.pak'))
else Result := True;
else Result := True;
end;
end;

procedure InitializeWizard();
begin
WizardForm.WizardBitmapImage.Width:= ScaleX(497);
WizardForm.WizardBitmapImage2.Width:= ScaleX(497);
WizardForm.ComponentsDiskSpaceLabel.Hide;

WelcomeLabel2:= TLabel.Create(WizardForm);
WelcomeLabel2.AutoSize:= False;
with WizardForm.WelcomeLabel2 do
WelcomeLabel2.SetBounds(50,80, Width, Height);
WelcomeLabel2.Font:= WizardForm.WelcomeLabel2.Font
WelcomeLabel2.Font.Color:= clWhite;
Welcomelabel2.Font.Style:=[fsBold];
Welcomelabel2.Alignment := taCenter;
Welcomelabel2.Width:=190;
WelcomeLabel2.Transparent:= True;
WelcomeLabel2.WordWrap:= true;
WelcomeLabel2.Caption:= WizardForm.WelcomeLabel2.Caption;
WelcomeLabel2.Parent:= WizardForm.WelcomePage
WelcomeLabel2.Font.Size:= 9;

FinishedLabel:= TLabel.Create(WizardForm);
FinishedLabel.AutoSize:= False;
with WizardForm.FinishedLabel do
FinishedLabel.SetBounds(50, 160, Width, Height);
FinishedLabel.Font:= WizardForm.FinishedLabel.Font
FinishedLabel.Font.Style:=[fsBold];
FinishedLabel.Alignment := taCenter;
FinishedLabel.Width:=150;
FinishedLabel.Height:=150;
FinishedLabel.Font.Color:= clWhite;
FinishedLabel.Transparent:= True;
FinishedLabel.WordWrap:= true;
FinishedLabel.Caption:= WizardForm.FinishedLabel.Caption;
FinishedLabel.Parent:= WizardForm.FinishedPage
FinishedLabel.Font.Size:= 9;

logo:= TBitmapImage.Create(WizardForm);
with logo do
begin
Parent := WizardForm;
Left := ScaleX(10);
Top := ScaleY(325);
AutoSize:=true;
ReplaceColor:=clFuchsia;
ReplaceWithColor:=clBtnFace;
ExtractTemporaryFile('logo.bmp');
Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
end;

WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.FinishedLabel.Hide;
WizardForm.FinishedHeadingLabel.Hide;
begin
WizardForm.WizardSmallBitmapImage.SetBounds(ScaleX(0), ScaleY(0), WizardForm.MainPanel.Width, WizardForm.MainPanel.Height);
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
end;
end;

Procedure CurPageChanged(CurPageID: Integer);
Begin
if (CurPageID = wpFinished) and ISDoneError then
begin
WizardForm.Caption:= ExpandConstant('{cm:Error}');
WizardForm.FinishedLabel.Font.Color:= clWhite;
WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
end;
begin
FinishedLabel.Caption:= WizardForm.FinishedLabel.Caption;
end;
end;

function CheckError:boolean;
begin
result:= not ISDoneError;
end;

procedure CurStepChanged(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:cardinal;
FindHandle1,ColFiles1,CurIndex1,tmp:integer;
ExecError:boolean;
InFilePath,OutFilePath,OutFileName:PAnsiChar;
begin
if CurStep = ssPostInstall then begin //Если необходимо, можно поменять на ssPostInstall
WizardForm.ProgressGauge.Hide;
WizardForm.CancelButton.Hide;
CreateControls;
WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
ISDoneCancel:=0;

// Распаковка всех необходимых файлов в папку {tmp}.

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 SevenZip
ExtractTemporaryFile('7z.exe');
#endif
#ifdef Delta
ExtractTemporaryFile('delta.exe');
#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('voice\rus') then Comps1:=Comps1+TmpValue; //компонент 1
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\eng') then Comps1:=Comps1+TmpValue; //компонент 2
TmpValue:=TmpValue*2;
if IsComponentSelected('ver\mix') then Comps1:=Comps1+TmpValue; //компонент 3
TmpValue:=TmpValue*2;
// .....
// см. справку
#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(ExpandConstant('{app}'),512,0) then break;
if not PrecompInit(ExpandConstant('{app}'),128,PCFVer) then break;
if not FileSearchInit(true) then break;


if not ISExec ( 1, 0, 0, ExpandConstant('{tmp}\7z.exe'), ExpandConstant ('a -t7z -m0=Copy -mx0 -ms=off -sccUTF-8 -bb0 "{app}\movies\en.pak" "{app}\movies\en\*.*"'), ExpandConstant('{app}\'), '...',false) then break;
if not ISExec ( 1, 0, 0, ExpandConstant('{tmp}\delta.exe'), ExpandConstant ('-d -s "{app}\movies\en.pak" "{app}\movies\ru.diff" "{app}\movies\ru.pak"'), ExpandConstant('{tmp}'), '...',false) then break;
if not IS7ZipExtract ( 1, 0, ExpandConstant('{app}\movies\ru.pak'), ExpandConstant('{app}\movies\ru'), true, '') 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) 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;

saurn
18-03-2017, 12:04
pist0n,
[Codе]
const
PCFonFLY=true;
notPCFonFLY=false;
var
LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2, WelcomeLabel2, FinishedLabel: TLabel;
ISDoneProgressBar1: TNewProgressBar;
#ifdef SecondProgressBar
LabelPct2: TLabel;
ISDoneProgressBar2:TNewProgressBar;
#endif
MyCancelButton: TButton;
ISDoneCancel:integer;
ISDoneError:boolean;
PCFVer:double;
Logo:TBitmapImage;

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: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(80);
Height:=ScaleX(23);
Caption:=ExpandConstant('{cm:CancelButton}');
Left:=WizardForm.cancelbutton.left;
Top:=WizardForm.cancelbutton.top;
OnClick:=@CancelButtonOnClick;
end;
end;

;function NextButtonClick( CurPageID: Integer ): Boolean;
;begin
; case CurPageID of
; wpFinished: if FileExists (ExpandConstant( '{app}\movies\en.pak' ) ) then
; Result := DeleteFile( ExpandConstant('{app}\movies\en.pak'))
; else Result := True;
; else Result := True;
; end;
;end;

procedure InitializeWizard();
begin
WizardForm.WizardBitmapImage.Width:= ScaleX(497);
WizardForm.WizardBitmapImage2.Width:= ScaleX(497);
WizardForm.ComponentsDiskSpaceLabel.Hide;

WelcomeLabel2:= TLabel.Create(WizardForm);
WelcomeLabel2.AutoSize:= False;
with WizardForm.WelcomeLabel2 do
WelcomeLabel2.SetBounds(50,80, Width, Height);
WelcomeLabel2.Font:= WizardForm.WelcomeLabel2.Font
WelcomeLabel2.Font.Color:= clWhite;
Welcomelabel2.Font.Style:=[fsBold];
Welcomelabel2.Alignment := taCenter;
Welcomelabel2.Width:=190;
WelcomeLabel2.Transparent:= True;
WelcomeLabel2.WordWrap:= true;
WelcomeLabel2.Caption:= WizardForm.WelcomeLabel2.Caption;
WelcomeLabel2.Parent:= WizardForm.WelcomePage
WelcomeLabel2.Font.Size:= 9;

FinishedLabel:= TLabel.Create(WizardForm);
FinishedLabel.AutoSize:= False;
with WizardForm.FinishedLabel do
FinishedLabel.SetBounds(50, 160, Width, Height);
FinishedLabel.Font:= WizardForm.FinishedLabel.Font
FinishedLabel.Font.Style:=[fsBold];
FinishedLabel.Alignment := taCenter;
FinishedLabel.Width:=150;
FinishedLabel.Height:=150;
FinishedLabel.Font.Color:= clWhite;
FinishedLabel.Transparent:= True;
FinishedLabel.WordWrap:= true;
FinishedLabel.Caption:= WizardForm.FinishedLabel.Caption;
FinishedLabel.Parent:= WizardForm.FinishedPage
FinishedLabel.Font.Size:= 9;

logo:= TBitmapImage.Create(WizardForm);
with logo do
begin
Parent := WizardForm;
Left := ScaleX(10);
Top := ScaleY(325);
AutoSize:=true;
ReplaceColor:=clFuchsia;
ReplaceWithColor:=clBtnFace;
ExtractTemporaryFile('logo.bmp');
Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
end;

WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.FinishedLabel.Hide;
WizardForm.FinishedHeadingLabel.Hide;
begin
WizardForm.WizardSmallBitmapImage.SetBounds(ScaleX(0), ScaleY(0), WizardForm.MainPanel.Width, WizardForm.MainPanel.Height);
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
end;
end;



///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure CurPageChanged( CurPageID: Integer );
begin
case CurPageID of
wpFinished:
begin
WizardForm.RunList.Hide;

if ISDoneError then
begin
WizardForm.Caption:= ExpandConstant('{cm:Error}');
WizardForm.FinishedLabel.Font.Color:= clWhite;
WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
end;
end;

FinishedLabel.Caption:= WizardForm.FinishedLabel.Caption;
end;
end;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////




;Procedure CurPageChanged(CurPageID: Integer);
;Begin
; if (CurPageID = wpFinished) and ISDoneError then
; begin
; WizardForm.Caption:= ExpandConstant('{cm:Error}');
; WizardForm.FinishedLabel.Font.Color:= clWhite;
; WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
; end;
;begin
;FinishedLabel.Caption:= WizardForm.FinishedLabel.Caption;
;end;
;end;

function CheckError:boolean;
begin
result:= not ISDoneError;
end;

procedure CurStepChanged(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:cardinal;
FindHandle1,ColFiles1,CurIndex1,tmp:integer;
ExecError:boolean;
InFilePath,OutFilePath,OutFileName:PAnsiChar;
begin
if CurStep = ssPostInstall then begin //Если необходимо, можно поменять на ssPostInstall
WizardForm.ProgressGauge.Hide;
WizardForm.CancelButton.Hide;
CreateControls;
WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
ISDoneCancel:=0;

// Распаковка всех необходимых файлов в папку {tmp}.

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 SevenZip
ExtractTemporaryFile('7z.exe');
#endif
#ifdef Delta
ExtractTemporaryFile('delta.exe');
#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('voice\rus') then Comps1:=Comps1+TmpValue; //компонент 1
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\eng') then Comps1:=Comps1+TmpValue; //компонент 2
TmpValue:=TmpValue*2;
if IsComponentSelected('ver\mix') then Comps1:=Comps1+TmpValue; //компонент 3
TmpValue:=TmpValue*2;
// .....
// см. справку
#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(ExpandConstant('{app}'),512,0) then break;
if not PrecompInit(ExpandConstant('{app}'),128,PCFVer) then break;
if not FileSearchInit(true) then break;


if not ISExec ( 1, 0, 0, ExpandConstant('{tmp}\7z.exe'), ExpandConstant ('a -t7z -m0=Copy -mx0 -ms=off -sccUTF-8 -bb0 "{app}\movies\en.pak" "{app}\movies\en\*.*"'), ExpandConstant('{app}\'), '...',false) then break;
if not ISExec ( 1, 0, 0, ExpandConstant('{tmp}\delta.exe'), ExpandConstant ('-d -s "{app}\movies\en.pak" "{app}\movies\ru.diff" "{app}\movies\ru.pak"'), ExpandConstant('{tmp}'), '...',false) then break;
if not IS7ZipExtract ( 1, 0, ExpandConstant('{app}\movies\ru.pak'), ExpandConstant('{app}\movies\ru'), true, '') 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) 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;

gmirzaev@vk
21-03-2017, 14:56
Всем привет! Кто нибудь знает как кодировать wav mp3 в ogg и обратно.

1) Как надо кодировать аудио в ogg?
2) Потом декодировать обратно в исходной формат во время установки через батник?

Nikolay4
24-03-2017, 06:09
Здравствуйте, подскажите пожалуйста, возможно ли с помощью dwinshs (Download Plugin) скачивать не только один файл, а папку с файлами(подпапками).

Iska
24-03-2017, 07:31
Nikolay4, Вы видите где-нибудь здесь: Contents (http://www.han-soft.com/releases/dwinshs/documents/index.html) упоминание про папки (а для http/https вообще не существует понятия «папка/каталог»)?

ofarapirs
01-04-2017, 11:38
Здравствуйте, скачал репак игры, который запакован Inno Setup и он себя очень странно ведет в момент установки, подозреваю что там вирус:

http://i1.imageban.ru/out/2017/03/31/3ea9e1f698a5007bdf53b398346e43ff.png

Запись в реестре:

[HKEY_USERS\S-1-5-21-4030285601-3607310617-3836103468-1001\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore\75bc57f5_0]
@="{0.0.0.00000000}.{336c4385-b6f6-4f2a-9094-4cd99b970416}|\\Device\\HarddiskVolume2\\Users\\имя пользователя\\AppData\\Local\\Temp\\is-53TU8.tmp\\Setup.tmp%b{00000000-0000-0000-0000-000000000000}"

[HKEY_USERS\S-1-5-21-4030285601-3607310617-3836103468-1001\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore\75bc57f5_0\{219ED5A0-9CBF-4F3A-B927-37C9E5C5F14F}]
"3"=hex:04,00,00,00,00,00,00,00,00,00,80,3f,00,00,00,00,00,00,00,00,00,00,00,\
00
"4"=hex:04,20,00,00,00,00,00,00,18,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,80,3f,00,00,80,3f
"5"=hex:0b,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00

Помогите пожалуйста кто разбирается. Спасибо!

Iska
01-04-2017, 11:58
Правильно подозреваете! Этот вирус называется: «Давайте зададим индивидуальные настройки уровня громкости для этого инсталлятора» и входит во все новые версии ОС.

P.S. На первое апреля надо выбирать щютку юмора потоньше.

ofarapirs
01-04-2017, 12:07
Iska зачем запись в реестре создается тогда, если это просто настройки уровня громкости для инсталлятора? Под этим не может быть замаскирована, например скрытая автозагрузка сайта?

Iska
01-04-2017, 19:29
Iska зачем запись в реестре создается тогда, если это просто настройки уровня громкости для инсталлятора? »
Именно для того и создаётся.

Под этим не может быть замаскирована, например скрытая автозагрузка сайта? »
Я не вижу таких возможностей.

ofarapirs
01-04-2017, 20:35
Iska в этом репаке нет настройки уровня громкости (есть правда вкл. / выкл. звук).

ZVSRus
02-04-2017, 08:16
ofarapirsЗдравствуйте, скачал репак игры, который запакован Inno Setup и он себя очень странно ведет в момент установки, подозреваю что там вирус:
Что вы имеете под странным поведением в момент установки. Данная ветка реестра не имеет никакого отношения к установке. Она служит для пользовательских настроек. Записи в ней появляются после первого пуска программы или игры, но ни как во время установки.
Iska в этом репаке нет настройки уровня громкости (есть правда вкл. / выкл. звук).
То что вы показали картинку реестра, вы уверены что данная запись относится именно к вашей игре.
Да, для 1 апреля вопрос уместен.

ofarapirs
02-04-2017, 10:15
ZVSRus Уверен, отслеживал программой Revo Uninstaller Pro установку репака .

Что вы имеете под странным поведением в момент установки.
Странно то, что другие репаки не создают такой ветки.

Записи в ней появляются после первого пуска программы или игры, но ни как во время установки.
После удаления ветки, и переустановки репака, она снова появляется.

ZVSRus
02-04-2017, 11:38
ofarapirs
Тут нужно смотреть сам скрипт, что прописано в секции [Registry], потому что в данную ветку пишется чере SID пользователя, а он у каждого компа разный. Если запись в данную ветку действительно происходит во время установки (регистрация файлов) не запуская игры, тогда автор знает как обойти SID пользователя. Вопрос только к нему.

Dodakaedr
02-04-2017, 16:09
ofarapirs, Iska уже дал вам правильный ответ. Это индивидуальные настройки уровня громкости каждого приложения использующий звук. Запись создает Windows, чтобы помнить уровень громкости вашего приложения(установщика). Спросите "зачем?", так этот вопрос задайте Microsoft, или на крайняк инфы полно в гугл и в яндексе. Вывод: это не вирус и не зловред.

292944028
13-04-2017, 10:44
Здравствуйте, подскажите пожалуйста, можно сделать так чтоб на странице выбора компонентов некоторые компоненты отображались только если в папке установки программы присутствует определенный файл?

boss911
13-04-2017, 11:37
можно сделать так чтоб на странице выбора компонентов некоторые компоненты отображались только если в папке установки программы присутствует определенный файл? »
[Components]
Name: program; Description: My Program; Check: CheckMyFile

[Code]
function CheckMyFile(): Boolean;
begin
Result := FileExists(ExpandConstant('{app}\My Program\MyProg.exe'));
end;

292944028
14-04-2017, 02:18
Цитата 292944028:
Код: Выделить весь код
[Components]
Name: program; Description: My Program; Check: CheckMyFile
[Code]
function CheckMyFile(): Boolean;
begin
Result := FileExists(ExpandConstant('{app}\My Program\MyProg.exe'));
end;


Не работает, между страницей выбора языка и страницей приветствия вылетает ошибка:

http://i6.imageban.ru/out/2017/04/14/dbe52f9ae4914ec1a819a99a4b7bb858.png




© OSzone.net 2001-2012