#define MyAppName "Dead Space"
#define MyAppVerName "Dead Space"
#define MyAppPublisher "© Оформление by KykyHe4ka"
#define MyAppExeName "Dead Space.exe"
[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVerName}
DefaultDirName={pf}\{#MyAppName}
VersionInfoCopyright={#MyAppPublisher}
DefaultGroupName={#MyAppName}
PrivilegesRequired=none
UsePreviousAppDir=false
DirExistsWarning=no
ShowLanguageDialog=yes
OutputBaseFilename=setup
DisableProgramGroupPage=true
DisableReadyPage=true
OutputDir=.
WizardImageFile=WizardImage_1.bmp
WizardSmallImageFile=WizardSmallImage.bmp
Compression=lzma/ultra64
InternalCompressLevel=ultra64
SolidCompression=true
DiskSpanning=yes
SlicesPerDisk=3
DiskSliceSize=1556925645
SetupIconFile=Icon.ico
UninstallDisplayIcon={app}\bin\Dead Space.exe
UninstallFilesDir={app}\Uninstall
[Languages]
Name: eng; MessagesFile: compiler:Default.isl
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[CustomMessages]
eng.ArcBreak=Installation cancelled!
eng.ExtractedInfo=Extracted %1 Mb of %2 Mb
eng.ArcInfo=Archive: %1 of %2
eng.ArcTitle=Extracting FreeArc archive
eng.ArcError=Decompression failed with error code %1
eng.ArcFail=Decompression failed!
eng.AllProgress=Overall extraction progress: %1%%
eng.ArcBroken=Archive %1 is damaged%nor not enough free space.
eng.Extracting=Extracting: %1
eng.taskbar=%1%%, %2 remains
eng.remains=Remaining time: %1
eng.LongTime=at no time
eng.ending=ending
eng.hour=hours
eng.min=mins
eng.sec=secs
rus.ArcBreak=Установка прервана!
rus.ExtractedInfo=Распаковано %1 Мб из %2 Мб
rus.ArcInfo=Архив: %1 из %2
rus.ArcTitle=Распаковка архивов FreeArc
rus.ArcError=Распаковщик FreeArc вернул код ошибки: %1
rus.ArcFail=Распаковка не завершена!
rus.AllProgress=Общий прогресс распаковки: %1%%
rus.ArcBroken=Возможно, архив %1 повреждён%nили недостаточно места на диске назначения.
rus.Extracting=Распаковывается: %1
rus.taskbar=%1%%, жди %2
rus.remains=Осталось ждать %1
rus.LongTime=вечно
rus.ending=завершение
rus.hour=часов
rus.min=мин
rus.sec=сек
[Files]
;Source: movies.arc; DestDir: {app}; Flags: nocompression deleteafterinstall
Source: WizardImage_1.bmp; DestDir: {tmp}; Flags: dontcopy
Source: logo1.bmp; DestDir: {tmp}; Flags: dontcopy
Source: button.bmp; DestDir: {tmp}; Flags: dontcopy
Source: papka.bmp; DestDir: {tmp}; Flags: dontcopy
Source: BASS.dll; DestDir: {tmp}; Flags: dontcopy noencryption
Source: sound.mp3; DestDir: {tmp}; Flags: dontcopy noencryption nocompression
Source: MusicButton.bmp; DestDir: {tmp}; Flags: dontcopy
Source: ISSkin.dll; DestDir: {app}; Flags: dontcopy
Source: Vista.cjstyles; DestDir: {tmp}; Flags: dontcopy
Source: unarc.dll; DestDir: {tmp}; Flags: dontcopy deleteafterinstall
Source: InnoCallback.dll; DestDir: {tmp}; Flags: dontcopy
Source: E:\С рабочего стола\source\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Languages:
[Run]
Filename: {src}\DirectX\dxwebsetup.exe; StatusMsg: Идет установка Direct X...; WorkingDir: {src}\DirectX; Check: InstallDirectX
Filename: {src}\Redist\vcredist_x86.exe; Parameters: /q; StatusMsg: Идет установка Microsoft Visual C++ Redistibutable...; WorkingDir: {src}\Redist; Check: InstallRedist
Filename: {src}\Redist\PhysX.exe; StatusMsg: Идет установка Nvidia PhysX...; WorkingDir: {src}\; Check: InstallPhysX
[Icons]
Name: {userdesktop}\{#MyAppName}; Filename: {#MyAppExeName}; WorkingDir: {app}; IconFilename: {app}\Dead Space.ico; IconIndex: 0
[Code]
//-----------Лого--------
var
LogoImage:TBitmapImage;
LogoLabel: TLabel;
procedure LogoOnClick(Sender: TObject);
var ReturnCode: Integer;
begin
ShellExec('open', '
http://torrents.bks-tv.ru', '', '', SW_SHOWNORMAL, ewNoWait, ReturnCode)
end;
procedure InitializeWizard1();
var
LogoPanel : TPanel;
begin
ExtractTemporaryFile('logo1.bmp');
LogoPanel := TPanel.Create(WizardForm);
with LogoPanel do
begin
Parent := WizardForm;
Left := ScaleX(30);
Top := ScaleY(320);
Width := ScaleX(165);
Height := ScaleY(35);
BevelOuter := bvNone;
end;
LogoImage := TBitmapImage.Create(WizardForm);
with LogoImage do
begin
Parent := LogoPanel;
Left := ScaleX(0);
Top := ScaleY(0);
AutoSize:=true;
ReplaceColor:=clFuchsia;
ReplaceWithColor:=clBtnFace;
Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo1.bmp'));
end;
LogoLabel := TLabel.Create(WizardForm);
with LogoLabel do
begin
Parent := LogoPanel;
Width := LogoPanel.Width;
Height := LogoPanel.Height;
Transparent:=True;
Cursor := crHand;
OnClick:=@LogoOnClick;
end;
end;
//черный -----------------------------------------------------------------------------------------------------------------------------------------
const
Color = clblack;
procedure InitializeWizard2();
begin
WizardForm.Font.Color:=clWhite;
WizardForm.Color:=Color;
WizardForm.WelcomeLabel1.Color:=Color;
WizardForm.WelcomePage.Color:=Color;
WizardForm.InnerPage.Color:=Color;
WizardForm.FinishedPage.Color:=Color;
WizardForm.LicensePage.Color:=Color;
WizardForm.PasswordPage.Color:=Color;
WizardForm.InfoBeforePage.Color:=Color;
WizardForm.UserInfoPage.Color:=Color;
WizardForm.SelectDirPage.Color:=Color;
WizardForm.SelectComponentsPage.Color:=Color;
WizardForm.SelectProgramGroupPage.Color:=Color;
WizardForm.SelectTasksPage.Color:=Color;
WizardForm.ReadyPage.Color:=Color;
WizardForm.PreparingPage.Color:=Color;
WizardForm.InstallingPage.Color:=Color;
WizardForm.InfoAfterPage.Color:=Color;
WizardForm.DirEdit.Color:=Color;
WizardForm.DiskSpaceLabel.Color:=Color;
WizardForm.DirEdit.Color:=Color;
WizardForm.GroupEdit.Color:=Color;
WizardForm.PasswordLabel.Color:=Color;
WizardForm.PasswordEdit.Color:=Color;
WizardForm.PasswordEditLabel.Color:=Color;
WizardForm.ReadyMemo.Color:=Color;
WizardForm.TypesCombo.Color:=Color;
WizardForm.WelcomeLabel1.Color:=Color;
WizardForm.InfoBeforeClickLabel.Color:=Color;
WizardForm.MainPanel.Color:=Color;
WizardForm.PageNameLabel.Color:=Color;
WizardForm.PageDescriptionLabel.Color:=Color;
WizardForm.ReadyLabel.Color:=Color;
WizardForm.FinishedLabel.Color:=Color;
WizardForm.YesRadio.Color:=Color;
WizardForm.NoRadio.Color:=Color;
WizardForm.WelcomeLabel2.Color:=Color;
WizardForm.LicenseLabel1.Color:=Color;
WizardForm.InfoAfterClickLabel.Color:=Color;
WizardForm.ComponentsList.Color:=Color;
WizardForm.ComponentsDiskSpaceLabel.Color:=Color;
WizardForm.BeveledLabel.Color:=Color;
WizardForm.StatusLabel.Color:=Color;
WizardForm.FilenameLabel.Color:=Color;
WizardForm.SelectDirLabel.Color:=Color;
WizardForm.SelectStartMenuFolderLabel.Color:=Color;
WizardForm.SelectComponentsLabel.Color:=Color;
WizardForm.SelectTasksLabel.Color:=Color;
WizardForm.LicenseAcceptedRadio.Color:=Color;
WizardForm.LicenseNotAcceptedRadio.Color:=Color;
WizardForm.UserInfoNameLabel.Color:=Color;
WizardForm.UserInfoNameEdit.Color:=Color;
WizardForm.UserInfoOrgLabel.Color:=Color;
WizardForm.UserInfoOrgEdit.Color:=Color;
WizardForm.PreparingLabel.Color:=Color;
WizardForm.FinishedHeadingLabel.Color:=Color;
WizardForm.FinishedHeadingLabel.Font.Color:=clWhite;
WizardForm.UserInfoSerialLabel.Color:=Color;
WizardForm.UserInfoSerialEdit.Color:=Color;
WizardForm.TasksList.Color:=Color;
WizardForm.RunList.Color:=Color;
WizardForm.SelectDirBrowseLabel.Color:=Color;
WizardForm.SelectStartMenuFolderBrowseLabel.Color:=Color;
end;
//конец
// Страница приветствия ---------------------------------------------------------------------------------------------------------------------------------
procedure InitializeWizard3();
var
WLabel1, WLabel2: TLabel;
//FLabel1, FLabel2: TLabel;
BmpFile: TBitmapImage;
FinishedHeadingLabel ,FinishedLabel:TLabel;
begin
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.WizardBitmapImage.Width := 497;
WizardForm.WizardBitmapImage.Height := 314;
WizardForm.FinishedHeadingLabel.Hide;
WizardForm.FinishedLabel.Hide;
begin
ExtractTemporaryFile('WizardImage_1.bmp');
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardImage_1.bmp'));
BmpFile.SetBounds(0, 0, 497, 360);
BmpFile.Stretch:= true
BmpFile.Parent:= WizardForm.WelcomePage;
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardImage_1.bmp'));
BmpFile.SetBounds(0, 0, 497, 360);
BmpFile.Stretch:= true
BmpFile.Parent:= WizardForm.FinishedPage;
BmpFile:= TBitmapImage.Create(WizardForm);
with WizardForm do
begin
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
DiskSpaceLabel.Hide;
SelectDirBrowseLabel.Hide;
FinishedHeadingLabel.Hide;
FinishedLabel.Hide;
PageDescriptionLabel.Hide;
end;
end;
WLabel1 := TLabel.Create(WizardForm);
WLabel1.Left := ScaleX(165);
WLabel1.Top := ScaleY(45);
WLabel1.Width := ScaleX(321);
WLabel1.Height := ScaleY(54);
WLabel1.AutoSize := False;
WLabel1.WordWrap := True;
WLabel1.Font.Size := 14;
WLabel1.Font.Style := [fsBold];
WLabel1.Font.Color:= clWhite;
WLabel1.Font.name:='Constantia';
WLabel1.ShowAccelChar := False;
WLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
WLabel1.Transparent := True;
WLabel1.Alignment:= taCenter;
WLabel2:=TLabel.Create(WizardForm);
WLabel2.Top := ScaleY(120);
WLabel2.Left := ScaleX(165);
WLabel2.Width := ScaleX(301);
WLabel2.Height := ScaleY(234);
WLabel2.AutoSize := False;
WLabel2.WordWrap := True;
WLabel2.Alignment:= taCenter;
WLabel2.Font.Color:= clwhite;
WLabel2.Font.Size := 11;
WLabel1.Font.name:='Tahoma';
WLabel2.Font.Style := [fsBold];
WLabel2.ShowAccelChar := False;
WLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
WLabel2.Transparent := True;
WLabel2.Parent := WizardForm.WelcomePage;
FinishedHeadingLabel:=TLabel.Create(WizardForm);
with FinishedHeadingLabel do
begin
Left:= ScaleX(165);
Top:= ScaleY(30);
Width:= ScaleX(330);
Height:= ScaleY(74);
AutoSize:= false;
WordWrap:= true;
Alignment:= taCenter;
Font.Size:= 14;
Font.Color:=ClWhite
Font.Style:=[fsBold];
Font.Name:= 'Constantia';
Transparent:= true;
Caption:= WizardForm.FinishedHeadingLabel.Caption;
end;
FinishedLabel:= TLabel.Create(WizardForm);
with FinishedLabel do
begin
Left:= ScaleX(210);
Top:= ScaleY(120);
Width:= ScaleX(250);
Height:= ScaleY(250);
AutoSize:= false;
WordWrap:= true;
Transparent:= true;
Font.Size:= 11;
Alignment:= taCenter;
Font.Color:=ClWhite
ShowAccelChar := False;
Font.Style:=[fsBold];
Parent:= WizardForm.FinishedPage;
Caption:= 'Игра {#SetupSetting("AppName")} установлена на Ваш компьютер.' +#10#13#10 + 'Нажмите «Завершить», чтобы выйти из программы установки.'
end;
end;
//конец
var
PageNameLabel, PageDescriptionLabel: TLabel;
procedure InitializeWizard4();
begin
PageNameLabel := TLabel.Create(WizardForm);
with PageNameLabel do
begin
Left := ScaleX(15);
Top := ScaleY(22);
Width := ScaleX(300);
Height := ScaleY(14);
AutoSize := False;
WordWrap := True;
Font.Color := clWhite;
Font.Style := [fsBold];
ShowAccelChar := False;
Transparent := True;
Parent := WizardForm.MainPanel;
end;
PageDescriptionLabel := TLabel.Create(WizardForm);
with PageDescriptionLabel do
begin
Left := ScaleX(15);
Top := ScaleY(25);
Width := ScaleX(475);
Height := ScaleY(30);
AutoSize := False;
WordWrap := True;
Font.Color := clWhite;
ShowAccelChar := False;
Transparent := True;
end;
with WizardForm do
begin
PageNameLabel.Hide;
with MainPanel do
begin
with WizardSmallBitmapImage do
begin
Left := ScaleX(0);
Top := ScaleY(0);
Width := Mainpanel.Width;
Height := MainPanel.Height;
end;
end;
end;
end;
// Фриарк ------------------------------------------------------------------------------------------------------------------------------------------------
const
Archives = '{src}\*movies.arc'; // укажите расположение архивов FreeArc; для внешних файлов строку в [Files] добавлять необязательно
PM_REMOVE = 1;
CP_ACP = 0; CP_UTF8 = 65001;
oneMb = 1048576;
type
#ifdef UNICODE ; если у вас ошибка на этой строке, то установите препроцессор или исправьте скрипт для вашей версии Inno Setup
#define A "W"
#else
#define A "A" ; точка входа в SetWindowText, {#A} меняется на A или W в зависимости от версии
PAnsiChar = PChar; // Required for Inno Setup 5.3.0 and higher. (требуется для Inno Setup версии 5.3.0 и ниже)
#endif
#if Ver < 84018176
AnsiString = String; // There is no need for this line in Inno Setup 5.2.4 and above (для Inno Setup версий 5.2.4 и выше эта строка не нужна)
#endif
TMyMsg = record
hwnd: HWND;
message: UINT;
wParam: Longint;
lParam: Longint;
time: DWORD;
pt: TPoint;
end;
TFreeArcCallback = function (what: PAnsiChar; int1, int2: Integer; str: PAnsiChar): Integer;
TArc = record Path: string; OrigSize: Integer; Size: Extended; end;
var
ExtractFile: TLabel;
lblExtractFileName: TLabel;
btnCancelUnpacking: TButton;
CancelCode, n, UnPackError, StartInstall: Integer;
Arcs: array of TArc;
msgError: string;
lastMb: Integer;
baseMb: Integer;
totalUncompressedSize: Integer; // total uncompressed size of archive data in mb
LastTimerEvent: DWORD;
Function MultiByteToWideChar(CodePage: UINT; dwFlags: DWORD; lpMultiByteStr: string; cbMultiByte: integer; lpWideCharStr: string; cchWideChar: integer): longint; external '
[email protected] stdcall';
Function WideCharToMultiByte(CodePage: UINT; dwFlags: DWORD; lpWideCharStr: string; cchWideChar: integer; lpMultiByteStr: string; cbMultiByte: integer; lpDefaultChar: integer; lpUsedDefaultChar: integer): longint; external '
[email protected] stdcall';
function PeekMessage(var lpMsg: TMyMsg; hWnd: HWND; wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; external '
[email protected] stdcall';
function TranslateMessage(const lpMsg: TMyMsg): BOOL; external '
[email protected] stdcall';
function DispatchMessage(const lpMsg: TMyMsg): Longint; external '
[email protected] stdcall';
Function OemToChar(lpszSrc, lpszDst: AnsiString): longint; external '
[email protected] stdcall';
function GetWindowLong(hWnd, nIndex: Integer): Longint; external 'GetWindowLongA@user32 stdcall delayload';
function SetWindowText(hWnd: Longint; lpString: String): Longint; external 'SetWindowText{#A}@user32 stdcall delayload';
function GetTickCount: DWord; external 'GetTickCount@kernel32';
function WrapFreeArcCallback (callback: TFreeArcCallback; paramcount: integer):longword; external 'wrapcallback@files:innocallback.dll stdcall';
function FreeArcExtract (callback: longword; cmd1,cmd2,cmd3,cmd4,cmd5,cmd6,cmd7,cmd8,cmd9,cmd10: PAnsiChar): integer; external 'FreeArcExtract@files:unarc.dll cdecl';
procedure AppProcessMessage;
var
Msg: TMyMsg;
begin
while PeekMessage(Msg, 0, 0, 0, PM_REMOVE) do begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end;
// Перевод числа в строку с точностью 3 знака (%.3n) с округлением дробной части, если она есть
Function NumToStr(Float: Extended): String;
Begin
Result:= Format('%.3n', [Float]); StringChange(Result, ',', '.');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Length(Result) > 1) do
SetLength(Result, Length(Result)-1);
End;
function cm(Message: String): String; Begin Result:= ExpandConstant('{cm:'+ Message +'}') End;
Function Size64(Hi, Lo: Integer): Extended;
Begin
Result:= Lo;
if Lo<0 then Result:= Result + $7FFFFFFF + $7FFFFFFF + 2;
for Hi:= Hi-1 Downto 0 do
Result:= Result + $7FFFFFFF + $7FFFFFFF + 2;
End;
// Converts OEM encoded string into ANSI
// Преобразует OEM строку в ANSI кодировку
function OemToAnsiStr( strSource: AnsiString): AnsiString;
var
nRet : longint;
begin
SetLength( Result, Length( strSource ) );
nRet:= OemToChar( strSource, Result );
end;
// Converts ANSI encoded string into UTF-8
// Преобразует строку из ANSI в UTF-8 кодировку
function AnsiToUtf8( strSource: string ): string;
var
nRet : integer;
WideCharBuf: string;
MultiByteBuf: string;
begin
strSource:= strSource + chr(0);
SetLength( WideCharBuf, Length( strSource ) * 2 );
SetLength( MultiByteBuf, Length( strSource ) * 2 );
nRet:= MultiByteToWideChar( CP_ACP, 0, strSource, -1, WideCharBuf, Length(WideCharBuf) );
nRet:= WideCharToMultiByte( CP_UTF8, 0, WideCharBuf, -1, MultiByteBuf, Length(MultiByteBuf), 0, 0);
Result:= MultiByteBuf;
end;
// OnClick event function for btnCancel
procedure btnCancelUnpackingOnClick(Sender: TObject);
begin
if MsgBox( SetupMessage( msgExitSetupMessage ), mbInformation, MB_YESNO ) = IDYES then
CancelCode:= -127;
end;
var origsize: Integer;
// The callback function for getting info about FreeArc archive
function FreeArcInfoCallback (what: PAnsiChar; Mb, sizeArc: Integer; str: PAnsiChar): Integer;
begin
if string(what)='origsize' then origsize := Mb else
if string(what)='compsize' then else
if string(what)='total_files' then else
Result:= CancelCode;
end;
// Returns decompressed size of files in archive
function ArchiveOrigSize(arcname: string): Integer;
var
callback: longword;
Begin
callback:= WrapFreeArcCallback(@FreeArcInfoCallback,4); //FreeArcInfoCallback has 4 arguments
CancelCode:= 0;
AppProcessMessage;
try
// Pass the specified arguments to 'unarc.dll'
Result:= FreeArcExtract (callback, 'l', '--', AnsiToUtf8(arcname), '', '', '', '', '', '', '');
if CancelCode < 0 then Result:= CancelCode;
if Result >= 0 then Result:= origsize;
except
Result:= -63; // ArcFail
end;
end;
// Scans the specified folders for archives and add them to list
function FindArcs(dir: string): Extended;
var
FSR: TFindRec;
Begin
Result:= 0;
if FindFirst(ExpandConstant(dir), FSR) then begin
try
repeat
// Skip everything but the folders
if FSR.Attributes and FILE_ATTRIBUTE_DIRECTORY > 0 then CONTINUE;
n:= GetArrayLength(Arcs);
// Expand the folder list
SetArrayLength(Arcs, n +1);
Arcs[n].Path:= ExtractFilePath(ExpandConstant(dir)) + FSR.Name;
Arcs[n].Size:= Size64(FSR.SizeHigh, FSR.SizeLow);
Result:= Result + Arcs[n].Size;
Arcs[n].OrigSize := ArchiveOrigSize(Arcs[n].Path)
totalUncompressedSize := totalUncompressedSize + Arcs[n].OrigSize
until not FindNext(FSR);
finally
FindClose(FSR);
end;
end;
End;
// Sets the TaskBar title
Procedure SetTaskBarTitle(Title: String); var h: Integer;
Begin
h:= GetWindowLong(MainForm.Handle, -8); if h <> 0 then SetWindowText(h, Title);
End;
// Converts milliseconds to human-readable time
// Конвертирует милисекунды в человеко-читаемое изображение времени
Function TicksToTime(Ticks: DWord; h,m,s: String; detail: Boolean): String;
Begin
if detail {hh:mm:ss format} then
Result:= PADZ(IntToStr(Ticks/3600000), 2) +':'+ PADZ(IntToStr((Ticks/1000 - Ticks/1000/3600*3600)/60), 2) +':'+ PADZ(IntToStr(Ticks/1000 - Ticks/1000/60*60), 2)
else if Ticks/3600 >= 1000 {more than hour} then
Result:= IntToStr(Ticks/3600000) +h+' '+ PADZ(IntToStr((Ticks/1000 - Ticks/1000/3600*3600)/60), 2) +m
else if Ticks/60 >= 1000 {1..60 minutes} then
Result:= IntToStr(Ticks/60000) +m+' '+ PADZ(IntToStr(Ticks/1000 - Ticks/1000/60*60), 2) +s
else Result:= IntToStr(Ticks/1000) +s {less than one minute}
End;
// The main callback function for unpacking FreeArc archives
function FreeArcCallback (what: PAnsiChar; Mb, sizeArc: Integer; str: PAnsiChar): Integer;
var
percents, Remaining: Integer;
s: String;
begin
if GetTickCount - LastTimerEvent > 1000 then begin
// This code will be executed once each 1000 ms (этот код будет выполняться раз в 1000 миллисекунд)
// ....
// End of code executed by timer
LastTimerEvent := LastTimerEvent+1000;
end;
if string(what)='filename' then begin
// Update FileName label
lblExtractFileName.Caption:= FmtMessage( cm( 'Extracting' ), [OemToAnsiStr( str )] )
end else if (string(what)='write') and (totalUncompressedSize>0) and (Mb>lastMb) then begin
// Assign to Mb *total* amount of data extracted to the moment from all archives
lastMb := Mb;
Mb := baseMb+Mb;
// Update progress bar
WizardForm.ProgressGauge.Position:= Mb;
// Show how much megabytes/archives were processed up to the moment
percents:= (Mb*1000) div totalUncompressedSize;
s := FmtMessage(cm('ExtractedInfo'), [IntToStr(Mb), IntToStr(totalUncompressedSize)]);
if GetArrayLength(Arcs)>1 then
s := s + '. '+FmtMessage(cm('ArcInfo'), [IntToStr(n+1), IntToStr(GetArrayLength(Arcs))])
ExtractFile.Caption := s
// Calculate and show current percents
percents:= (Mb*1000) div totalUncompressedSize;
s:= FmtMessage(cm('AllProgress'), [Format('%.1n', [Abs(percents/10)])]);
if Mb > 0 then Remaining:= trunc((GetTickCount - StartInstall) * Abs((totalUncompressedSize - Mb)/Mb)) else Remaining:= 0;
if Remaining = 0 then SetTaskBarTitle(cm('ending')) else begin
s:= s + '. '+FmtMessage(cm('remains'), [TicksToTime(Remaining, cm('hour'), cm('min'), cm('sec'), false)])
SetTaskBarTitle(FmtMessage(cm('taskbar'), [IntToStr(percents/10), TicksToTime(Remaining, 'h', 'm', 's', false)]))
end;
WizardForm.FileNameLabel.Caption := s
end;
AppProcessMessage;
Result:= CancelCode;
end;
// Extracts all found archives
function UnPack(Archives: string): Integer;
var
totalCompressedSize: Extended;
callback: longword;
FreeMB, TotalMB: Cardinal;
begin
// Display 'Extracting FreeArc archive'
lblExtractFileName.Caption:= '';
lblExtractFileName.Show;
ExtractFile.caption:= cm('ArcTitle');
ExtractFile.Show;
// Show the 'Cancel unpacking' button and set it as default button
btnCancelUnpacking.Caption:= WizardForm.CancelButton.Caption;
btnCancelUnpacking.Show;
WizardForm.ActiveControl:= btnCancelUnpacking;
WizardForm.ProgressGauge.Position:= 0;
// Get the size of all archives
totalUncompressedSize := 0;
totalCompressedSize := FindArcs(Archives);
WizardForm.ProgressGauge.Max:= totalUncompressedSize;
// Other initializations
callback:= WrapFreeArcCallback(@FreeArcCallback,4); //FreeArcCallback has 4 arguments
StartInstall:= GetTickCount; {время начала распаковки}
LastTimerEvent:= GetTickCount;
baseMb:= 0
for n:= 0 to GetArrayLength(Arcs) -1 do
begin
lastMb := 0
CancelCode:= 0;
AppProcessMessage;
try
// Pass the specified arguments to 'unarc.dll'
Result:= FreeArcExtract (callback, 'x', '-o+', '-dp' + AnsiToUtf8( ExpandConstant('{app}') ), '--', AnsiToUtf8(Arcs[n].Path), '', '', '', '', '');
if CancelCode < 0 then Result:= CancelCode;
except
Result:= -63; // ArcFail
end;
baseMb:= baseMb+lastMb
// Error occured
if Result <> 0 then
begin
msgError:= FmtMessage(cm('ArcError'), [IntToStr(Result)]);
GetSpaceOnDisk(ExtractFileDrive(ExpandConstant('{app}')), True, FreeMB, TotalMB);
case Result of
-1: if FreeMB < 32 {Мб на диске} then msgError:= SetupMessage(msgDiskSpaceWarningTitle)
else msgError:= msgError + #13#10 + FmtMessage(cm('ArcBroken'), [ExtractFileName(Arcs[n].Path)]);
-127: msgError:= cm('ArcBreak'); //Cancel button
-63: msgError:= cm('ArcFail');
end;
// MsgBox(msgError, mbInformation, MB_OK); //сообщение показывается на странице завершения
Log(msgError);
Break; //прервать цикл распаковки
end;
end;
// Hide labels and button
WizardForm.FileNameLabel.Caption:= '';
lblExtractFileName.Hide;
ExtractFile.Hide;
btnCancelUnpacking.Hide;
end;
procedure CurStepChanged1(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
begin
UnPackError:= UnPack(Archives)
if UnPackError = 0 then
SetTaskBarTitle(SetupMessage(msgSetupAppTitle))
else
begin
// Error occured, uninstall it then
Exec(ExpandConstant('{uninstallexe}'), '/SILENT','', sw_Hide, ewWaitUntilTerminated, n); //откат установки из-за ошибки unarc.dll
SetTaskBarTitle(SetupMessage(msgErrorTitle))
WizardForm.Caption:= SetupMessage(msgErrorTitle) +' - '+ cm('ArcBreak')
end;
end;
end;
// стандартный способ отката (не нужна CurPageChanged), но архивы распаковываются до извлечения файлов инсталлятора
// if CurStep = ssInstall then
// if UnPack(Archives) <> 0 then Abort;
Procedure CurPageChanged1(CurPageID: Integer);
Begin
if (CurPageID = wpFinished) and (UnPackError <> 0) then
begin // Extraction was unsuccessful (распаковщик вернул ошибку)
// Show error message
WizardForm.FinishedLabel.Font.Color:= $0000C0; // red (красный)
WizardForm.FinishedLabel.Height:= WizardForm.FinishedLabel.Height * 2;
WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) + #13#10#13#10 + msgError;
end;
End;
procedure InitializeWizard5();
begin
with WizardForm.ProgressGauge do
begin
// Create a label to show current FileName being extracted
lblExtractFileName:= TLabel.Create(WizardForm);
lblExtractFileName.parent:=WizardForm.InstallingPage;
lblExtractFileName.autosize:=false;
lblExtractFileName.Width:= Width;
lblExtractFileName.top:=Top + ScaleY(35);
lblExtractFileName.Caption:= '';
lblExtractFileName.Hide;
// Create a label to show percentage
ExtractFile:= TLabel.Create(WizardForm);
ExtractFile.parent:=WizardForm.InstallingPage;
ExtractFile.autosize:=false;
ExtractFile.Width:= Width;
ExtractFile.top:=lblExtractFileName.Top + ScaleY(16);
ExtractFile.caption:= '';
ExtractFile.Hide;
end;
// Create a 'Cancel unpacking' button and hide it for now.
btnCancelUnpacking:=TButton.create(WizardForm);
btnCancelUnpacking.Parent:= WizardForm;
btnCancelUnpacking.SetBounds(WizardForm.CancelButton.Left, WizardForm.CancelButton.top, WizardForm.CancelButton.Width, WizardForm.CancelButton.Height);
btnCancelUnpacking.OnClick:= @btnCancelUnpackingOnClick;
btnCancelUnpacking.Hide;
end;
// Кнопки ------------------------------------------------------------------------------------------------------------------------------------------------
const
ButtonWidth = 80; //Указываем размер кнопок
ButtonHeight = 23;
bidBack = 0;
bidNext = 1;
bidCancel = 2;
bidDirBrowse = 3;
bidGroupBrowse = 4;
var
ButtonPanel: array [0..4] of TPanel;
ButtonImage: array [0..4] of TBitmapImage;
ButtonLabel: array [0..4] of TLabel;
procedure ButtonLabelClick(Sender: TObject);
var
Button: TButton;
begin
ButtonImage[TLabel(Sender).Tag].Left:=0
case TLabel(Sender).Tag of
bidBack: Button:=WizardForm.BackButton
bidNext: Button:=WizardForm.NextButton
bidCancel: Button:=WizardForm.CancelButton
bidDirBrowse: Button:=WizardForm.DirBrowseButton
bidGroupBrowse: Button:=WizardForm.GroupBrowseButton
else
Exit
end
Button.OnClick(Button)
end;
procedure ButtonLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if ButtonLabel[TLabel(Sender).Tag].Enabled then
ButtonImage[TLabel(Sender).Tag].Left:=-ButtonWidth
end;
procedure ButtonLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ButtonImage[TLabel(Sender).Tag].Left:=0
end;
procedure LoadButtonImage(AButton: TButton; AButtonIndex: integer);
var
Image: TBitmapImage;
Panel: TPanel;
Labl: TLabel;
begin
Panel:=TPanel.Create(WizardForm)
Panel.Left:=AButton.Left
Panel.Top:=AButton.Top
Panel.Width:=AButton.Width
Panel.Height:=AButton.Height
Panel.Tag:=AButtonIndex
Panel.Parent:=AButton.Parent
ButtonPanel[AButtonIndex]:=Panel
Image:=TBitmapImage.Create(WizardForm) //Рисунок который ложится на кнопку
Image.Width:=160 //Обязательно прописать оригинальный размер рисунка
Image.Height:=23
Image.Enabled:=False
Image.Bitmap.LoadFromFile(ExpandConstant('{tmp}\button.bmp'))
Image.Parent:=Panel
ButtonImage[AButtonIndex]:=Image
with TLabel.Create(WizardForm) do begin
Tag:=AButtonIndex
Parent:=Panel
Width:=Panel.Width
Height:=Panel.Height
Transparent:=True
OnClick:=@ButtonLabelClick
OnDblClick:=@ButtonLabelClick
OnMouseDown:=@ButtonLabelMouseDown
OnMouseUp:=@ButtonLabelMouseUp
end
Labl:=TLabel.Create(WizardForm) //Текст кнопок
Labl.Left:=16 //Указываем положение текста
Labl.Top:=5
Labl.Autosize:=True
Labl.Alignment:=taCenter
Labl.Tag:=AButtonIndex
Labl.Transparent:=True
Labl.Font.Color:=clWhite //Цвет текста
Labl.Caption:=AButton.Caption
Labl.OnClick:=@ButtonLabelClick
Labl.OnDblClick:=@ButtonLabelClick
Labl.OnMouseDown:=@ButtonLabelMouseDown
Labl.OnMouseUp:=@ButtonLabelMouseUp
Labl.Parent:=Panel
ButtonLabel[AButtonIndex]:=Labl
end;
procedure UpdateButton(AButton: TButton;AButtonIndex: integer);
begin
ButtonLabel[AButtonIndex].Caption:=AButton.Caption
ButtonPanel[AButtonIndex].Visible:=AButton.Visible
ButtonLabel[AButtonIndex].Enabled:=Abutton.Enabled
end;
procedure LicenceAcceptedRadioOnClick(Sender: TObject);
begin
ButtonLabel[bidNext].Enabled:=True
end;
procedure LicenceNotAcceptedRadioOnClick(Sender: TObject);
begin
ButtonLabel[bidNext].Enabled:=False
end;
procedure CurPageChanged2(CurPageID: Integer);
begin
UpdateButton(WizardForm.BackButton,bidBack)
UpdateButton(WizardForm.NextButton,bidNext)
UpdateButton(WizardForm.CancelButton,bidCancel)
end;
procedure InitializeWizard6();
begin
WizardForm.BackButton.Width:=ButtonWidth
WizardForm.BackButton.Height:=ButtonHeight
WizardForm.NextButton.Width:=ButtonWidth
WizardForm.NextButton.Height:=ButtonHeight
WizardForm.CancelButton.Width:=ButtonWidth
WizardForm.CancelButton.Height:=ButtonHeight
WizardForm.DirBrowseButton.Left:=337
WizardForm.DirBrowseButton.Width:=ButtonWidth
WizardForm.DirBrowseButton.Height:=ButtonHeight
WizardForm.GroupBrowseButton.Left:=337
WizardForm.GroupBrowseButton.Width:=ButtonWidth
WizardForm.GroupBrowseButton.Height:=ButtonHeight
WizardForm.LicenseAcceptedRadio.OnClick:=@LicenceAcceptedRadioOnClick
WizardForm.LicenseNotAcceptedRadio.OnClick:=@LicenceNotAcceptedRadioOnClick
ExtractTemporaryFile('button.bmp')
LoadButtonImage(WizardForm.BackButton,bidBack)
LoadButtonImage(WizardForm.NextButton,bidNext)
LoadButtonImage(WizardForm.CancelButton,bidCancel)
LoadButtonImage(WizardForm.DirBrowseButton,bidDirBrowse)
LoadButtonImage(WizardForm.GroupBrowseButton,bidGroupBrowse)
end;
//--------------------------С музыкой------------
const
BASS_ACTIVE_PLAYING = 1;
BASS_ACTIVE_STALLED = 2;
BASS_ACTIVE_PAUSED = 3;
BASS_SAMPLE_LOOP = 4;
var
mp3Handle: HWND;
mp3Name: String;
PlayButton, PauseButton, StopButton: TPanel;
PlayImage, PauseImage: TBitmapImage;
PlayLabel, PauseLabel: TLabel;
MouseLabel: Tlabel;
function BASS_Init(device: Integer; freq, flags: DWORD; win: hwnd; CLSID: Integer): Boolean;
external 'BASS_Init@files:BASS.dll stdcall delayload';
function BASS_StreamCreateFile(mem: BOOL; f: PChar; offset: DWORD; length: DWORD; flags: DWORD): DWORD;
external 'BASS_StreamCreateFile@files:BASS.dll stdcall delayload';
function BASS_Start(): Boolean;
external 'BASS_Start@files:BASS.dll stdcall delayload';
function BASS_ChannelPlay(handle: DWORD; restart: BOOL): Boolean;
external 'BASS_ChannelPlay@files:BASS.dll stdcall delayload';
function BASS_ChannelIsActive(handle: DWORD): Integer;
external 'BASS_ChannelIsActive@files:BASS.dll stdcall delayload';
function BASS_ChannelPause(handle: DWORD): Boolean;
external 'BASS_ChannelPause@files:BASS.dll stdcall delayload';
function BASS_Pause(): Boolean;
external 'BASS_Pause@files:BASS.dll stdcall delayload';
function BASS_Free(): Boolean;
external 'BASS_Free@files:BASS.dll stdcall delayload';
procedure PlayMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PlayImage.Left := -101
end;
procedure PlayMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PlayImage.Left := 5
end;
procedure PlayMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if PlayImage.Left <> -101 then PlayImage.Left := -197
end;
procedure PauseMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PauseImage.Left := -133
end;
procedure PauseMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PauseImage.Left := -37
end;
procedure PauseMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if PauseImage.Left <> -133 then PauseImage.Left := -229
end;
procedure MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
PlayImage.Left := -5
PauseImage.Left := -37
end;
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('BASS.dll');
ExtractTemporaryFile('sound.mp3');
mp3Name := ExpandConstant('{tmp}\sound.mp3');
BASS_Init(-1, 44100, 0, 0, 0);
mp3Handle := BASS_StreamCreateFile(FALSE, PChar(mp3Name), 0, 0, BASS_SAMPLE_LOOP);
BASS_Start();
BASS_ChannelPlay(mp3Handle, False);
Result := True;
end;
procedure PlayButtonOnClick(Sender: TObject);
begin
case BASS_ChannelIsActive(mp3Handle) of
BASS_ACTIVE_PAUSED:
begin
BASS_ChannelPlay(mp3Handle, False);
PlayButton.Hide
PauseButton.Show
end;
end;
end;
procedure PauseButtonOnClick(Sender: TObject);
begin
BASS_ChannelPause(mp3Handle);
PauseButton.Hide
PlayButton.Show
end;
procedure InitializeWizard7();
begin
ExtractTemporaryFile('MusicButton.bmp')
MouseLabel := TLabel.Create(WizardForm)
MouseLabel.Width := WizardForm.Width
MouseLabel.Height := WizardForm.Height
MouseLabel.Autosize := False
MouseLabel.Transparent := True
MouseLabel.OnMouseMove := @MouseMove
MouseLabel.Parent := WizardForm
PlayButton := TPanel.Create(WizardForm)
PlayButton.Left := 210
PlayButton.Top := 327
PlayButton.Width := 23
PlayButton.Height := 22
PlayButton.Cursor := crHand
PlayButton.ShowHint := True
PlayButton.Hint := 'Воспроизведение музыки'
PlayButton.OnClick := @PlayButtonOnClick
PlayButton.Parent := WizardForm
PlayImage := TBitmapImage.Create(WizardForm)
PlayImage.Left := 0
PlayImage.Top := 0
PlayImage.Width := 288
PlayImage.Height := 22
PlayImage.Enabled := False
PlayImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MusicButton.bmp'))
PlayImage.Parent := PlayButton
//
PlayImage.ReplaceColor:=$E2E2E2
PlayImage.ReplaceWithColor:=clBtnFace
PlayLabel := TLabel.Create(WizardForm)
PlayLabel.Width := PlayButton.Width
PlayLabel.Height := PlayButton.Height
PlayLabel.Autosize := False
PlayLabel.Transparent := True
PlayLabel.OnClick := @PlayButtonOnClick
PlayLabel.OnMouseDown := @PlayMouseDown
PlayLabel.OnMouseUp := @PlayMouseUp
PlayLabel.OnMouseMove := @PlayMouseMove
PlayLabel.Parent := PlayButton
PauseButton := TPanel.Create(WizardForm)
PauseButton.Left := 210
PauseButton.Top := 327
PauseButton.Width := 23
PauseButton.Height := 22
PauseButton.Cursor := crHand
PauseButton.ShowHint := True
PauseButton.Hint := 'Приостановить музыку'
PauseButton.OnClick := @PauseButtonOnClick
PauseButton.Parent := WizardForm
PauseImage := TBitmapImage.Create(WizardForm)
PauseImage.Left := -37
PauseImage.Top := 0
PauseImage.Width := 288
PauseImage.Height := 22
PauseImage.Enabled := False
PauseImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MusicButton.bmp'))
PauseImage.Parent := PauseButton
//
PauseImage.ReplaceColor:=$E2E2E2
PauseImage.ReplaceWithColor:=clBtnFace
PauseLabel := TLabel.Create(WizardForm)
PauseLabel.Width := PauseButton.Width
PauseLabel.Height := PauseButton.Height
PauseLabel.Autosize := False
PauseLabel.Transparent := True
PauseLabel.OnClick := @PauseButtonOnClick
PauseLabel.OnMouseDown := @PauseMouseDown
PauseLabel.OnMouseUp := @PauseMouseUp
PauseLabel.OnMouseMove := @PauseMouseMove
PauseLabel.Parent := PauseButton
end;
procedure DeinitializeSetup();
begin
BASS_Free();
end;
//--------------------Конец----------------
// Чек боксы и проверка харды ------------------------------------------------------------------------------------------------------------------------------------------------
const
NeedSize = 10000;
var
NeedSpaceLabel,FreeSpaceLabel: TLabel;
FreeMB, TotalMB: Cardinal;
PhysX, DirectX, Redist, Icons: TCheckBox;
PhysXLabel, IconsLabel, RedistLabel, DirectXLabel: TLabel;
function InstallDirectX: Boolean;
begin
Result:= DirectX.Checked;
end;
function InstallRedist: Boolean;
begin
Result:=Redist.Checked;
end;
////////////////////////////////////////////////////////////////////////////////////////////////////////
function InstallPhysX: Boolean;
begin
Result:=PhysX.Checked;
end;
function CreateIcons: Boolean;
begin
Result:=Icons.Checked;
end;
procedure RedistOnClick(Sender: TObject);
begin
if Redist.Checked = False then
Redist.Checked:= True else
Redist.Checked:= False;
end;
procedure DirectXLabelOnClick(Sender: TObject);
begin
if DirectX.Checked = False then
DirectX.Checked:= True else
DirectX.Checked:= False;
end;
procedure IconsOnClick(Sender: TObject);
begin
if Icons.Checked = False then
Icons.Checked:= True else
Icons.Checked:= False;
end;
procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: String;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if FreeMB > 1024 then
FreeSpaceLabel.Caption := 'Свободно на выбранном диске: ' + FloatToStr(round(FreeMB/1024*100)/100) + ' GB'
else
FreeSpaceLabel.Caption := 'Свободно на выбранном диске: ' + IntToStr(FreeMB)+ ' MB';
begin
if FreeMB < NeedSize then
begin
WizardForm.NextButton.Enabled:=false;
end else
WizardForm.NextButton.Enabled:=true;
end;
end;
procedure InitializeWizard8();
begin
WizardForm.DiskSpaceLabel.Hide;
NeedSpaceLabel := TLabel.Create(WizardForm);
with NeedSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(198);
Width := ScaleX(209);
Height := ScaleY(13);
Caption := 'Требуется для установки: 7.3 Гб';
end;
FreeSpaceLabel := TLabel.Create(WizardForm);
with FreeSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(216);
Width := ScaleX(209);
Height := ScaleY(13);
end;
Icons:= TCheckBox.Create(WizardForm);
with Icons do
begin
Parent:= WizardForm.SelectDirPage;
Left:= WizardForm.DirEdit.Left;
Top:= WizardForm.DirEdit.Top + 45;
Width:= ScaleX(14);
Height:= ScaleY(14);
TabOrder:= 2;
Checked:=True;
end;
IconsLabel:= TLabel.Create(WizardForm);
with IconsLabel do
begin
Caption:='Создать ярлык на рабочем столе';
Left:= WizardForm.DirEdit.Left + 20;
Top:= WizardForm.DirEdit.Top + 45;
Width:= ScaleX(150);
Height:= ScaleY(13);
// Font.Style:= [fsBold, fsItalic];
Font.Size:= 8;
// Font.Name:= 'Constantia';
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm.SelectDirPage;
OnClick:= @IconsOnClick;
end;
DirectX:= TCheckBox.Create(WizardForm);
with DirectX do
begin
Parent:= WizardForm.SelectDirPage;
Left:= WizardForm.DirEdit.Left;
Top:= WizardForm.DirEdit.Top + 65;
Width:= ScaleX(14);
Height:= ScaleY(14);
TabOrder:= 0;
Checked:= False;
end;
DirectXLabel:= TLabel.Create(WizardForm);
with DirectXLabel do
begin
Caption:= 'Установить DirectX';
Left:= WizardForm.DirEdit.Left + 20;
Top:= WizardForm.DirEdit.Top + 65;
Width:= ScaleX(150);
Height:= ScaleY(13);
// Font.Style:= [fsBold, fsItalic];
Font.Size:= 8;
// Font.Name:= 'Constantia';
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm.SelectDirPage;
OnClick:= @DirectXLabelOnClick;
end;
Redist:= TCheckBox.Create(WizardForm);
with Redist do
begin
Parent:= WizardForm.SelectDirPage;
Left:= 230;
Top:= WizardForm.DirEdit.Top + 45;
Width:= ScaleX(14);
Height:= ScaleY(14);
TabOrder:= 1;
Checked:= False;
end;
RedistLabel:= TLabel.Create(WizardForm);
with RedistLabel do
begin
Caption:='Установить Microsoft C++';
Left:= WizardForm.DirEdit.Left + 250;
Top:= WizardForm.DirEdit.Top + 45;
Width:= ScaleX(150);
Height:= ScaleY(13);
// Font.Style:= [fsBold, fsItalic];
Font.Size:= 8;
// Font.Name:= 'Constantia';
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm.SelectDirPage;
OnClick:= @RedistOnClick;
end;
PhysX:= TCheckBox.Create(WizardForm);
with PhysX do
begin
Parent:= WizardForm.SelectDirPage;
Left:= 230;
Top:= WizardForm.DirEdit.Top + 65;
Width:= ScaleX(14);
Height:= ScaleY(14);
TabOrder:= 1;
Checked:= False;
end;
PhysXLabel:= TLabel.Create(WizardForm);
with PhysXLabel do
begin
Caption:='Установить Nvidia PhysX';
Left:= 250;
Top:= WizardForm.DirEdit.Top + 65;
Width:= ScaleX(150);
Height:= ScaleY(13);
// Font.Style:= [fsBold, fsItalic];
Font.Size:= 8;
// Font.Name:= 'Constantia';
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm.SelectDirPage;
OnClick:= @RedistOnClick;
end;
WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
WizardForm.DirEdit.Text := WizardForm.DirEdit.Text + #0;
end;
procedure CurPageChanged3(CurPageID: Integer);
begin
if CurPageID = wpSelectDir then
if FreeMB < NeedSize then
begin
WizardForm.NextButton.Enabled:=False
end;
end;
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:isskin.dll stdcall';
procedure UnloadSkin();
external 'UnloadSkin@files:isskin.dll stdcall';
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external '
[email protected] stdcall';
function InitializeSetup2(): Boolean;
begin
ExtractTemporaryFile('Vista.cjstyles');
LoadSkin(ExpandConstant('{tmp}\Vista.cjstyles'), '');
Result := True;
end;
procedure DeinitializeSetup2();
begin
ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
UnloadSkin();
end;
// Папка ------------------------------------------------------------------------------------------------------------------------------------------------
procedure InitializeWizard9();
begin
ExtractTemporaryFile('papka.bmp');
WizardForm.SelectDirBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\papka.bmp'));
WizardForm.SelectDirBitmapImage.AutoSize:=true;
WizardForm.SelectGroupBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\papka.bmp'));
WizardForm.SelectGroupBitmapImage.AutoSize:=True;
end;
//Проверка сис требований ------------------------------------------------------------------------------------------------------------------------------------------------
type
PDisplay_Device = record
cb: DWord;
DeviceName: array [0..31] of char;
DeviceString: array [0..127] of char;
StateFlags: DWord;
DeviceID, DeviceKey: array [0..127] of char;
end;
TMixerCaps = record
vPid, vDriverVersion: DWord;
sName: array [0..31] of char;
Support, cDestinations: DWord;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
CurStepChanged1(CurStep);
end;
procedure CurPageChanged(CurPageID: Integer);
begin
CurPageChanged1(CurPageID);
CurPageChanged2(CurPageID);
CurPageChanged3(CurPageID);
PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
end;
procedure InitializeWizard();
begin
InitializeWizard1();
InitializeWizard2();
InitializeWizard3();
InitializeWizard4();
InitializeWizard5();
InitializeWizard6();
InitializeWizard7();
InitializeWizard8();
InitializeWizard9();
end;
[UninstallDelete]
Type: filesandordirs; Name: {app}