читать дальше »
;
//ArcExtract - распаковка архивов freearc
//ZipExtract - распаковка zip, 7z, tar архивов
//PCFExtract - распаковка pcf (файлы precomp)
//NextDisk - запрос следующего диска
//SrepExtract - распаковка архивов srep
//RepExtract - рапаковка архивов rep
//OggDecode - ogg to wav
//TakDecode - tak to wav
//ZipPak - упаковка zip, 7z архивов
//в каждом параметре прописано число - это шаг прогресс бара(можно изменить на любое)
//исходя из количества распаковываемой инфы указываем IsExtractBarMax - максимальное значение прогресс бара(всегда прибавляем 10, это для временных файлов)
//пример у нас два архива зип 10+10 и еще для времменных файлов +10 и того 30. значит указываем так - IsExtractBarMax "30"
//или например у нас одын фриарковый архив и в нем 5 огг файлов для конвертирования, получаем 10 + 5*5 =35 и прибавлем 10 для времменных файлов.
//чисто математика )
#define Pic1 "5"
#define Pic2 "9"
#define Pic3 "8"
#define ArcExtract "17"
#define ZipExtract "0"
#define SrepExtract "0"
#define RepExtract "0"
#define PrecompExtract "0"
#define OggDecode "0"
#define TakDecode "0"
#define ZipPak "0"
#define IsExtractBarMax "17"
;; ниже имя игры
#define MyAppName "World_of_Tanks"
;; ниже версия
#define MyAppVersion "1.0"
;; ниже автор
#define MyAppPublisher "The KillerMak"
;; ниже имя exe файла, на кторорый ссылается ярлык
#define MyAppExeName "WotLa.exe"
;; ниже версия, которая записывается в свойствах
#define vers1 "1.1.1.2"
;; ниже сколько требуется места на установку, в МБ
#define NeedSize1 "16000"
;Цвет инсталятора
#define colour "clblack"
[Setup]
AppName={#MyAppName}
AppverName={#MyAppVersion}
AppVersion={#MyAppVersion}
VersionInfoVersion={#vers1}
VersionInfoTextVersion={#vers1}
AppPublisher={#MyAppPublisher}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
WizardSmallImageFile=Files\WizardSmallImage.bmp
SetupIconFile=Files\icon.ico
WizardImageFile=Files\WizardImg.bmp
ShowTasksTreeLines=yes
OutputDir=Output
AllowCancelDuringInstall=no
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[CustomMessages]
rus.WelcomeLabel1=
rus.WelcomeLabel2=
rus.FinisLabel1=
rus.FinisLabel2=
rus.Tasks1=Установить &PhysX
rus.Tasks2=Установить &Microsoft Visual C++ Redist
rus.Tasks3=Обновить &DirectX (требуется интернет соединение)
rus.Prog=Дополнительное программное обеспечение:
rus.NeedSpace=Требуется места на диске:
rus.FreeSpace=Доступно места на диске:
rus.ru1=В пути установки присутствуют русские буквы, что недопустимо.
rus.ru2=Пожалуйста, повторите ввод.
[Tasks]
[Types]
Name: full; Description: Full installation; Flags: iscustom
[Run]
[Components]
Name: "mon12"; Description: "1.Удобные прицелы:";
Name: "mon\1"; Description: "Прицел от Джова"; Flags: exclusive
Name: "mon\2"; Description: "Прицел от Кирилла Орешкина"; Flags: exclusive
Name: "mona"; Description: "2.УГН.Углы горизонтальной наводки.:"; Types:
Name: "mona\1"; Description: "Уголком"; Flags: exclusive
Name: "mona\2"; Description: "Полукругом"; Flags: exclusive
Name: "mona789789"; Description: "3.Удаление черноты в снайперском режиме.:"; Types:
Name: "mona3"; Description: "4.Панель повреждений.:"; Types:
Name: "mona\3"; Description: "Простай с уроном."; Flags: exclusive
Name: "mona\4"; Description: "Боевой интерфейс от игрока zayaz."; Flags: exclusive
Name: "monaa3"; Description: "5.Настраиваемое меню команд.:"; Types:
Name: "mona33"; Description: "6.Командирская камера.:"; Types:
Name: "mona333"; Description: "7.Зум в снайперчком прицеле.:"; Types:
Name: "mona3333"; Description: "8.Цветные пробитая танка.:"; Types:
Name: "mona33334"; Description: "9.Подробное описаний умений и навыков.:"; Types:
//Name: "mona333345"; Description: "10.Автоматическая стрельба после перезарядки орудия.:"; Types:
//Name: "mon\17896"; Description: "Стандартный xvm"; Flags: exclusive
//Name: "mon\169"; Description: "xvm с Оленимером"; Flags: exclusive
Name: "mon\17896"; Description: "10.Комплесный мод xvm.:";Types:
Name: "mona12"; Description: "11.Улутшение освещение(+fps).:"; Types:
//Name: "mona1244"; Description: "Часы в ангаре.:"; Types:
Name: "mona12222"; Description: "12.Статистика за сесию(за весь день).:"; Types:
[Files]
Source: "E:\WG\2\Прицел джов\*"; DestDir: "{app}"; Components: mon\1; Flags: recursesubdirs
Source: "E:\WG\2\Приыел от кирила орешкина\*"; DestDir: "{app}"; Components: mon\2; Flags: recursesubdirs
Source: "E:\WG\2\Угн Уголком\*"; DestDir: "{app}"; Components: mona\1; Flags: recursesubdirs
Source: "E:\WG\2\угн полукругом\*"; DestDir: "{app}"; Components: mona\2; Flags: recursesubdirs
Source: "E:\WG\2\Удаление черноты\*"; DestDir: "{app}"; Components: mona789789; Flags: recursesubdirs
Source: "E:\WG\2\Дамаг панель\*"; DestDir: "{app}"; Components: mona\3; Flags: recursesubdirs
Source: "E:\WG\2\интерфейс от зайца\*"; DestDir: "{app}"; Components: mona\4; Flags: recursesubdirs
Source: "E:\WG\2\Настраиваемое меню команд для World of Tanks\*"; DestDir: "{app}"; Components: monaa3; Flags: recursesubdirs
Source: "E:\WG\2\отдаление\*"; DestDir: "{app}"; Components: mona33; Flags: recursesubdirs
Source: "E:\WG\2\зум\*"; DestDir: "{app}"; Components: mona333; Flags: recursesubdirs
Source: "E:\WG\2\Цветные пробития\*"; DestDir: "{app}"; Components:mona3333; Flags: recursesubdirs
Source: "E:\WG\2\Описание навыков\*"; DestDir: "{app}"; Components:mona33334; Flags: recursesubdirs
//Source: "E:\WG\2\Автоматическая стрельба после перезарядки орудия\*"; DestDir: "{app}"; Components: mona333345; Flags: recursesubdirs
Source: "E:\WG\2\xvm\*"; DestDir: "{app}"; Components: mon\17896; Flags: recursesubdirs
//Source: "E:\WG\2\оленимер\*"; DestDir: "{app}"; Components: mon\169; Flags: recursesubdirs
Source: "E:\WG\2\Улошение графики\*"; DestDir: "{app}"; Components: mona12; Flags: recursesubdirs
//Source: "E:\WG\2\Часы в ангаре\*"; DestDir: "{app}"; Components: mona1244; Flags: recursesubdirs
Source: "E:\WG\2\сесия\*"; DestDir: "{app}"; Components: mona12222; Flags: recursesubdirs
Source: Files\logo.bmp; Flags: dontcopy
Source: Files\BASS.dll; Flags: dontcopy
Source: Files\sound.mp3; Flags: dontcopy nocompression
Source: Files\MusicButton.bmp; Flags: dontcopy
Source: Files\DirBitmap.bmp; DestDir: "{tmp}"; Flags: dontcopy
Source: Files\GroupBitmap.bmp; DestDir: "{tmp}"; Flags: dontcopy
Source: Files\{#Pic1}.bmp; Flags: dontcopy
Source: Files\{#Pic2}.bmp; Flags: dontcopy
Source: Files\{#Pic3}.bmp; Flags: dontcopy
///////////////////////////////////////////////////////Файлы для распаковки======================================================================
;;-----------------------------------------------------------///////////////////////////--------------------------------------------------------
[Icons]
[UninstallDelete]
Type: filesandordirs; Name: {app};
[code]
#ifdef colour
const
Color = {#colour}; //===Цвет инсталятора=======
#endif
//-------------------------------------------Начало распаковка файлов--------------------------------------------------------------------
var
IsExtractProgressbar: TNewProgressBar;
ArcRes: Extended;
Folder: String;
ArcCount: Boolean;
FolderSize: Integer;
//------------------------------------------------------------//
procedure InitializeWizard2();
begin
IsExtractProgressbar:=TNewProgressBar.Create(WizardForm);
with IsExtractProgressbar do begin
Parent:=WizardForm.ProgressGauge.Parent;
SetBounds(WizardForm.ProgressGauge.Left, WizardForm.ProgressGauge.Top ,
WizardForm.ProgressGauge.Width, WizardForm.ProgressGauge.Height);
Max:={#IsExtractBarMax};
end;
end;
//------------------------------------------------------------//
//====================//
#include "Files\include.iss"
//====================//
//------------------------------------------------------------//
procedure IsExtract();
begin
WizardForm.StatusLabel.Caption:=SetupMessage(msgStatusExtractFiles);
WizardForm.CancelButton.Enabled:=false;
//распаковка временных файлов==========================
//распаковка архивов=======================================
//ArcExtract(ExpandConstant('{src}\data-g.bin'), ExpandConstant('{app}'));
(* дальше идут различные примеры
//DeleteFile(ExpandConstant('{app}\data-c.tar'));
ZipPak('-tzip', '-mx0', ExpandConstant('{app}\pak.zip'), ExpandConstant('{app}\data'));
ZipPak('-t7z', '-mx3', ExpandConstant('{app}\pak.7z'), ExpandConstant('{app}\data'));
ArcExtract(ExpandConstant('{src}\data.arc'), ExpandConstant('{app}'));
ArcExtract(ExpandConstant('{app}\data.arc'), ExpandConstant('{app}\files'));
ZipExtract(ExpandConstant('{src}\tak.7z'), ExpandConstant('{app}'));
ZipExtract(ExpandConstant('{src}\tak.zip'), ExpandConstant('{app}'));
SrepExtract(ExpandConstant('{app}\srep.srp'), ExpandConstant('{app}\srep.dat'));
RepExtract(ExpandConstant('{app}\rep.rep'));
NextDisk(2, ExpandConstant('{src}\setup-2.arc'));
PcfExtract (ExpandConstant('{app}\precomp.pcf'), ExpandConstant('{app}\file.tart')); //precomp
OggDecode; //Ogg
TakDecode; //TAK
*)
WizardForm.ProgressGauge.Hide;
end;
//------------------------------------------------------------//
procedure CurStepChanged2(CurStep: TSetupStep);
begin
if CurStep = ssInstall then begin
IsExtract();
end;
end;
//------------------------------------------------------------//
procedure CurPageChanged2(CurPageID: Integer);
begin
case CurPageID of
wpFinished: begin
WizardForm.NextButton.Left:=WizardForm.CancelButton.Left;
end;
end;
end;
////////////////////////////////////////////////////////////////////Конец распаковка файлов///////////////////////////////////////////////////////////////
//==================================================================Начало разметка формы=================================================================
var
FLabel1, FLabel2, WLabel1, WLabel2, PageNameLabel, PageDescriptionLabel,NeedSpaceLabel,FreeSpaceLabel: TLabel;
NeedSize:Integer;
FreeMB, TotalMB: Cardinal;
LogoImage: TBitmapImage;
ProgressBar1:TNewProgressBar;
const SmallWidth = 497;
//////---------------------------------------------------- музыка в инсталяторе
const
BASS_ACTIVE_STOPPED = 0;
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, StopImage: TBitmapImage;
PlayLabel, PauseLabel, StopLabel: TLabel;
MouseLabel: Tlabel;
AppPath: string;
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_Stop(): Boolean;
external 'BASS_Stop@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 := -96
end;
procedure PlayMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PlayImage.Left := 0
end;
procedure PlayMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if PlayImage.Left <> -96 then PlayImage.Left := -192
end;
procedure PauseMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PauseImage.Left := -128
end;
procedure PauseMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PauseImage.Left := -32
end;
procedure PauseMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if PauseImage.Left <> -128 then PauseImage.Left := -224
end;
procedure MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
PlayImage.Left := 0
PauseImage.Left := -32
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 Music;
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 := 465
PlayButton.Top := 64
PlayButton.Width := 23
PlayButton.Height := 23
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 := 23
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 := 465
PauseButton.Top := 64
PauseButton.Width := 23
PauseButton.Height := 23
PauseButton.Cursor := crHand
PauseButton.ShowHint := True
PauseButton.Hint := 'Приостановить музыку'
PauseButton.OnClick := @PauseButtonOnClick
PauseButton.Parent := WizardForm
PauseImage := TBitmapImage.Create(WizardForm)
PauseImage.Left := -32
PauseImage.Top := 0
PauseImage.Width := 288
PauseImage.Height := 23
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;
function InitializeSetup1(): 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 DeinitializeSetup1();
begin
BASS_Stop();
BASS_Free();
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 := ExpandConstant('{cm:FreeSpace}')+ ' ' + FloatToStr(round(FreeMB/1024*100)/100) + ' Gb' else
FreeSpaceLabel.Caption := ExpandConstant('{cm:FreeSpace}') + ' ' + IntToStr(FreeMB)+ ' Mb';
if FreeMB < NeedSize then
WizardForm.NextButton.Enabled := False else
WizardForm.NextButton.Enabled := True; end;
procedure GetNeedSpaceCaption; /////Вычисление требуемого места для установки
begin
if NeedSize > 1024 then
NeedSpaceLabel.Caption := ExpandConstant('{cm:NeedSpace}') + ' ' + FloatToStr(round(NeedSize/1024*100)/100) + ' Mb' else
NeedSpaceLabel.Caption := ExpandConstant('{cm:NeedSpace}') + ' ' + IntToStr(NeedSize)+ ' Mb';
end;
procedure InitializeWizard1();
begin
with WizardForm do
begin
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
FinishedHeadingLabel.Hide;
FinishedLabel.Hide;
ProgressGauge.Hide;
FileNameLabel.Hide;
StatusLabel.Top:=ScaleY(20);
WizardForm.DiskSpaceLabel.Hide;
end;
with WizardForm do
begin
WizardBitmapImage.Width := ScaleY (498);
WizardBitmapImage.Height := ScaleX (314);
WizardBitmapImage2.Width := ScaleY (498);
WizardBitmapImage2.Height := ScaleX (314);
WizardSmallBitmapImage.Left:= WizardForm.WizardSmallBitmapImage.Left - (SmallWidth - WizardForm.WizardSmallBitmapImage.Width) + 2 WizardSmallBitmapImage.Width:= SmallWidth
end;
begin
WLabel1 := TLabel.Create(WizardForm);
WLabel1.Left := ScaleX(40);
WLabel1.Top := ScaleY(150);
WLabel1.Width := ScaleX(240);
WLabel1.Height := ScaleY(100);
WLabel1.AutoSize := False;
WLabel1.WordWrap := True;
WLabel1.Font.Size := 8;
WLabel1.Font.Style := [fsBold];
WLabel1.Font.Color:= clWhite;
WLabel1.Font.Name:= 'Comic Sans MS'
WLabel1.ShowAccelChar := False;
WLabel1.Caption :=ExpandConstant('{cm:WelcomeLabel1}');
WLabel1.Transparent := True;
WLabel1.Parent := WizardForm.WelcomePage;
WLabel2 :=TLabel.Create(WizardForm);
WLabel2.Top := ScaleY(190);
WLabel2.Left := ScaleX(40);
WLabel2.Width := ScaleX(240);
WLabel2.Height := ScaleY(234);
WLabel2.AutoSize := False;
WLabel2.WordWrap := True;
WLabel2.Font.Size := 8;
WLabel2.Font.Style := [fsBold];
WLabel2.Font.Color:= clWhite;
WLabel2.Font.Name:= 'Comic Sans MS'
WLabel2.ShowAccelChar := False;
WLabel2.Caption := ExpandConstant('{cm:WelcomeLabel2}');
WLabel2.Transparent := True;
WLabel2.Parent := WizardForm.WelcomePage;
FLabel1 := TLabel.Create(WizardForm);
FLabel1.Left := ScaleX(40);
FLabel1.Top := ScaleY(150);
FLabel1.Width := ScaleX(240);
FLabel1.Height := ScaleY(54);
FLabel1.AutoSize := False;
FLabel1.WordWrap := True;
FLabel1.Font.Size := 8;
FLabel1.Font.Name := 'Comic Sans MS'
FLabel1.Font.Style := [fsBold];
FLabel1.Font.Color:= clWhite;
FLabel1.ShowAccelChar := False;
FLabel1.Caption := ExpandConstant('{cm:FinisLabel1}');
FLabel1.Transparent := True;
FLabel1.Parent := WizardForm.FinishedPage;
FLabel2 :=TLabel.Create(WizardForm);
FLabel2.Top := ScaleY(190);
FLabel2.Left := ScaleX(40);
FLabel2.Width := ScaleX(240);
FLabel2.Height := ScaleY(77);
FLabel2.AutoSize := False;
FLabel2.WordWrap := True;
FLabel2.Font.Size := 8;
FLabel2.Font.Name := 'Comic Sans MS'
FLabel2.Font.Style := [fsBold];
FLabel2.Font.Color:= clWhite;
FLabel2.ShowAccelChar := False;
FLabel2.Caption := ExpandConstant('{cm:FinisLabel2}');
FLabel2.Transparent := True;
FLabel2.Parent := WizardForm.FinishedPage;
end;
PageNameLabel:= TLabel.Create(WizardForm);
with PageNameLabel do
begin
SetBounds(WizardForm.PageNameLabel.Left, WizardForm.PageNameLabel.Top, WizardForm.PageNameLabel.Width - 32, WizardForm.PageNameLabel.Height)
AutoSize:= False; WordWrap:= True; Transparent:= True;
Font.Color:= clWhite;
Font.Style:= WizardForm.PageNameLabel.Font.Style;
Parent:= WizardForm.MainPanel;
end;
PageDescriptionLabel:= TLabel.Create(WizardForm);
with PageDescriptionLabel do
begin
SetBounds(WizardForm.PageDescriptionLabel.Left, WizardForm.PageDescriptionLabel.Top, WizardForm.PageDescriptionLabel.Width - 32, WizardForm.PageDescriptionLabel.Height)
AutoSize:= False; WordWrap:= True; Transparent:= True;
Font.Color:= clWhite;
Font.Style:= WizardForm.PageDescriptionLabel.Font.Style;
Parent:= WizardForm.MainPanel;
end;
Music //музыка в инсталяторе
NeedSize := {#NeedSize1};
NeedSpaceLabel := TLabel.Create(WizardForm);
with NeedSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(202);
Width := ScaleX(209);
Height := ScaleY(13);
end;
FreeSpaceLabel := TLabel.Create(WizardForm);
with FreeSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(220);
Width := ScaleX(209);
Height := ScaleY(13);
end;
with WizardForm do
begin
DirEdit.OnChange := @GetFreeSpaceCaption;
DirEdit.Text := WizardForm.DirEdit.Text + #0;
end;
ProgressBar1:=TNewProgressBar.Create(WizardForm);
with WizardForm.ProgressGauge do
begin
ProgressBar1.Left := WizardForm.ProgressGauge.Left;
ProgressBar1.Top := WizardForm.ProgressGauge.Top;
ProgressBar1.min:=0;
ProgressBar1.Width :=WizardForm.ProgressGauge.Width;
ProgressBar1.Height := WizardForm.ProgressGauge.Height;
ProgressBar1.Parent := WizardForm.InstallingPage;
ProgressBar1.Max:=4;
end;
ExtractTemporaryFile('logo.bmp');
LogoImage := TBitmapImage.Create(WizardForm);
with LogoImage do
begin
Parent := WizardForm;
Left := ScaleX(10);
Top := ScaleY(318);
AutoSize:=true;
ReplaceColor:=clFuchsia;
ReplaceWithColor:=clBtnFace;
Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
end;
end;
Procedure CurPageChanged1(CurPageID: Integer);
Begin
PageNameLabel.Caption:= WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption:= WizardForm.PageDescriptionLabel.Caption;
begin
if CurPageID=wpSelectDir then
begin
GetNeedSpaceCaption;
if FreeMB < NeedSize then
WizardForm.NextButton.Enabled:=False
end;end;
end;
//=======================================Конец разметка формы=======================================
function NextButtonClick1(CurPageID: Integer): Boolean;
var
i,j: integer;
s,c: string;
begin
Result := True;
if CurPageID = wpSelectDir then
begin
c := 'АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя';
for i:=1 to length(WizardForm.DirEdit.text) do
for j:=1 to length(c) do
begin
if WizardForm.DirEdit.text[i] = c[j] then //{app} Содержит русские символы
begin
s := ExpandConstant('{cm:ru1}')+#13#13+ExpandConstant('{cm:ru2}');
MsgBox(s, mbError, mb_Ok);
Result := False ; //Запрет перехода на следующую страницу
exit;
end
else Result := True; //Разрешаем переход на следующую страницу
end;
end;
end;
// --- Конец скрипта ------------------------------------------------------------
function InitializeSetup(): Boolean;
begin
Result := InitializeSetup1(); if not Result then exit;
end;
procedure DeinitializeSetup();
begin
DeinitializeSetup1();
end;
procedure InitializeWizard();
begin
//=================================================Начало папки=======================================
ExtractTemporaryFile('DirBitmap.bmp');
ExtractTemporaryFile('GroupBitmap.bmp');
WizardForm.SelectDirBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\DirBitmap.bmp'));
WizardForm.SelectDirBitmapImage.AutoSize:=true;
WizardForm.SelectGroupBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\GroupBitmap.bmp'));
WizardForm.SelectGroupBitmapImage.AutoSize:=true;
//===================================Конец папки=====================
/////////////////////////////////Шрифт в сетапе////////////////////////////
WizardForm.Font.Name:= 'Comic Sans MS';
/////////////////////////////////Конец шрифт в сетапе//////////////////////
/////////////////////////////////////Чёрный инсталятор///////////////////////////////////////////////////
#ifdef colour
begin
WizardForm.Font.Color:=clWhite;
WizardForm.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.WelcomeLabel1.Font.Color:=clWhite;
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;
WizardForm.PageNameLabel.Font.Color:=clWhite;
end;
procedure CompOnItemMouseMove(Sender: TObject; X, Y: Integer; Index: Integer; Area: TItemArea);
var
UndefPic: String;
begin
if Index = -1 then Exit;
if Index = LastIndex then Exit;
try
case TNewCheckListBox(Sender).ItemCaption[Index] of
case TNewCheckListBox(Sender).ItemCaption[Index] of
'Прицелы': UndefPic := '{#Pic1}.bmp';
'Арт-Прицелы': UndefPic := '{#Pic2}.bmp';
'Панели повреждений': UndefPic := '{#Pic3}.bmp';
else
begin
LastIndex := UNDEF_INDEX;
PicForm.Hide;
Exit;
end;
end;
if not FileExists(TempPath + UndefPic) then ExtractTemporaryFile(UndefPic);
ShowPicHint(TempPath + UndefPic);
finally
LastIndex := Index;
end;
end;
procedure CompOnMouseLeave(Sender: TObject);
begin
PicForm.Hide;
end;
procedure InitInfo();
begin
WizardForm.ComponentsList.OnItemMouseMove := @CompOnItemMouseMove;
WizardForm.ComponentsList.OnMouseLeave := @CompOnMouseLeave;
TempPath := AddBackslash(ExpandConstant('{tmp}'));
LastIndex := UNDEF_INDEX;
PicForm := TForm.Create(WizardForm)
with PicForm do
begin
BorderStyle := bsNone;
FormStyle := fsStayOnTop;
InfoPic := TBitmapImage.Create(PicForm)
with InfoPic do
begin
Parent := PicForm;
AutoSize := True;
end;
end;
end;
#endif
//////////////////////////////////////////////Конец чёрный инсталятор///////////////////////////////////////////////////////////////
InitializeWizard1();
InitializeWizard2();
end;
procedure CurPageChanged(CurPageID: Integer);
begin
CurPageChanged1(CurPageID);
CurPageChanged2(CurPageID);
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := NextButtonClick1(CurPageID); if not Result then exit;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
CurStepChanged2(CurStep);
end;