; ______ __ __ _______ _ _ _____ _______ _______ _ _
; |_____] \_/ |______ \ / | | |_____| | |______ \___/
; |_____] | |______ \/ __|__ |_____ | | |_____ |______ _/ \_
;
; Verison Script 1.2.5 - 29.11.2020.
#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif
#ifndef IS_ENHANCED
#error Enhanced edition of Inno Setup (restools) is required to compile this script
#endif
#define Font "Play.ttf"
#define FontName "Play"
#define Font2 "Play-Bold.ttf"
#define FontName2 "Play Bold"
#define AppName "Загатовка"
#define Publisher "EvilAlex"
#define AppInfoVer "1.0.75.0"
#define AppVer "1.05"
#define AppExe "unins000.exe"
#define NeedSize 4380
#define NeedInstallSize 7890
[Setup]
AppName={#AppName}
AppVersion={#AppVer}
VersionInfoVersion={#AppInfoVer}
//AppVerName={#AppName}{#AppVer}
AppCopyright=Repack by {#Publisher}
AppPublisher=Repack by {#Publisher}
VersionInfoDescription={#AppName}_Setup
DefaultDirName={sd}\Games\{#AppName}
DefaultGroupName={#AppName}
DirExistsWarning=no
UninstallFilesDir={app}
SetupIconFile=Files\inicon.ico
UninstallIconFile=Files\unicon.ico
UninstallDisplayIcon={app}\{#AppExe}
//RawDataResource=font:Files\{#Font} | font2:Files\{#Font2}
OutputDir=Output
OutputBaseFilename=Setup_{#AppName}
InternalCompressLevel=ultra64
Compression=lzma2/ultra64
SolidCompression=true
DisableReadyPage=true
DisableProgramGroupPage=true
ShowComponentSizes=false
[Icons]
Name: "{commondesktop}\{#AppName}"; Filename: "{app}\{#AppExe}"; IconFilename: {app}\{#AppExe};
[Files]
Source: Files\{#Font}; Flags: dontcopy
Source: Files\{#Font2}; Flags: dontcopy
Source: Files\InnoCallback.dll; Flags: dontcopy
Source: Files\bg.bmp; Flags: dontcopy
Source: Files\logo.bmp; Flags: dontcopy
Source: Files\*.bmp; DestDir: "{tmp}"; Flags: dontcopy
Source: Dll\WinTB.dll; Flags: dontcopy
Source: Dll\*.dll; DestDir: "{tmp}"; Flags: dontcopy
Source: Files\inicon.ico; DestDir: "{app}";
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[CustomMessages]
russian.setupname ={#AppName}
russian.aboutbutton =Опции
russian.NextButton =Установить
russian.FinButton =Завершить
russian.EndButton =Отменить
russian.StartButton =Играть
russian.WelcomeLabel=Добро пожаловать! Вы собираетесь начать установку
russian.WelcomeLabel2=Рекомендуется закрыть антивирусные пакеты%nи все прочие приложения перед тем, как продолжить.%nНажмите «Далее», что бы продолжить установку, или «Выход»,%nчтобы выйти из программы установки.
russian.WelcomeLabel3=Идет установка, Ждите...
russian.WelcomeLabel4=Игра была успешно установлена на ваш компьютер.%nПриложение можно запустить с помощью соответствующего значка%nна «Рабочем Столе» или меню «Пуск».
russian.WelcomeLabel5=Установка не была завершена.%nПожалуйста, устраните проблему и запустите установку снова.
russian.Dirlabel=Программа установит игру в следующую папку.
russian.Grouplabel=Программа создаст ярлыки в следующей папке меню «Пуск».
russian.Uninstall=Удаление - «{#AppName}»
russian.StatusUninstall=Пожалуйста ждите!%n%nИдет удаление компонентов игры...
[UninstallDelete]
Type: filesandordirs; Name: {app}
Код:
#include "WinTB.iss"
#include "Uninstall.iss"
//=-=-=-=-=-=-=-=-=-=-=-
var
ShowBtn,StartButton: TNewButton;
Flag: boolean;
p0,p1,p2,p3: TPanel;
BVL:TBevel;
Options: TNewButton;
PanelOptions: TPanel;
Soft: TNewCheckBox;
Desktop: TNewCheckBox;
WelcomeLabel,WelcomeLabel1,WelcomeLabel2,Dirlabel,Dirlabel2,Grouplabel,Iconslabel,Compslabel,Statuslabel,Label1,L1: TLabel;
//=-=-=-=-=-=-=-=-=-=-=-
const
FR_PRIVATE = $10;
//=-=-=-=-=-=-=-=-=-=-=-
function AddFontResource(lpszFilename: String; fl, pdv: DWORD): Integer; external 'AddFontResourceExW@gdi32.dll stdcall';
function RemoveFontResource(lpFileName: String; fl, pdv: DWORD): BOOL; external 'RemoveFontResourceExW@gdi32.dll stdcall';
//=-=-=-=-=-=-=-=-=-=-=-
var
TotalSpaceLabel, FreeSpaceLabel, NeedSpacelabel, InstallSpaceLabel: TLabel;
FreeMB, TotalMB: Cardinal;
function NumToStr(Float: Extended): String;
begin
Result:= Format('%.2f', [Float]);
StringChange(Result, ',', '.');
while ( Pos('.', Result) > 0 ) and ( (Result[Length(Result)] = '0') or (Result[Length(Result)] = '.') ) do SetLength(Result, Length(Result) - 1);
end;
function MbOrTb(Float: Extended): String;
begin
if Float < 1024 then Result:= NumToStr(Float)+' Мб' else
if Float/1024 < 1024 then Result:= NumToStr(Float/1024)+' Гб' else
Result:= NumToStr(Float/(1024*1024))+' Тб';
end;
procedure DirEditOnChange(Sender: TObject);
var
Drive: String;
begin
Drive:= ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Drive, True, FreeMB, TotalMB);
Dirlabel2.Caption:='Всего на HDD: '+MbOrTb(TotalMB)+#13+
'Доступно: '+MbOrTb(FreeMB)+' ('+IntToStr(round(FreeMB*100/TotalMB))+'%)'+#13+
'Нужно для распаковки: '+MbOrTb({#NeedInstallSize})+#13+
'Требуется места: '+MbOrTb({#NeedSize});
//WizardForm.NextButton.Enabled:= (FreeMB>{#NeedInstallSize})and(FreeMB>{#NeedSize});
end;
//=-=-=-=-=-=-=-=-=-=-=-
procedure ActivateClick(Sender: TObject);
begin
p0.Show;
L1.Show;
p1.Show;
p2.Show;
ShowBtn.Hide;
Options.Show;
PanelOptions.Show;
WelcomeLabel.Hide;
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
StartButton.Hide;
Wizardform.NextButton.Enabled := true;
Wizardform.BackButton.Enabled := False;
WizardForm.WizardBitmapImage2.Hide;
DirEditOnChange(nil)
PanelOptions.Hide;
end;
//=-=-=-=-=-=-=-=-=-=-=-
procedure HideComponents();
begin
p0.Hide;
L1.Hide;
p1.Hide;
p2.Hide;
p3.Hide;
WelcomeLabel.Hide;
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
StartButton.Hide;
WizardForm.WizardBitmapImage2.Hide;
Options.Hide;
//PanelOptions.Hide;
end;
//=-=-=-=-=-=-=-=-=-=-=-
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm:=False;
end;
//=-=-=-=-=-=-=-=-=-=-=-
function InitializeSetup:boolean;
begin
ExtractTemporaryFile('bg.bmp');
ExtractTemporaryFile('logo.bmp');
if not FileExists(ExpandConstant('{tmp}\WinTB.dll')) then ExtractTemporaryFile('WinTB.dll');
Result:=True;
end;
//=-=-=-=-=-=-=-=-=-=-=-
procedure CenterInParent(Control: TControl);
begin
if Assigned(Control) and Assigned(Control.Parent) then
begin
Control.Left := (Control.Parent.Width - Control.Width) div 2;
end;
end;
//=-=-=-=-=-=-=-=-=-=-=-
procedure StartButtonClick(Sender: TObject);
var
ResultCode: Integer;
begin
WizardForm.NextButton.OnClick(nil);
begin
ExecAsOriginalUser(ExpandConstant('{app}\{#AppExe}'), '', '',
SW_SHOWNORMAL, ewNoWait, ResultCode);
end;
end;
//=-=-=-=-=-=-=-=-=-=-=-
procedure OptionsClick(Sender: TObject);
begin
case TButton(Sender).Tag of
0: begin
TButton(Sender).Tag := 1;
TButton(Sender).Caption := 'Показать';
PanelOptions.Show;
//PanelOptions.Hide;
Soft.Show;
Desktop.Show;
end;
1: begin
TButton(Sender).Tag := 0;
TButton(Sender).Caption := 'Скрыть';
PanelOptions.Hide;
//PanelOptions.Show;
Soft.Hide;
Desktop.Hide;
end;
end;
end;
function SoftCheck: Boolean;
begin
Result := Soft.Checked;
end;
function DesktopCheck: Boolean;
begin
Result := Desktop.Checked;
end;
procedure WZ();
begin with WizardForm do begin
Flag:= True;
WizardForm.WizardBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\bg.bmp'));;
WizardForm.WizardBitmapImage.Stretch:=True;
WizardForm.WizardBitmapImage.Parent:=WizardForm;
WizardForm.WizardBitmapImage.SetBounds(0,0,WizardForm.ClientWidth,355);
WizardForm.WizardBitmapImage2.AutoSize := True;
WizardForm.WizardBitmapImage2.Top:=25;
WizardForm.WizardBitmapImage2.Left:=300;
WizardForm.WizardBitmapImage2.Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
WizardForm.WizardBitmapImage2.Parent:=WizardForm;
p0:= TPanel.Create(WizardForm);
p0.Parent := WizardForm;
p0.SetBounds(0,0,WizardForm.ClientWidth,WizardForm.ClientHeight-405);
p0.BevelOuter := bvNone;
L1 := TLabel.Create(WizardForm);
L1.Parent := WizardForm;
L1.Caption :=ExpandConstant('Параметры Установки');
L1.SetBounds(30,30,600,100);
L1.AutoSize:= false;
L1.Alignment := taCenter;
L1.Font.Size:=16;
L1.Font.Name := '{#FontName2}';
L1.Transparent:= True;
WizardForm.Bevel.SetBounds(0,355,660,1);
WizardForm.CancelButton.SetBounds(567,366,85,30);
WizardForm.CancelButton.Font.Size:=9;
WizardForm.CancelButton.Font.Name:='{#FontName}';
WizardForm.NextButton.SetBounds(567,366,85,30);
WizardForm.NextButton.Font.Size:=10;
WizardForm.NextButton.Font.Name:='{#FontName}';
ShowBtn := TNewButton.Create(WizardForm);
ShowBtn.Parent := WizardForm;
ShowBtn.SetBounds(8,366,60,30);
ShowBtn.Caption :=ExpandConstant('{cm:aboutbutton}');
ShowBtn.OnClick := @ActivateClick
ShowBtn.Font.Name:='{#FontName}';
ShowBtn.Font.Size:=10;
end;
p1 := TPanel.Create(WizardForm);
p1.Parent := WizardForm;
p1.SetBounds(10,92,642,136);
p1.BevelInner := bvSpace;
p1.BevelOuter := bvLowered;
p1.ParentBackground := False;
p1.Color := 13948116;
p2 := TPanel.Create(WizardForm);
p2.Parent := WizardForm;
p2.SetBounds(10,243,642,96);
p2.BevelInner := bvSpace;
p2.BevelOuter := bvLowered;
p2.ParentBackground := False;
p2.Color := 13948116;
p3 := TPanel.Create(WizardForm);
p3.Parent := WizardForm;
p3.SetBounds(10,159,642,180);
p3.BevelInner := bvSpace;
p3.BevelOuter := bvLowered;
p3.ParentBackground := False;
p3.Color := 13948116;
StartButton := TNewButton.Create(WizardForm);
with StartButton do
begin
Parent := WizardForm;
Font.Name:='{#FontName}';
Font.Size:=10;
SetBounds(8,366,60,30);
Caption:=ExpandConstant('{cm:StartButton}');
OnClick:=@StartButtonClick;
end;
//=-=-=-=-=-=-=-=-=-=-=-
WelcomeLabel:= TLabel.Create(WizardForm);
with WelcomeLabel do
begin
AutoSize:= false;
Parent := WizardForm;
Alignment := taCenter;
Font.Size:=14;
SetBounds(30,120,600,100);
Caption :=ExpandConstant('{cm:WelcomeLabel}');
Font.Name := '{#FontName}';
Transparent:= True;
end;
WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do
begin
AutoSize:= false;
Parent := WizardForm;
Alignment := taCenter;
Font.Size:=16;
SetBounds(30,150,600,100);
Caption := '{#AppName}';
Font.Name := '{#FontName2}';
Transparent:= True;
end;
WelcomeLabel2:= TLabel.Create(WizardForm);
with WelcomeLabel2 do
begin
Parent := WizardForm;
AutoSize:= false;
Font.Name := '{#FontName}';
Font.Size:=10;
Alignment := taCenter;
Transparent:= true;
WordWrap:= true;
Top :=WelcomeLabel1.Top+ScaleY(80);
Left := ScaleX(30);
Width := ScaleX(600);
Height := ScaleX(200);
Caption :=ExpandConstant('{cm:WelcomeLabel2}');
end;
//=-=-=-=-=-=-=-=-=-=-=-
Dirlabel:= TLabel.Create(WizardForm);
with Dirlabel do
begin
Parent := p1;
Left := ScaleY(8);
Top := ScaleX(13);
Font.Name := '{#FontName2}';
Caption :=ExpandConstant('{cm:Dirlabel}');
Transparent:= True;
end;
Dirlabel2:= TLabel.Create(WizardForm);
with Dirlabel2 do
begin
Parent := p1;
WordWrap := False;
AutoSize := False;
Left := ScaleY(480);
Top := ScaleX(5);
Width := ScaleX(156);
Height := ScaleY(124);
Font.Name := '{#FontName2}';
Transparent:= True;
Layout:=tlCenter;
end;
with WizardForm.DirEdit do
begin
Parent := p1;
Top := ScaleY(40);
Left := ScaleX(20);
Width := ScaleX(360);
Font.Name := '{#FontName2}';
Font.Color := clGreen;
OnChange:=@DirEditOnChange;
end;
with WizardForm.DirBrowseButton do
begin
Parent := p1;
Top := WizardForm.DirEdit.Top+ScaleY(-1);
Left := WizardForm.DirEdit.Width+WizardForm.DirEdit.Left+ScaleX(20);
Width := ScaleX(72);
Height := ScaleY(24);
Font.Name := '{#FontName2}';
//Font.Size:= {#FontButton};
end;
Grouplabel:= TLabel.Create(WizardForm);
with Grouplabel do
begin
Parent := p1;
Left := ScaleY(8);
Top := WizardForm.DirEdit.Top+WizardForm.DirEdit.Height+ScaleY(12);
Font.Name := '{#FontName2}';
Caption :=ExpandConstant('{cm:Grouplabel}');
Transparent:= True;
end;
with WizardForm.GroupEdit do
begin
Parent := p1;
Top := WizardForm.DirEdit.Top+ScaleY(60);
Left := ScaleX(20);
Width := ScaleX(360);
Font.Name := '{#FontName2}';
Font.Color := clGreen;
end;
with WizardForm.GroupBrowseButton do
begin
Parent := p1;
Top := WizardForm.GroupEdit.Top+ScaleY(-1);
Left := WizardForm.GroupEdit.Width+WizardForm.GroupEdit.Left+ScaleX(20);
Width := ScaleX(72);
Height := ScaleY(24);
Font.Name := '{#FontName2}';
// Font.Size:= {#FontButton};
end;
Options := TNewButton.Create(WizardForm);
with Options do
begin
Parent := WizardForm;
Left := ScaleX(8);
Top := ScaleY(366);
Width := ScaleX(150);
Height := ScaleY(30);
Caption := 'Дополнительные настройки';
OnClick := @OptionsClick;
end;
PanelOptions := TPanel.Create(WizardForm);
with PanelOptions do
begin
Parent := WizardForm;
Left := ScaleX(20);
Top := ScaleY(250);
Width := ScaleX(620);
Height := ScaleY(80);
Caption := '';
BevelInner := bvSpace;
BevelOuter := bvLowered;
ParentBackground := False;
Color := 13948116;
end;
Soft := TNewCheckBox.Create(WizardForm);
with Soft do
begin
Parent := PanelOptions;
Left := ScaleX(16);
Top := ScaleY(16);
Width := ScaleX(97);
Height := ScaleY(17);
Caption := 'Soft';
end;
{ Desktop }
Desktop := TNewCheckBox.Create(WizardForm);
with Desktop do
begin
Parent := PanelOptions;
Left := ScaleX(16);
Top := ScaleY(40);
Width := ScaleX(97);
Height := ScaleY(17);
Caption := 'Desktop';
end;
end;
//=-=-=-=-=-=-=-=-=-=-=-
procedure InitializeWizard;
begin
if not FontExists('{#FontName}') then
begin
ExtractTemporaryFile('{#Font}');
AddFontResource(ExpandConstant('{tmp}\{#Font}'), FR_PRIVATE, 0);
ExtractTemporaryFile('{#Font2}');
AddFontResource(ExpandConstant('{tmp}\{#Font2}'), FR_PRIVATE, 0);
end;
WizardForm.Font.Name := '{#FontName}';
with WizardForm do begin
Caption:='{#AppName}';
Color:=$00D3D3D3;
Position:=poScreenCenter;
InnerNotebook.Hide;
OuterNotebook.Hide;
ClientWidth:=660;
ClientHeight:=405;
//BorderStyle := bsDialog;
WZ();
Win7TaskBar20();
end;
end;
//=-=-=-=-=-=-=-=-=-=-=-
procedure CurPageChanged(CurPageID: Integer);
begin
HideComponents;
Wizardform.NextButton.Enabled := False;
PanelOptions.Hide;
case CurPageID of
wpWelcome:
begin
WelcomeLabel.Show;
WelcomeLabel1.Show;
WelcomeLabel2.Show;
WizardForm.WizardBitmapImage2.Show;
WizardForm.NextButton.Caption:=ExpandConstant('{cm:NextButton}');
end;
wpSelectDir:
begin
p1.Show;
p2.Show;
WizardForm.WizardBitmapImage2.Hide;
WizardForm.NextButton.Caption:=ExpandConstant('{cm:NextButton}');
end;
wpInstalling:
begin
p3.Show;
L1.Show;
L1.SetBounds(30,100,600,100);
L1.Caption:=ExpandConstant('{cm:WelcomeLabel3}');
WizardForm.WizardBitmapImage2.Show;
WizardForm.CancelButton.Caption:=ExpandConstant('{cm:EndButton}');
end;
wpfinished:
begin
WelcomeLabel1.Show;
WelcomeLabel1.Caption:='{#AppName}';
WelcomeLabel2.Show;
WelcomeLabel2.Caption:=ExpandConstant('{cm:WelcomeLabel4}');
Wizardform.NextButton.Enabled := True;
WizardForm.NextButton.Caption:=ExpandConstant('{cm:FinButton}');
WizardForm.WizardBitmapImage2.Show;
StartButton.Show;
end;
end;
end;
//=-=-=-=-=-=-=-=-=-=-=-
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID=6)or (PageID=7)or (PageID=8)or (PageID=10)
then Result:=true;
end;
//=-=-=-=-=-=-=-=-=-=-=-
procedure DeinitializeSetup;
begin
RemoveFontResource(ExpandConstant('{tmp}\{#Font}'), FR_PRIVATE, 0);
RemoveFontResource(ExpandConstant('{tmp}\{#Font2}'), FR_PRIVATE, 0);
WizardForm.Free;
end;
//=-=-=-=-=-=-=-=-=-=-=-[/SPOILER]