Нуждаюсь в помощи. Можно ли как-то добавить в область на картинке функцию выключения компьютера после установки ? То есть, если пользователь установит галочку напротив этой функции, то после установки компьютер выключится.
Скрипт:
Скрипт:
; !Не забывайте, при создании нового скрипта генерировать новое значение AppID!
#define AppID "{{D009B45C-D478-4CE2-B69E-5324B4FC04D2}"
#define MyAppName "Fallout New Vegas. Ultimate Edition"
#define AppVerName "Fallout New Vegas. Ultimate Edition v.1.4.0.525"
#define DefaultGroupName "Fallout New Vegas. Ultimate Edition"
#define IconFile "FalloutNV.ico"
#define NeedMem 512
#define NeedSize "9340"
#define TotalNeedSize "9340"
#define MyAppExeName "FalloutNVLauncher.exe"
#define path "{app}\FalloutNVLauncher.exe"
#define FinishImage "3.bmp"
#define FirewallInstallHelper
#define publisher "Bethesda Softworks"
;-------------------------------------------------------------------
; Компоненты, если не нужны, то закомментировать строку
#define Components
;-------------------------------------------------------------------
; Строку Records раскомментировать после тестового прогона см. инструкцию к ISDone (для ISDone)
#define records
;-------------------------------------------------------------------
; Ускорение распаковки архивов, если не нужно - закомментировать (для ISDone)
#define facompress
;-------------------------------------------------------------------
; Кнопка "Отмена" на странице приветствия, если не нужно - закомментировать
#define CancelOnWelcome
;-------------------------------------------------------------------
; Описание компонентов, если не нужно - закомментировать
#define ComponentsInfo
;-------------------------------------------------------------------
;Дополнительные библиотеки (для ISDone)
#define PrecompInside
#define SrepInside
;#define MSCInside
;#define precomp "0.42"
;#define unrar
;#define XDelta
;#define PackZIP
[Setup]
AppID={#AppId}
AppName={#MyAppName}
AppVerName={#AppVerName}
AppPublisher={#publisher}
DefaultDirName={pf}\Fallout New Vegas. Ultimate Edition
DefaultGroupName={#publisher}\{#DefaultGroupName}
OutputDir=.
OutputBaseFilename=Setup
AllowNoIcons=true
SetupIconFile=Files\{#IconFile}
VersionInfoProductName={#MyAppName}
VersionInfoProductVersion=1.0
VersionInfoVersion=1.0
VersionInfoDescription={#MyAppName} RePack by pe4enko
VersionInfoCopyright=pe4enko
Compression=none
SolidCompression=true
WizardImageFile=Files\1.bmp
WizardSmallImageFile=Files\2.bmp
;DirExistsWarning=no
UninstallFilesDir={app}\Uninstall
ShowTasksTreeLines=true
#ifdef NeedSize
ExtraDiskSpaceRequired=0
#endif
DisableReadyPage=true
DisableProgramGroupPage=no
[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: 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
#ifdef FirewallInstallHelper
Source: Files\FirewallInstallHelper.dll; DestDir: {app}; Flags: ignoreversion
#endif
Source: Files\{#FinishImage}; DestDir: {tmp}; Flags: dontcopy
Source: Files\ISSkin.dll; DestDir: {app}; Attribs: hidden system
Source: Files\skin.skin; DestDir: {app}; Attribs: hidden system
Source: Files\Logo.bmp; DestDir: {tmp}; Flags: dontcopy
Source: Files\descctrl.dll; DestDir: {tmp}; Flags: dontcopy
[Languages]
Name: russian; MessagesFile: Files\Russian.isl
[UninstallDelete]
Type: filesandordirs; Name: {app}
#define AppID "{{D009B45C-D478-4CE2-B69E-5324B4FC04D2}"
#define MyAppName "Fallout New Vegas. Ultimate Edition"
#define AppVerName "Fallout New Vegas. Ultimate Edition v.1.4.0.525"
#define DefaultGroupName "Fallout New Vegas. Ultimate Edition"
#define IconFile "FalloutNV.ico"
#define NeedMem 512
#define NeedSize "9340"
#define TotalNeedSize "9340"
#define MyAppExeName "FalloutNVLauncher.exe"
#define path "{app}\FalloutNVLauncher.exe"
#define FinishImage "3.bmp"
#define FirewallInstallHelper
#define publisher "Bethesda Softworks"
;-------------------------------------------------------------------
; Компоненты, если не нужны, то закомментировать строку
#define Components
;-------------------------------------------------------------------
; Строку Records раскомментировать после тестового прогона см. инструкцию к ISDone (для ISDone)
#define records
;-------------------------------------------------------------------
; Ускорение распаковки архивов, если не нужно - закомментировать (для ISDone)
#define facompress
;-------------------------------------------------------------------
; Кнопка "Отмена" на странице приветствия, если не нужно - закомментировать
#define CancelOnWelcome
;-------------------------------------------------------------------
; Описание компонентов, если не нужно - закомментировать
#define ComponentsInfo
;-------------------------------------------------------------------
;Дополнительные библиотеки (для ISDone)
#define PrecompInside
#define SrepInside
;#define MSCInside
;#define precomp "0.42"
;#define unrar
;#define XDelta
;#define PackZIP
[Setup]
AppID={#AppId}
AppName={#MyAppName}
AppVerName={#AppVerName}
AppPublisher={#publisher}
DefaultDirName={pf}\Fallout New Vegas. Ultimate Edition
DefaultGroupName={#publisher}\{#DefaultGroupName}
OutputDir=.
OutputBaseFilename=Setup
AllowNoIcons=true
SetupIconFile=Files\{#IconFile}
VersionInfoProductName={#MyAppName}
VersionInfoProductVersion=1.0
VersionInfoVersion=1.0
VersionInfoDescription={#MyAppName} RePack by pe4enko
VersionInfoCopyright=pe4enko
Compression=none
SolidCompression=true
WizardImageFile=Files\1.bmp
WizardSmallImageFile=Files\2.bmp
;DirExistsWarning=no
UninstallFilesDir={app}\Uninstall
ShowTasksTreeLines=true
#ifdef NeedSize
ExtraDiskSpaceRequired=0
#endif
DisableReadyPage=true
DisableProgramGroupPage=no
[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: 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
#ifdef FirewallInstallHelper
Source: Files\FirewallInstallHelper.dll; DestDir: {app}; Flags: ignoreversion
#endif
Source: Files\{#FinishImage}; DestDir: {tmp}; Flags: dontcopy
Source: Files\ISSkin.dll; DestDir: {app}; Attribs: hidden system
Source: Files\skin.skin; DestDir: {app}; Attribs: hidden system
Source: Files\Logo.bmp; DestDir: {tmp}; Flags: dontcopy
Source: Files\descctrl.dll; DestDir: {tmp}; Flags: dontcopy
[Languages]
Name: russian; MessagesFile: Files\Russian.isl
[UninstallDelete]
Type: filesandordirs; Name: {app}
Код:
const
PCFonFLY=true;
notPCFonFLY=false;
var
WelcomeLabel, FinishedLabel, PageNameLabel: TLabel;
TotalNeedSpaceLabel,NeedSpaceLabel,FreeSpaceLabel: TLabel;
LabelPct1,LabelTime1,LabelTime2: TLabel;
FreeMB, TotalMB: Cardinal;
SizeStr: String;
SizeInt: Integer;
SymbolNumber: Integer;
NeedSize, TotalNeedSize, ISDoneCancel: Integer;
ISDoneProgressBar1: TNewProgressBar;
MyCancelButton: TButton;
ISDoneError:boolean;
PCFVer:double;
BtnPanel: TPanel;
BtnImage: TBitmapImage;
Info: TNewStaticText;
InfoCaption: TNewStaticText;
InfoPanel: TPanel;
Function NumToStr(Float: Extended): String;
Begin
Result:= Format('%.2n', [Float]); StringChange(Result, ',', '.');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;
function GetSize(): Integer;
begin
SizeStr:= WizardForm.DiskSpaceLabel.Caption;
for SymbolNumber:= 97 to 122 do begin
while (Pos(Chr(SymbolNumber), SizeStr) > 0) do Delete(SizeStr, Pos(Chr(SymbolNumber), SizeStr),1); //Находим все символы нижнего регистра и удаляем
while (Pos(AnsiUppercase(Chr(SymbolNumber)), SizeStr) > 0) do Delete(SizeStr, Pos(AnsiUppercase(Chr(SymbolNumber)), SizeStr),1); end; //Находим все символы верхнего регистра и удаляем
for SymbolNumber:= 192 to 255 do begin
while (Pos(Chr(SymbolNumber), SizeStr) > 0) do Delete(SizeStr, Pos(Chr(SymbolNumber), SizeStr),1); end; //Находим все символы нижнего регистра и удаляем
while (Pos('.', SizeStr) > 0) do Delete(SizeStr, Pos('.', SizeStr), 1) //Удаляем точки
Delete(SizeStr, Pos(',', SizeStr), 5) //Удаляем дробную часть
Result:= StrToInt(Trim(SizeStr)); //Переводим в число
end;
function CompareNum(FirstNum, SecondNum: Integer): Boolean;
begin
if FirstNum < SecondNum then Result:= False else Result:= True;
end;
#ifdef FirewallInstallHelper
function AddApplicationToExceptionList(path: String; name: String): Boolean; external 'AddApplicationToExceptionListA@files:FirewallInstallHelper.dll stdcall setuponly';
function RemoveApplicationFromExceptionList(path: String): Boolean; external 'RemoveApplicationFromExceptionListA@{app}\FirewallInstallHelper.dll stdcall uninstallonly';
#endif
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 enabledesc(ComponentsListHandle: HWND; DescLabelHandle: HWND; DescStrings: PChar): BOOL; external 'enabledesc@files:descctrl.dll stdcall';
function disabledesc(): BOOL; external 'disabledesc@files:descctrl.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)+'%';
LabelTime1.Caption:=ExpandConstant('{cm:ElapsedTime} ')+TimeStr2;
LabelTime2.Caption:=ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
Result := ISDoneCancel;
end;
function CheckError:boolean;
begin
result:= not ISDoneError;
end;
///////////////////////////////////////Изоображения///////////////////////////////////////////////
procedure InitializeWizard1();
begin
ExtractTemporaryFile('{#FinishImage}');
WizardForm.WizardBitmapImage.Width:= ScaleX(497);
WizardForm.WizardBitmapImage2.Width:= ScaleX(497);
WizardForm.WizardBitmapImage2.Bitmap.LoadFromFile(ExpandConstant('{tmp}\{#FinishImage}'));
WelcomeLabel:= TLabel.Create(WizardForm);
WelcomeLabel.AutoSize:= False;
with WizardForm.WelcomeLabel2 do
WelcomeLabel.SetBounds(Left-70, Top+50, Width, Height);
WelcomeLabel.Alignment := taCenter;
WelcomeLabel.Font:= WizardForm.WelcomeLabel2.Font
WelcomeLabel.Font.Color:= clWhite;
WelcomeLabel.Font.Size:=10
WelcomeLabel.Transparent:= True;
WelcomeLabel.WordWrap:= true;
WelcomeLabel.Caption:= ExpandConstant('{cm:WelcomeLabel}');
WelcomeLabel.Parent:= WizardForm.WelcomePage
WelcomeLabel.Font.Style:=[fsBold];
FinishedLabel:= TLabel.Create(WizardForm);
FinishedLabel.AutoSize:= False;
with WizardForm.FinishedLabel do
FinishedLabel.SetBounds(Left-70, Top+70, Width, Height);
FinishedLabel.Font:= WizardForm.FinishedLabel.Font
FinishedLabel.Font.Color:= clWhite;
FinishedLabel.Transparent:= True;
FinishedLabel.WordWrap:= true;
FinishedLabel.Caption:=ExpandConstant('{cm:FinishLabel}');
FinishedLabel.Parent:= WizardForm.FinishedPage
FinishedLabel.Font.Style:=[fsBold];
FinishedLabel.Alignment := taCenter;
FinishedLabel.Font.Size:=10;
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.FinishedLabel.Hide;
WizardForm.FinishedHeadingLabel.Hide;
end;
/////////////////////////////////
procedure InitializeWizard2();
begin
WizardForm.MainPanel.Height:=150;
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+50, Width, Height);
PageNameLabel.Transparent:= True;
PageNameLabel.Font:= WizardForm.PageNameLabel.Font;
PageNameLabel.Font.Color:= clWhite; //цвет надписи
PageNameLabel.Parent:= WizardForm.MainPanel;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
///////////////////////////////////////Изоображения///////////////////////////////////////////////
WizardForm.ComponentsList.Color:=WizardForm.SelectDirPage.Color
WizardForm.BackButton.Left:=0;
WizardForm.NextButton.Left:=WizardForm.CancelButton.Left+10;
WizardForm.NextButton.Top:=WizardForm.Bevel.Top+5;
WizardForm.NextButton.Height:=40;
WizardForm.BackButton.Top:=WizardForm.Bevel.Top+5;
WizardForm.BackButton.Height:=40;
WizardForm.SelectDirBrowseLabel.Hide;
WizardForm.CancelButton.Height:=40;
WizardForm.CancelButton.Top:=WizardForm.Bevel.Top+5;
WizardForm.CancelButton.Left:=WizardForm.CancelButton.Left+10;
WizardForm.CancelButton.Hide;
WizardForm.SelectDirBitmapImage.Hide
WizardForm.SelectGroupBitmapImage.Hide
WizardForm.SelectDirLabel.Left:=WizardForm.SelectDirBitmapImage.Left
WizardForm.SelectDirLabel.Top:=100
WizardForm.DirEdit.Top:=140
WizardForm.DirBrowseButton.Top:=140
WizardForm.GroupEdit.Top:=140
WizardForm.GroupBrowseButton.Top:=140
WizardForm.SelectComponentsLabel.Hide;
WizardForm.ComponentsDiskSpaceLabel.Hide;
WizardForm.SelectStartMenuFolderBrowseLabel.Hide;
WizardForm.SelectStartMenuFolderLabel.Left:=WizardForm.SelectDirBitmapImage.Left;
WizardForm.SelectStartMenuFolderLabel.Top:=100;
WizardForm.SelectTasksLabel.Hide;
WizardForm.ComponentsList.Top:=100;
WizardForm.ComponentsList.Height:=120;
WizardForm.TasksList.Top:=100;
WizardForm.TasksList.Height:=120;
WizardForm.StatusLabel.Top:=100;
end;
///////////////////////////////////////Место для установки//////////////////////////////////////////////
Function MbOrTb(Byte: Extended): String;
begin
if Byte < 1024 then Result:= NumToStr(Byte) + ' Мб' else
if Byte/1024 < 1024 then Result:= NumToStr(round(Byte/1024*100)/100) + ' Гб' else
Result:= NumToStr(round((Byte/(1024*1024))*100)/100) + ' Тб'
end;
procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: String;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
NeedSpaceLabel.Caption := 'Игра займет на диске: '+ MbOrTb(NeedSize)
TotalNeedSpaceLabel.Caption := 'Для установки требуется: '+ MbOrTb(TotalNeedSize)
FreeSpaceLabel.Caption := 'Доступно места на диске: '+ MbOrTb(FreeMB)
WizardForm.NextButton.Enabled:= (FreeMB>TotalNeedSize);
if (FreeMB<TotalNeedSize) then
FreeSpaceLabel.Font.Color:=clRed else
FreeSpaceLabel.Font.Color:=WizardForm.Font.Color;
end;
procedure SpaceLabel();
begin
NeedSize := {#NeedSize};
TotalNeedSize := {#TotalNeedSize};
FreeSpaceLabel := TLabel.Create(WizardForm);
FreeSpaceLabel.Parent := WizardForm.SelectDirPage;
FreeSpaceLabel.SetBounds(ScaleX(0), ScaleY(180), ScaleX(209), ScaleY(13));
TotalNeedSpaceLabel := TLabel.Create(WizardForm);
TotalNeedSpaceLabel.Parent := WizardForm.SelectDirPage;
TotalNeedSpaceLabel.SetBounds(ScaleX(0), ScaleY(200), ScaleX(209), ScaleY(13));
NeedSpaceLabel := TLabel.Create(WizardForm);
NeedSpaceLabel.Parent := WizardForm.SelectDirPage;
NeedSpaceLabel.SetBounds(ScaleX(0), ScaleY(220), ScaleX(209), ScaleY(13));
WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
WizardForm.DiskSpaceLabel.Hide;
end;
///////////////////////////////////////Место для установки//////////////////////////////////////////////
///////////////////////////////////////ISDone////////////////////////
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;
LabelTime1.Hide;
LabelTime2.Hide;
MyCancelButton.Hide;
end;
procedure CreateControls;
var PBTop:integer;
begin
PBTop:=ScaleY(50);
ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
with ISDoneProgressBar1 do begin
Parent := WizardForm;
Height := WizardForm.CancelButton.Height-10
Left := ScaleX(0);
Top := WizardForm.BackButton.Top+5;
Width := ScaleX(405);
Max := 1000;
end;
LabelPct1 := TLabel.Create(WizardForm);
with LabelPct1 do begin
Parent := ISDoneProgressBar1;
AutoSize := True;
Left := 10;
Top := 3;
Font.Size := 14;
Width := ScaleX(80);
Transparent:=True;
end;
LabelTime1 := TLabel.Create(WizardForm);
with LabelTime1 do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := ISDoneProgressBar1.Width div 2;
Left := ScaleX(0);
Top := 200;
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:=TNewButton.Create(WizardForm);
with MyCancelButton do begin
Parent:=WizardForm;
Width:=WizardForm.CancelButton.Width;
Caption:='Отмена';
Left:=WizardForm.CancelButton.Left;
Height:=40;
Top:=WizardForm.Bevel.Top+5;
OnClick:=@CancelButtonOnClick;
end;
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('dlc1\eng') then Comps1:=Comps1+TmpValue; //компонент 3
TmpValue:=TmpValue*2;
if IsComponentSelected('dlc2\eng') then Comps1:=Comps1+TmpValue; //компонент 4
TmpValue:=TmpValue*2;
if IsComponentSelected('dlc3\eng') then Comps1:=Comps1+TmpValue; //компонент 5
TmpValue:=TmpValue*2;
if IsComponentSelected('dlc4\eng') then Comps1:=Comps1+TmpValue; //компонент 6
TmpValue:=TmpValue*2;
if IsComponentSelected('dlc5\eng') then Comps1:=Comps1+TmpValue; //компонент 7
TmpValue:=TmpValue*2;
if IsComponentSelected('dlc6\eng') then Comps1:=Comps1+TmpValue; //компонент 8
TmpValue:=TmpValue*2;
if IsComponentSelected('dlc1\rus') then Comps1:=Comps1+TmpValue; //компонент 9
TmpValue:=TmpValue*2;
if IsComponentSelected('dlc2\rus') then Comps1:=Comps1+TmpValue; //компонент 10
TmpValue:=TmpValue*2;
if IsComponentSelected('dlc3\rus') then Comps1:=Comps1+TmpValue; //компонент 11
TmpValue:=TmpValue*2;
if IsComponentSelected('dlc4\rus') then Comps1:=Comps1+TmpValue; //компонент 12
TmpValue:=TmpValue*2;
if IsComponentSelected('dlc5\rus') then Comps1:=Comps1+TmpValue; //компонент 13
TmpValue:=TmpValue*2;
if IsComponentSelected('dlc6\rus') then Comps1:=Comps1+TmpValue; //компонент 14
// .....
// см. справку
#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 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;
BtnPanel.Show;
end;
if (CurStep=ssPostInstall) and ISDoneError then begin
Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
end;
end;
/////////////////////////////////////////////ISDone/////////////////////
//////////////////////////////Лого/////////////////////////////
procedure TestButtonOnClick(Sender: TObject);
begin
MsgBox('* Вырезаны все языки кроме английского / не перекодировано' + #10#13 + '* Версия игры 1.4.0.525'+ #10#13 + '* Вшита таблетка от PROPHET'+ #10#13 +'* Выборочная установка дополнений, русификаторов'+ #10#13 +'* Для установки требуется 512 МБ ОЗУ'+ #10#13 +'* Репак от pe4enko', mbInformation, MB_OK)
end;
procedure InitializeWizard3();
begin
BtnPanel:=TPanel.Create(WizardForm)
with BtnPanel do begin
Left:=180
Top:=320
Width:=132
Height:=35
Cursor:=crHand
OnClick:=@TestButtonOnClick
Parent:=WizardForm
end
BtnImage:=TBitmapImage.Create(WizardForm)
with BtnImage do begin
AutoSize:=True
Enabled:=False
ExtractTemporaryFile('Logo.bmp')
Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\Logo.bmp')
Parent:=BtnPanel
end
end;
/////////////////////////////////Лого///////////////////////////////////////
/////////////////////////////////Описание компонентов//////////////////////////
#ifdef ComponentsInfo
procedure InitializeWizard4();
begin
WizardForm.TYPESCOMBO.Visible:= false;
InfoPanel := TPanel.Create(WizardForm);
InfoPanel.Parent := WizardForm.SelectComponentsPage;
InfoPanel.Caption := '';
InfoPanel.Top := WizardForm.ComponentsList.Top;
InfoPanel.Left := ScaleX(216);
InfoPanel.Width := ScaleX(201);
InfoPanel.Height := WizardForm.ComponentsList.Height;
InfoPanel.BevelInner := bvRaised;
InfoPanel.BevelOuter := bvLowered;
InfoCaption := TNewStaticText.Create(WizardForm);
InfoCaption.Parent := WizardForm.SelectComponentsPage;
InfoCaption.Caption := 'Информация:';
InfoCaption.Left := ScaleX(224);
InfoCaption.Top := InfoPanel.Top - ScaleY(5);
InfoCaption.Font.Color := clWhite;//clActiveCaption;
Info := TNewStaticText.Create(WizardForm);
Info.Parent := InfoPanel;
Info.Font.Color:=clBlack;
Info.AutoSize := False;
Info.Left := ScaleX(6);
Info.Width := ScaleX(188);
Info.Top := ScaleY(12);
Info.Height := WizardForm.ComponentsList.Height - ScaleY(17);
Info.Caption := 'Наведите на компонент, чтобы получить дополнительную информацию';
Info.WordWrap := true;
Info.Font.Color:=clWhite;
enabledesc(WizardForm.ComponentsList.Handle,Info.Handle,
'Язык текста в игре (меню, субтитры, субтитры в видео, лаунчер);'+
'Русский текст (официальный от 1C);'+
'Английский текст;'+
'Дополнительный контент для игры (DLC);'+
'Этот аддон возвратит нас к тому, с чего всё и началось. История этого дополнения сведет нас с Улиссом, другим курьером, который должен ответить на интересующие нас вопросы.;'+
'В Old World Blues главный герой станет подопытным кроликом в ужасном эксперименте. Теперь геймеры будут бороться с маниакальным учеными или присоединения к ним, чтобы создать еще больше мутантов.;'+
'Honest Heart - это второе дополнение для Fallout New Vegas, в котором мы отправимся в пустыни национального парка в штате Юта, под названием Сион, обстоятельства берут плохой поворот, когда на караван героя нападает группа бандитов.;'+
'Действие Dead Money происходит в Сьерра-Мадре — роскошном экстравагантном казино, которое должно было стать величайшим на всём западе, но только так и не открылось. Бомбы упали до торжественного открытия, и Сьерра-Мадре замерло во времени.;'+
'Gun Runner’s Arsenal DLC включает: оптимизированные боеприпасы Small Energy Cell, Micro Fusion Cell, Electron Charge Pack и Flamer Fuel, обеспечивающие на 30% больше повреждений, высокую степень проникновения.;'+
'Courier’s Stash - сборник 4х дополнений, ранее доступных только по предзаказу: "Caravan Pack", "Classic Pack", "Mercenary Pack", и "Tribal Pack".;'+
'Русский текст для дополнений (любительский);'+
'Русский текст для DLC Lonesome Road (любительский от YikxX, the-thing, Aptom) v.2.0;'+
'Русский текст для DLC Old World Blues (любительский от ModGamesTribal, YikxX) v.2.00;'+
'Русский текст для DLC Honest Hearts (любительский от ModGamesTribal) v.1.03;'+
'Русский текст для DLC Dead Money (любительский от ModGamesTribal, YikxX) v.4.0;'+
'Русский текст для DLC Gun Runners Arsenal (любительский от Aptom) v.1.1;'+
'Русский текст для DLC Courier’s Stash (любительский от warp 37) v.2.1;'
);
end;
#endif
/////////////////////////////////Описание компонентов//////////////////////////
//////////////////////////// Удаление сохранений ///////////////////////////
procedure DeleteSavedGames(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep=usUninstall then
if DirExists(ExpandConstant('{userdocs}')+'\My Games\FalloutNV') then
if MsgBox(ExpandConstant('{cm:DeleteSave}'), mbInformation, MB_YESNO) = idYes then
DelTree(ExpandConstant('{userdocs}')+'\My Games\FalloutNV', True, True, True)
end;
//////////////////////////// Удаление сохранений ///////////////////////////
////////////////////////////////Скин////////////////////////////////////////
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';
////////////////////////////////Скин////////////////////////////////////////
procedure InitializeWizard();
begin
InitializeWizard1();
InitializeWizard2();
InitializeWizard3();
#ifdef ComponentsInfo
InitializeWizard4();
#endif
SpaceLabel;
end;
Procedure CurPageChanged(CurPageID: Integer);
Begin
#ifdef CancelOnWelcome
if CurPageID = wpWelcome then
begin
WizardForm.CancelButton.Left:=0;
end;
if CurPageID = wpsELECTdIR then
begin
WizardForm.CancelButton.Left:=WizardForm.NextButton.Left;
end;
#endif
if CurPageID = wpSelectTasks then
begin
WizardForm.NextButton.Caption:='Установить';
end;
PageNameLabel.Caption:= WizardForm.PageNameLabel.Caption;
if CurPageID = wpSelectDir then GetFreeSpaceCaption(nil);
if (CurPageID = wpFinished) and ISDoneError then
begin
WizardForm.Caption:= ExpandConstant('{cm:Error}');
FinishedLabel.Font.Color:= clRed;
FinishedLabel.Caption:= ExpandConstant('{cm:FinishedLabel}');
end;
end;
procedure InitializeUninstallProgressForm;
begin
UninstallProgressForm.CancelButton.Hide;
UninstallProgressForm.Bevel.Hide;
UninstallProgressForm.Bevel1.Hide;
UninstallProgressForm.ClientHeight := 100;
UninstallProgressForm.Position:=poScreenCenter
UninstallProgressForm.MainPanel.Hide;
UninstallProgressForm.InnerNotebook.Top:=0
UninstallProgressForm.InnerNotebook.Left:=0
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
path: String;
begin
DeleteSavedGames(CurUninstallStep);
if CurUninstallStep=usUninstall then
begin
path:=ExpandConstant('{#path}');
RemoveApplicationFromExceptionList(path)
UnloadDll(ExpandConstant('{app}\FirewallInstallHelper.dll'));
end;
end;
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('skin.skin');
LoadSkin(ExpandConstant('{tmp}\skin.skin'), '');
Result:= true
end;
function InitializeUninstall(): Boolean;
begin
FileCopy(ExpandConstant('{app}\isskin.dll'),
ExpandConstant('{tmp}\isskin.dll'), False);
FileCopy(ExpandConstant('{app}\skin.skin'),
ExpandConstant('{tmp}\skin.skin'), False); LoadSkinU(ExpandConstant('{tmp}\orange.skin'), '');
Result:=True;
end;
procedure DeinitializeSetup();
begin
UnloadSkin();
#ifdef ComponentsInfo
disabledesc();
#endif
end;
procedure DeinitializeUninstall();
begin
UnloadSkinU();
end;
[/spoiler]
И еще вопрос, возможно не по теме. Можно ли как-то сделать свой скин для ISSkin (.cjstyles) ?
Последнее редактирование: