mirror of
https://github.com/CarldricGaming/Mini-Compressor
synced 2026-08-23 02:26:04 -04:00
2379 lines
No EOL
89 KiB
Text
2379 lines
No EOL
89 KiB
Text
; Script generated by the Inno Setup Script Wizard.
|
|
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
|
;#define DEBUG "E:\media_1"
|
|
[Preprocessor]
|
|
;#define AppName "RPG Maker MV"
|
|
;#define FONTNAME "Segoe UI"
|
|
;;Supported Color -> BLUE;GREEN;GRAY;ORANGE;PINK;RED;YELLOW;
|
|
;#define ColorName "Blue"
|
|
;#define Dark
|
|
;
|
|
;#define PACKAGEDESCRIPTION "Nothing ripped nor Re-Encoded"
|
|
;#define GAMEGENRE "Adventure"
|
|
;#define GAMERATING "Not Available"
|
|
; R
|
|
;#define NEEDSIZE 6144
|
|
;
|
|
;#define GameInfoFile "Info.txt"
|
|
;
|
|
;#define CPUCores 2 ;LOGICAL CORES
|
|
;#define CPUSpeed 2600 ;CPU SPEED IN MHz
|
|
;#define RAMSIZE 2024 ;RAM SIZE IN MB
|
|
;#define GPUSIZE 512 ;GPU SIZE IN MB
|
|
;#define GPUDX "10.0" ;DirectX Version
|
|
;#define OSVersion 7
|
|
;#define OSBuild 7600
|
|
|
|
#define i 1
|
|
|
|
#define Ini "Setup.ini"
|
|
#ifnexist Ini
|
|
#error "Setup.ini does not exists in the root script directory"
|
|
#endif
|
|
|
|
#define LangSetup ReadIni(SourcePath + Ini, 'Additional', "Language", "")
|
|
|
|
#define OutputDir ReadIni(SourcePath + Ini, 'Additional', "OutputDir", "")
|
|
#define OutputExec ReadIni(SourcePath + Ini, 'Additional', "OutputExec", "")
|
|
|
|
#define Watermark ReadIni(SourcePath + Ini,"Watermark","Who","")
|
|
|
|
#define AppName ReadIni(SourcePath + Ini,"Installer","Name","")
|
|
#define NEEDSIZE ReadIni(SourcePath + Ini,"Installer","Size","")
|
|
|
|
#define FONT "Segoe UI"
|
|
#define FONTNAME "'Segoe UI'"
|
|
;Supported Color -> BLUE;GREEN;GRAY;ORANGE;PINK;RED;YELLOW;
|
|
#define ColorName ReadIni(SourcePath + Ini,"Theme","Color","")
|
|
#if ReadIni(SourcePath + Ini,"Theme","Dark","") == "1"
|
|
#define Dark
|
|
#endif
|
|
|
|
#define PACKAGEDESCRIPTION ReadIni(SourcePath + Ini,"Game","Description","Not Available")
|
|
#define GAMEGENRE ReadIni(SourcePath + Ini,"Game","Genre","Not Available")
|
|
#define GAMERATING ReadIni(SourcePath + Ini,"Game","Rating","Not Available")
|
|
|
|
#define GameInfoFile "Info.txt"
|
|
|
|
#define CPUCores ReadIni(SourcePath + Ini,"System","CPUCores","0") ;LOGICAL CORES
|
|
#define CPUSpeed ReadIni(SourcePath + Ini,"System","CPUSpeed","0") ;CPU SPEED IN MHz
|
|
#define RAMSIZE ReadIni(SourcePath + Ini,"System","RAMSIZE","0") ;RAM SIZE IN MB
|
|
#define GPUSIZE ReadIni(SourcePath + Ini,"System","GPUSIZE","0") ;GPU SIZE IN MB
|
|
#define GPUDX ReadIni(SourcePath + Ini,"System","GPUDX","0") ;DirectX Version
|
|
#define OSVersion ReadIni(SourcePath + Ini,"System","OSVersion","0")
|
|
#define OSBuild ReadIni(SourcePath + Ini,"System","OSBuild","0")
|
|
|
|
//Processing color
|
|
#define ColorN LowerCase(ColorName)
|
|
#if (ColorN) == "blue"
|
|
#define Col "$00E4C300"
|
|
#elif (ColorN) == "green"
|
|
#define Col "$0085B100"
|
|
#elif ColorN == "gray"
|
|
#define Col "$00696969"
|
|
#elif ColorN == "orange"
|
|
#define Col "$000070E4"
|
|
#elif ColorN == "pink"
|
|
#define Col "$008A08E4"
|
|
#elif ColorN == "red"
|
|
#define Col "$000828E4"
|
|
#elif ColorN == "yellow"
|
|
#define Col "$0000D9DD"
|
|
#elif
|
|
#error Unknown color selected, Checkthe name of your color
|
|
#endif
|
|
|
|
#ifexist "Graphics\Background.jpg"
|
|
#define BackGround "Background.jpg"
|
|
#else
|
|
#define BackGround "Background.PNG"
|
|
#endif
|
|
|
|
#if ReadIni(SourcePath + Ini,"Installer","Files","") != ""
|
|
#define AppFiles ReadIni(SourcePath + Ini,"Installer","Files","")
|
|
#endif
|
|
|
|
#if ReadIni(SourcePath + Ini,"Installer","MC","0") != "0"
|
|
#define MC
|
|
#endif
|
|
|
|
#if defined(ISDONE)
|
|
#undef MC
|
|
#undef APPFiles
|
|
#else
|
|
#if defined(MC)
|
|
#undef AppFiles
|
|
#endif
|
|
#endif
|
|
|
|
#if defined(RAZOR_PRECOMP) || defined(RAZOR_PRECOMP_MT)
|
|
#define PrecompVer ReadIni(SourcePath + Ini,"Precomp","Version","0.43")
|
|
#endif
|
|
|
|
#if defined(PrecompInside)
|
|
#ifnexist "Include\precomp.exe"
|
|
#error WARNING: Precomp.exe does not exist for CLS in Include Directory
|
|
#endif
|
|
#endif
|
|
|
|
#if ReadIni(SourcePath + "..\Resources\UnArc.ini","Config_UnArc","Protect","") != "0"
|
|
#define UnArc_Protect
|
|
#define UnArc_File2 ReadIni(SourcePath + "..\Resources\UnArc.ini","Files_Unarc","Protect","")
|
|
#else
|
|
#define UnArc_None
|
|
#define UnArc_File1 ReadIni(SourcePath + "..\Resources\UnArc.ini","Files_Unarc","None","")
|
|
#endif
|
|
|
|
[Setup]
|
|
AppName={#AppName}
|
|
AppVersion=1.0
|
|
DefaultDirName={pf}\{#AppName}
|
|
DefaultGroupName={#AppName}
|
|
DisableWelcomePage=0
|
|
#ifdef DEBUG
|
|
OutputDir={#DEBUG}
|
|
#endif
|
|
#ifexist "Game.ico"
|
|
SetupIconFile=Game.ico
|
|
#else
|
|
SetupIconFile=Resources\Icon.ico
|
|
#endif
|
|
UninstallDisplayIcon=Resources\Icon.ico
|
|
ShowLanguageDialog=no
|
|
Compression=lzma2/ultra64
|
|
OutputDir={#OutputDir}
|
|
OutputBaseFilename={#OutputExec}
|
|
#ifdef AppFiles
|
|
InternalCompressLevel=ultra64
|
|
DiskSpanning=True
|
|
DiskSliceSize=736000000
|
|
#endif
|
|
MinVersion=0,5.01
|
|
|
|
[Languages]
|
|
#ifexist "compiler:Languages\english.isl"
|
|
Name: "en"; MessagesFile: "compiler:Languages\english.isl"
|
|
#else
|
|
Name: "en"; MessagesFile: "compiler:Default.isl"
|
|
#endif
|
|
|
|
[Files]
|
|
Source: "..\Resources\XHashNext.dll"; DestDir: {tmp}; Flags: dontcopy;
|
|
#ifdef UnArc_Protect
|
|
Source: "..\{#UnArc_File2}"; DestDir: "{tmp}"; Flags: dontcopy
|
|
#endif
|
|
#ifdef UnArc_None
|
|
Source: "..\{#UnArc_File1}"; DestDir: "{tmp}"; Flags: dontcopy
|
|
#endif
|
|
|
|
#sub ISDoneFile1
|
|
#define ISDInf1 ReadIni(AddBackSlash(SourcePath) + "..\Resources\ISD_List.ini", "ISDone_Files", Str(i), "")
|
|
Source: "..\Resources\ISDone_resource\{#ISDInf1}"; DestDir: "{tmp}"; Flags: "dontcopy";
|
|
#endsub
|
|
#if ReadIni(AddBackSlash(SourcePath) + "..\Resources\ISD_List.ini", "ISDone_Files", "1", "") != ""
|
|
#for {i = 1; ReadIni(AddBackSlash(SourcePath) + "..\Resources\ISD_List.ini", "ISDone_Files", StringChange("Int","Int", Str(i)), "") !=""; i++} ISDoneFile1
|
|
#endif
|
|
|
|
#sub ISDoneFile4
|
|
#define ISDInf1 ReadIni(AddBackSlash(SourcePath) + "..\Resources\ISD_List_Manual.ini", "ISDone_Files", Str(i), "")
|
|
Source: "..\Resources\ISDone_resource\{#ISDInf1}"; DestDir: "{tmp}"; Flags: "dontcopy";
|
|
#endsub
|
|
#if ReadIni(AddBackSlash(SourcePath) + "..\Resources\ISD_List_Manual.ini", "ISDone_Files", "1", "") != ""
|
|
#for {i = 1; ReadIni(AddBackSlash(SourcePath) + "..\Resources\ISD_List_Manual.ini", "ISDone_Files", StringChange("Int","Int", Str(i)), "") !=""; i++} ISDoneFile4
|
|
#endif
|
|
|
|
Source: "..\Resources\ISDone\*.*"; DestDir: {tmp}; Flags: dontcopy;
|
|
Source: "Resources\Dll\*"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\*"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Languages\*"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Graphics\*"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "{#gameInfoFile}"; DestDir: "{tmp}"; Flags: dontcopy
|
|
|
|
#ifdef MC
|
|
Source: "Archive.ini"; DestDir: "{tmp}"; Flags: dontcopy
|
|
#endif
|
|
|
|
Source: "Resources\Graphics\Icons\Home.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Info.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Settings.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\System.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Notes.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Notes_{#COLORN}.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Install.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Install_{#COLORN}.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Finish.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Finish_{#COLORN}.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
#if (ColorN) == "blue"
|
|
Source: "Resources\Graphics\Icons\Home_Blue.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Browse_Blue.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Info_Blue.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Settings_Blue.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\System_Blue.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
#elif ColorN == "gray"
|
|
Source: "Resources\Graphics\Icons\Home_Gray.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Browse_gray.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Info_Gray.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Settings_Gray.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\System_Gray.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
#elif (ColorN) == "green"
|
|
Source: "Resources\Graphics\Icons\Home_Green.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Browse_green.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Info_Green.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Settings_Green.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\System_Green.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
#elif ColorN == "orange"
|
|
Source: "Resources\Graphics\Icons\Home_Orange.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Browse_orange.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Info_Orange.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Settings_Orange.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\System_Orange.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
#elif ColorN == "pink"
|
|
Source: "Resources\Graphics\Icons\Browse_pink.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Home_Pink.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Info_Pink.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Settings_Pink.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\System_Pink.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
#elif ColorN == "red"
|
|
Source: "Resources\Graphics\Icons\Browse_red.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Home_Red.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Info_Red.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Settings_red.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\System_Red.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
#elif ColorN == "yellow"
|
|
Source: "Resources\Graphics\Icons\Browse_yellow.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Home_Yellow.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Info_Yellow.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\Settings_Yellow.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
Source: "Resources\Graphics\Icons\System_Yellow.PNG"; DestDir: "{tmp}"; Flags: dontcopy
|
|
#endif
|
|
|
|
#if defined(AppFiles)
|
|
#if AppFiles != ""
|
|
Source: {#AppFiles}\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: unins*;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
[Registry]
|
|
Root: HKLM; Subkey: SOFTWARE\{#AppName}; ValueName: InstallPath; ValueType: string; ValueData: {app}; Flags: uninsdeletekey
|
|
|
|
[Icons]
|
|
Name: "{group}\Uninstall"; Filename: "{uninstallexe}"; WorkingDir: "{app}"; Comment: "Uninstall {#AppName}"; Flags: createonlyiffileexists;
|
|
#define public ShortcutsINI ".\Exec.ini"
|
|
#ifnexist ShortCutsINI
|
|
#error Ini doesn't Exists
|
|
#endif
|
|
#define public Counter
|
|
#define public i
|
|
#define public Section
|
|
#expr Counter = 0
|
|
#define public ExeName
|
|
#define public ExeFile
|
|
#define public ExeGroupFile
|
|
#define public ExeParameters
|
|
#define public ExeWorkingDir
|
|
#define public ExeComment
|
|
#define public ExeIconFileName
|
|
#define public ExeFlags
|
|
#sub AddIcons
|
|
#expr Counter = Counter + 1
|
|
#expr Section = StringChange( "ExeCounter", "Counter", str(Counter) )
|
|
#expr ExeName = ReadIni (SourcePath + ShortcutsINI , Section, "Name")
|
|
#expr Exefile = Readini (SourcePath + ShortcutsINI , Section, "File")
|
|
#expr ExeParameters = Readini (SourcePath + ShortcutsINI , Section, "Parameters","")
|
|
#expr ExeWorkingDir = Readini (SourcePath + ShortcutsINI , Section, "WorkingDir","{app}")
|
|
#expr ExeComment = Readini (SourcePath + ShortcutsINI , Section, "Comment","Play")
|
|
#expr ExeIconFileName = Readini (SourcePath + ShortcutsINI , Section, "IconFileName","")
|
|
#expr ExeFlags = Readini (SourcePath + ShortcutsINI , Section, "Flags","createonlyiffileexists")
|
|
#if ReadIni(SourcePath + ShortcutsINI, Section, "GroupShortCut","0") != "0"
|
|
#expr ExeGroupFile = Readini(SourcePath + ShortcutsINI , Section, "GroupIconName","")
|
|
Name: "{group}\{#ExeGroupFile}"; Filename:"{#ExeFile}"; Parameters: "{#ExeParameters}" ; WorkingDir: "{#ExeWorkingDir}" ; Comment: "{#ExeComment}" ; IconFilename: "{#ExeIconFileName}" ; Flags: {#ExeFlags} ;
|
|
#endif
|
|
Name: "{userdesktop}\{#ExeName}"; Filename: "{#ExeFile}"; Parameters: "{#ExeParameters}" ; WorkingDir: "{#ExeWorkingDir}"; Comment: "{#ExeComment}" ; IconFilename: "{#ExeIconFileName}" ; Flags: {#ExeFlags} ;
|
|
#endsub
|
|
|
|
#for { i = 1 ; ReadIni( SourcePath + ShortcutsINI, StringChange( "ExeCounter", "Counter", str(i)) , "Name" , "" ) != "" ; i++ } AddIcons
|
|
|
|
[UninstallDelete]
|
|
Type: filesandordirs; Name: {app}
|
|
|
|
[Code]
|
|
#include "..\Resources\XHashNext.iss"
|
|
#include "Resources\Include\Windows.iss"
|
|
#include "Resources\Include\botva2\Botva2.iss"
|
|
#include "Resources\Include\Commonfunctions.iss"
|
|
#include "Resources\Include\ISSysInfo.iss"
|
|
#include "Resources\Include\IsDone.Functions.iss"
|
|
#ifdef MC
|
|
#include "Resources\Include\MC.iss"
|
|
#endif
|
|
|
|
const
|
|
Allign = taLeftJustify;
|
|
homepage = 1;
|
|
infopage = 2;
|
|
syspage = 3;
|
|
configpage = 4;
|
|
ProcessorCheckpage = 0;
|
|
MemoryCheckpage = 1;
|
|
GraphicCheckPage = 2;
|
|
WindowCheckPage = 3;
|
|
#define MemoryBtnCaption "GetLangLabel('Memory')"
|
|
#define GraphicBtnCaption "GetLangLabel('Graphics')"
|
|
#define WindowBtnCaption "GetLangLabel('Windows')"
|
|
#define ProcessorBtnCaption "GetLangLabel('Processor')"
|
|
oneMB= 1024*1024;
|
|
BASS_ACTIVE_STOPPED = 0;
|
|
BASS_ACTIVE_PLAYING = 1;
|
|
BASS_ACTIVE_STALLED = 2;
|
|
BASS_ACTIVE_PAUSED = 3;
|
|
#define UIfontStyles "[fsUnderline]"
|
|
|
|
type
|
|
TSmlBtn = record
|
|
Base :TPanel;
|
|
Img : Image;
|
|
OnBtnCol, OnLeaveCol : TColor;
|
|
end;
|
|
|
|
TSideBtn = record
|
|
Img, OnMouseImg : Image;
|
|
SidePnl : TPanel;
|
|
Labl1, Labl2 : TLabel;
|
|
end;
|
|
|
|
TUilabl = record
|
|
labl, Sublabl :Tlabel;
|
|
bottomline :TPanel;
|
|
end;
|
|
|
|
TMetroBtn = record
|
|
base : Tpanel;
|
|
ModalBtn : TButton;
|
|
end;
|
|
|
|
TMetroEdt = record
|
|
base : TListView;
|
|
Text,btnLabl : Tlabel;
|
|
btn :Image;
|
|
end;
|
|
|
|
TStateCompare = record
|
|
ifEqual, IfGreater, ifLesser :Image;
|
|
Parent_Handle :HWND;
|
|
end;
|
|
|
|
TMetroUiPage = Record
|
|
LeftUiLabl, BottomLeftUiLabl, RightUiLabl, BottomRightUiLabl :TUILabl;
|
|
Base :TListView;
|
|
BackGround : Image;
|
|
PageTitle,Extra1,Extra2 :TLabel;
|
|
end;
|
|
|
|
TMetroUiSysPage = Record
|
|
Base :TListView;
|
|
LeftTitle, Left, BottomLeftTitle, BottomLeft, RightTitle, Right,
|
|
BottomRightTitle, bottomRight,Extra1 :TLabel;
|
|
LeftBtn, MidBtn, rightBtn : TMetroBtn;
|
|
Verdict : TCusPb;
|
|
BackGround : Image;
|
|
HomeSideBtn, InfoSideBtn, SysSideBtn, OptionSideBtn : TSideBtn;
|
|
PageTitle :TLabel;
|
|
Uilabl : array of TUiLabl;
|
|
end;
|
|
|
|
TReadyPage = record
|
|
LeftUiLabl, BottomLeftUiLabl, RightUiLabl :TUILabl;
|
|
Base :TListView;
|
|
BackGround : Image;
|
|
PageTitle,Extra1 :TLabel;
|
|
ComponentLabl : array of TLabel;
|
|
Btns : array of TmetroBtn;
|
|
Compares : array of TStateCompare;
|
|
end;
|
|
|
|
TMetroInstallPage = record
|
|
LeftUiLabl, BottomLeftUiLabl, RightUiLabl, BottomRightUiLabl :TUILabl;
|
|
Base :TListView;
|
|
BackGround : Image;
|
|
PageTitle :TLabel;
|
|
ProgressBar : TCusPB;
|
|
MonitorLabls, StatTitles, StatLabls : array of TLabel;
|
|
end;
|
|
|
|
TMetroFinishPage = record
|
|
LeftUiLabl, BottomLeftUiLabl :TUILabl;
|
|
Base :TListView;
|
|
BackGround : Image;
|
|
PageTitle, GuideLineLabl :TLabel;
|
|
end;
|
|
|
|
TMetroDialogForm = Record
|
|
Form : TSetupForm;
|
|
UpperPanel, LowerPanel : TPanel ;
|
|
UpperPanelLabl, NotificationLabl :TLabel;
|
|
MessageUiLabl, ResponseUiLabl : TUiLabl;
|
|
YesBtn, NoBtn : TMetroBtn;
|
|
end;
|
|
|
|
TPBProc = function (h:hWnd;Msg,wParam,lParam:Longint):Longint;
|
|
TBGIChange=procedure;
|
|
TTimerProc= procedure(Hwnd,Msg,Idevent,DwTime: Longword);
|
|
|
|
var
|
|
MinimizeBtn, CloseBtn, MusicBtn : TSmlBtn;
|
|
WelcomeUi, InfoUi, ConfigUi :TMetroUipage;
|
|
SysCheckPage : array of TMetroUiSysPage;
|
|
ReadyPage : TReadyPage;
|
|
InstallPage : TMetroInstallPage;
|
|
FinishPage :TMetroFinishPage;
|
|
HomeSideBtn, InfoSideBtn, SysSideBtn, OptionSideBtn, NotesSideBtn, InstallSideBtn, FinishSideBtn : TSideBtn;
|
|
SidePnl, SidePnl2 :Tpanel;
|
|
AppLabel, GuideLine, FreeSpaceTitle, FreeSpace, NeedSpaceTitle, NeedSpace, TotalSpaceTitle, TotalSpace, LeftSpaceTitle, LeftSpace,LanguageLabel, langNav :TLabel;
|
|
MetroNextBtn : TMetroBtn;
|
|
CurPoint : TPOINT;
|
|
DirEdt :TMetroEdt;
|
|
Drive, temp: String;
|
|
Language: array of String;
|
|
CurLang :Integer;
|
|
TotalMB, FreeMB : Cardinal;
|
|
Curpercentage, Time, TimeLeft, minutes, hours, seconds:Integer;
|
|
TimerId :LONGWORD;
|
|
TransferRate :Extended;
|
|
Startedat : DWORD;
|
|
mp3Handle: HWND;
|
|
DialogForm : TMetroDialogForm;
|
|
|
|
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: PAnsiChar; offset1: DWORD; offset2: DWORD; length1: DWORD; length2: 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_Stop: Boolean;
|
|
external 'BASS_Stop@files:BASS.dll stdcall delayload';
|
|
function BASS_Free: Boolean;
|
|
external 'BASS_Free@files:BASS.dll stdcall delayload';
|
|
|
|
function _BASS_ScreenToClient(hWnd: HWND; var lpPoint: TPoint): BOOL; external 'ScreenToClient@user32.dll stdcall delayload';
|
|
function _BASS_GetCursorPos(var lpPoint: TPoint): BOOL; external 'GetCursorPos@user32.dll stdcall delayload';
|
|
function _BASS_GetAncestor(hwnd: HWND; gaFlags: UINT): HWND; external 'GetAncestor@user32.dll stdcall delayload';
|
|
function _BASS_Init(device: LongInt; freq, flags: DWORD; win: hwnd; CLSID: Integer): Boolean; external 'BASS_Init@{tmp}\BASS.dll stdcall delayload';
|
|
function _BASS_ChannelPlay(handle: DWORD; restart: BOOL): Boolean; external 'BASS_ChannelPlay@{tmp}\BASS.dll stdcall delayload';
|
|
function _BASS_ChannelIsActive(handle: DWORD): DWORD; external 'BASS_ChannelIsActive@{tmp}\BASS.dll stdcall delayload';
|
|
function _BASS_Stop(): Boolean; external 'BASS_Stop@{tmp}\BASS.dll stdcall delayload';
|
|
function _BASS_Free(): Boolean; external 'BASS_Free@{tmp}\BASS.dll stdcall delayload';
|
|
function _BASS_Start(): Boolean; external 'BASS_Start@{tmp}\BASS.dll stdcall delayload';
|
|
function _BASS_Pause(): Boolean; external 'BASS_Pause@{tmp}\BASS.dll stdcall delayload';
|
|
function _BASS_ChannelPause(handle: DWORD): Boolean; external 'BASS_ChannelPause@{tmp}\BASS.dll stdcall delayload';
|
|
|
|
function WrapBGI(callback: TBGIChange; Paramcount: Integer): longword;
|
|
external 'wrapcallback@{tmp}\innocallback.dll stdcall delayload';
|
|
function WrapTimerProc(callback: TTimerProc; Paramcount: Integer): longword;
|
|
external 'wrapcallbackaddr@{tmp}\CallbackCtrl.dll stdcall delayload';
|
|
|
|
procedure SidePnlUp(Sender :TObject);forward;
|
|
procedure SidePnlDown(Sender :TObject);forward;
|
|
procedure BrowseBtnClick(Sender :TObject); forward;
|
|
procedure LangUpdate; forward;
|
|
function GetLangLabel(message :String):String; forward;
|
|
|
|
function GetLangLabel(message :String):String;
|
|
begin
|
|
Result := GetIniString('CustomMessages',
|
|
message,
|
|
GetIniString('CustomMessages',message,message,ExpandConstant('{tmp}\Language1.txt')),
|
|
ExpandConstant('{tmp}\Language'+IntToStr(CurLang+1)+'.txt'));
|
|
StringChange(Result,'<AppName>','{#AppName}');
|
|
StringChange(Result,'%n',#13#10);
|
|
StringChange(Result,'<GameGenre>','{#GameGenre}');
|
|
StringChange(Result,'<GameRating>','{#GameRating}');
|
|
StringChange(Result,'<PACKAGEDESCRIPTION>','{#PACKAGEDESCRIPTION}');
|
|
end;
|
|
|
|
function NumToStr(Float: Extended): String;
|
|
begin
|
|
Result:= formatfloat('0.##',Float)
|
|
end;
|
|
|
|
function MbOrTb(Float: Extended): String;
|
|
begin
|
|
if Float < 1024 then
|
|
Result:= NumToStr(Float)+GetLangLabel('MB')
|
|
else if Float/1024 < 1024 then
|
|
Result:= NumToStr(Float/1024)+GetLangLabel('GB')
|
|
else
|
|
Result:= NumToStr(Float/(1024*1024))+GetLangLabel('TB');
|
|
end;
|
|
|
|
function MbOrTb2(Float: Longint): String;
|
|
begin
|
|
if Float > -1024 then
|
|
Result:= NumToStr(Float)+GetLangLabel('MB')
|
|
else if Float/1024 > -1024 then
|
|
Result:= NumToStr(Float/1024.0)+GetLangLabel('GB')
|
|
else
|
|
Result:= NumToStr(Float/(1024.0*1024.0))+GetLangLabel('TB');
|
|
end;
|
|
|
|
function ByteOrGB(Bytes: Extended; noMB: Boolean): String;
|
|
begin
|
|
if not noMB then
|
|
Result:= NumToStr(Int(Bytes)) +' Mb'
|
|
else
|
|
if Bytes < 1024 then
|
|
if Bytes = 0 then
|
|
Result:= '0'
|
|
else
|
|
Result:= NumToStr(Int(Bytes)) +' Bt'
|
|
else
|
|
if Bytes/1024 < 1024 then
|
|
Result:= NumToStr(((Bytes/1024)*10)/10) +' Kb'
|
|
else
|
|
If Bytes/oneMB < 1024 then
|
|
Result:= NumToStr((Bytes/oneMB*100)/100) +' Mb'
|
|
else
|
|
Result:= NumToStr((Bytes/oneMB/1024*1000)/1000) +' Gb';
|
|
end;
|
|
|
|
function CalcDirSize(const fromDir, fileMask: string; SubDirsAllow: Boolean): Extended;
|
|
var
|
|
FSR, DSR: TFindRec; FindResult: Boolean; APath: string;
|
|
Begin
|
|
APath:= AddBackslash(fromDir);
|
|
FindResult:= FindFirst(APath + fileMask, FSR);
|
|
Try
|
|
while FindResult do
|
|
begin
|
|
if FSR.Attributes and FILE_ATTRIBUTE_DIRECTORY = 0 then
|
|
Result := Result + Size64(FSR.SizeHigh, FSR.SizeLow);
|
|
FindResult:= FindNext(FSR);
|
|
end;
|
|
FindResult := FindFirst(APath + '*.*', DSR);
|
|
while FindResult and SubDirsAllow do
|
|
begin
|
|
if ((DSR.Attributes and FILE_ATTRIBUTE_DIRECTORY) = FILE_ATTRIBUTE_DIRECTORY) and not ((DSR.Name = '.') or (DSR.Name = '..')) then
|
|
{Recursion} Result:= Result + CalcDirSize(APath + DSR.Name, fileMask, SubDirsAllow);
|
|
FindResult:= FindNext(DSR);
|
|
end;
|
|
Finally
|
|
FindClose(FSR); FindClose(DSR);
|
|
end;
|
|
End;
|
|
|
|
function TimeTextFormater(clock:String):String;
|
|
begin
|
|
case clock of
|
|
'hours': begin
|
|
if hours = 1 then
|
|
Result:= GetLangLabel('hour')
|
|
else
|
|
Result:= GetLangLabel('hours');
|
|
end;
|
|
'minutes': begin
|
|
if minutes = 1 then
|
|
Result:= GetLangLabel('minute')
|
|
else
|
|
Result:= GetLangLabel('minutes');
|
|
end;
|
|
'seconds': begin
|
|
if seconds = 1 then
|
|
Result:= GetLangLabel('second')
|
|
else
|
|
Result:= GetLangLabel('seconds');
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
function TimeFormater(secondp:Integer):String;
|
|
begin
|
|
seconds := secondp
|
|
minutes := 0
|
|
hours := 0
|
|
if seconds >= 60 then begin
|
|
minutes := seconds / 60
|
|
seconds := seconds mod 60
|
|
end;
|
|
if minutes >= 60 then begin
|
|
hours := minutes / 60
|
|
minutes := minutes mod 60
|
|
end;
|
|
if hours <> 0 then
|
|
Result := IntToStr(hours) + ' ' + TimeTextFormater('hours') + ' ' + IntToStr(minutes) + ' ' + TimeTextFormater('minutes')
|
|
else begin
|
|
if minutes <> 0 then
|
|
Result := IntToStr(minutes) + ' ' + TimeTextFormater('minutes') + ' ' + IntToStr(seconds) + ' ' + TimeTextFormater('seconds')
|
|
else
|
|
Result := IntToStr(seconds) + ' ' + TimeTextFormater('seconds')
|
|
end;
|
|
end;
|
|
|
|
#ifdef MC
|
|
function ProgressCallback2(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
|
|
begin
|
|
if (OveralPct + SplitPct)<=Wizardform.ProgressGauge.Max then
|
|
Wizardform.ProgressGauge.Position := OveralPct + SplitPct;
|
|
WizardForm.FilenameLabel.Caption := CurrentFile;
|
|
Result := ISDoneCancel;
|
|
end;
|
|
#endif
|
|
|
|
procedure BGIChanger;
|
|
begin
|
|
with WizardForm.ProgressGauge do
|
|
begin
|
|
CurPercentage := (Position * 1000) / Max;
|
|
PBSetProgress(InstallPage.ProgressBar,CurPercentage,1000);
|
|
end;
|
|
Time := (GetTickCount-Startedat)/1000;
|
|
if CurPercentage <> 0 then
|
|
TimeLeft := ((Time * 1000) / CurPercentage) - Time;
|
|
InstallPage.StatLabls[0].Caption := TimeFormater(Time);
|
|
InstallPage.StatLabls[1].Caption := TimeFormater(TIme+TimeLeft);
|
|
InstallPage.StatLabls[2].Caption := TimeFormater(TimeLeft);
|
|
InstallPage.StatLabls[4].Caption := MinimizePathName(WizardForm.FilenameLabel.Caption, InstallPage.StatLabls[4].Font, InstallPage.StatLabls[4].Width);
|
|
|
|
temp := GetLangLabel('MemoryLeft');
|
|
StringChange(temp,'<MemoryLeft>',MbOrTb(GetFreePhysicalMemory));
|
|
InstallPage.MonitorLabls[1].Caption := temp;
|
|
|
|
GetSpaceOnDisk(ExtractFileDrive(WizardForm.DirEdit.Text), True, FreeMB, TotalMB);
|
|
|
|
TransferRate := (Extended(Curpercentage * {#NeedSize} ) / (Time * 1000) );
|
|
InstallPage.StatLabls[3].Caption := MbOrTb( TransferRate ) +'/'+ GetLangLabel('seconds');
|
|
|
|
temp := GetLangLabel('SpaceLeft');
|
|
StringChange(temp,'<FreeSpace>',MbOrTb(FreeMB));
|
|
InstallPage.MonitorLabls[2].Caption := temp;
|
|
|
|
temp := GetLangLabel('Progress');
|
|
StringChange(temp,'<Progress>',FormatFloat('0.##',Curpercentage/10.0) + '%');
|
|
InstallPage.MonitorLabls[0].Caption := temp;
|
|
end;
|
|
|
|
|
|
procedure SmlBtnMouseEnter(Sender :TObject);
|
|
begin
|
|
case Sender of
|
|
MinimizeBtn.base:
|
|
MinimizeBtn.Base.Color := MinimizeBtn.OnBtnCol;
|
|
CloseBtn.base:
|
|
CloseBtn.Base.Color := CloseBtn.OnBtnCol;
|
|
MusicBtn.base:
|
|
MusicBtn.Base.Color := MusicBtn.OnBtnCol;
|
|
end;
|
|
end;
|
|
|
|
procedure SmlBtnMouseLeave(Sender :TObject);
|
|
begin
|
|
case Sender of
|
|
MinimizeBtn.base:
|
|
MinimizeBtn.Base.Color := MinimizeBtn.OnLeaveCol;
|
|
CloseBtn.base:
|
|
CloseBtn.Base.Color := CloseBtn.OnLeaveCol;
|
|
MusicBtn.base:
|
|
MusicBtn.Base.Color := MusicBtn.OnLeaveCol;
|
|
end;
|
|
end;
|
|
|
|
procedure SmlBtnEvent(var btn : TSmlBtn; Event :TNotifyEvent);
|
|
begin
|
|
btn.Base.OnClick := Event;
|
|
end;
|
|
|
|
function CreateSmlBtn(hParent :TWinControl;hleft,htop,hwidth,hheight,Ileft,Itop,IWidth,IHeight:Integer;hColor,hOnBtnCol,hOnLeaveCol:TColor; hImg: String):TsmlBtn;
|
|
begin
|
|
Result.Base := CreatePanel(hParent,hLeft,hTop,hWidth,hHeight,hColor);
|
|
Result.Base.OnMouseEnter := @SmlBtnMouseEnter;
|
|
Result.Base.OnMouseLeave := @SmlBtnMouseLeave;
|
|
Result.OnBtnCol := hOnBtnCol;
|
|
Result.OnLeaveCol := hOnLeaveCol;
|
|
Result.Img := ImgLoad(Result.Base.Handle,hImg,Ileft,Itop,IWidth,Iheight,true,false);
|
|
ImgApplyChanges(Result.Base.Handle);
|
|
end;
|
|
|
|
procedure SideBtnClick(var sidebtn :TSideBtn);
|
|
begin
|
|
ImgSetVisibility(sidebtn.Img,False);
|
|
ImgSetVisibility(sidebtn.OnMouseImg,true);
|
|
sidebtn.SidePnl.Color := {#Col};
|
|
sidebtn.SidePnl.Show;
|
|
sidebtn.Labl1.font.color := {#Col};
|
|
ImgApplyChanges(sidebtn.SidePnl.Parent.Handle);
|
|
end;
|
|
|
|
procedure SideBtnDisable(var sidebtn :TSideBtn);
|
|
begin
|
|
ImgSetVisibility(sidebtn.Img,true);
|
|
ImgSetVisibility(sidebtn.OnMouseImg,false);
|
|
sidebtn.SidePnl.Hide;
|
|
sidebtn.SidePnl.Color := clwhite;
|
|
sidebtn.Labl1.font.color := clwhite;
|
|
end;
|
|
|
|
procedure SideBtnVisibility( var sideBtn :TSideBtn; visible :BOOL);
|
|
begin
|
|
ImgSetVisibility(sidebtn.Img,visible);
|
|
if ImgGetVisibility(sidebtn.OnMouseImg) then
|
|
ImgSetVisibility(sidebtn.OnMouseImg,visible);
|
|
if sideBtn.SidePnl.Visible then
|
|
sideBtn.SidePnl.Visible := visible;
|
|
sideBtn.Labl2.Visible := Visible;
|
|
sideBtn.Labl1.Visible := Visible;
|
|
ImgApplyChanges(sideBtn.SidePnl.Parent.Handle)
|
|
end;
|
|
|
|
procedure AllSidebtnDisable;
|
|
begin
|
|
SideBtnDisable(HomeSideBtn);
|
|
SideBtnDisable(InfoSideBtn);
|
|
SideBtnDisable(OptionSideBtn);
|
|
SideBtnDisable(SysSideBtn);
|
|
end;
|
|
|
|
procedure MetroUiPageHide;
|
|
var g:Integer;
|
|
begin
|
|
WelcomeUi.Base.Hide;
|
|
InfoUi.Base.Hide;
|
|
ConfigUi.Base.Hide;
|
|
for g := 0 to 3 do
|
|
SysCheckPage[g].Base.Hide;
|
|
end;
|
|
|
|
procedure SidebtnSetLablVisibility(Visible :BOOL );
|
|
begin
|
|
HomeSideBtn.Labl1.Visible := Visible;
|
|
SysSideBtn.Labl1.Visible := Visible;
|
|
InfoSideBtn.Labl1.Visible := Visible;
|
|
OptionSideBtn.Labl1.Visible := Visible;
|
|
end;
|
|
|
|
procedure SetSideBtnOnCLick(var sidebtn :TSideBtn; Event : TMouseEvent);
|
|
begin
|
|
sidebtn.Labl2.OnMOuseDown := Event;
|
|
sidebtn.Labl1.OnMOuseDown := Event;
|
|
sidebtn.SidePnl.OnMOuseDown := Event;
|
|
end;
|
|
|
|
function CreateSideBtn(hParent :TWinControl;hleft,htop,hwidth,hheight:Integer; hImgSfx,hCaption:String):TSideBtn;
|
|
begin
|
|
Result.SidePnl := CreatePanel(hParent,hLeft,htop,6,hheight,clwhite);
|
|
Result.SidePnl.Hide;
|
|
Result.Img := ImgLoad(hParent.Handle,hImgSfx + '.PNG',hleft + 16, hTop + 12,24,24,true,false);
|
|
Result.OnMouseImg := ImgLoad(hParent.Handle,hImgSfx + '_{#ColorName}.PNG',hleft + 16, hTop + 12,24,24,true,false);
|
|
ImgSetVisibility(Result.OnMouseImg,False);
|
|
Result.Labl1 := Createlabel(Sidepnl2,false,False,hleft,htop,hwidth,hheight,10,clwhite,hCaption,taCenter);
|
|
Result.Labl1.Layout := tlCenter;
|
|
Result.labl1.Cursor := crhand;
|
|
result.Labl2 := CreateLabel(hParent,false,false,hleft,htop,hwidth,hheight,0,clNone,'',tacenter);
|
|
Result.labl2.Cursor := crhand;
|
|
ImgApplyChanges(hParent.Handle);
|
|
end;
|
|
|
|
procedure UiLablVisibility( var hlabl :TUiLabl; visible :BOOL);
|
|
begin
|
|
hlabl.labl.visible := visible;
|
|
hlabl.SubLabl.visible := visible;
|
|
hlabl.bottomline.visible := visible;
|
|
end;
|
|
|
|
procedure UiLablSetLabl(var hUILabl: TUiLabl;hCaption, hSubCaption:String);
|
|
begin
|
|
hUILabl.labl.Caption := hCaption;
|
|
hUILabl.Sublabl.Caption := hSubCaption;
|
|
end;
|
|
|
|
procedure UiLablSetBounds(var hUILabl: TUiLabl; hleft,htop,hwidth,hheight,hSublablLeft :Integer);
|
|
begin
|
|
hUILabl.labl.SetBounds(hleft,htop,hwidth,hheight);
|
|
hUILabl.bottomline.SetBounds(hleft,htop+hheight-2,hwidth,2);
|
|
hUILabl.SubLabl.SetBounds(hSublablLeft,htop+hheight+2,hwidth,hheight);
|
|
end;
|
|
|
|
procedure UiLablIncreLeft(var hUILabl: TUiLabl; hleft:Integer);
|
|
begin
|
|
hUILabl.bottomline.Left := hUILabl.bottomline.Left + hleft;
|
|
hUILabl.labl.Left := hUILabl.labl.left + hleft;
|
|
hUILabl.SubLabl.left := hUILabl.SubLabl.left + hLeft;
|
|
end;
|
|
|
|
function CreateUiLabl(hParent :TWinControl;hleft,htop,hwidth,hheight,hFontSize,hStrokeWidth:Integer; hFontColor :TColor; hCaption, hSubCaption:String):TUiLabl;
|
|
begin
|
|
Result.labl := Createlabel(hParent,false,false,hLeft,htop,hwidth,hheight,hFontSize,hFontColor,hCaption,Allign);
|
|
result.Labl.Font.Name := 'Segoe UI Bold';
|
|
result.labl.Layout := tlCenter;
|
|
result.bottomLine := CreatePanel(hParent,hleft,htop+hheight-hStrokeWidth,hwidth,hStrokeWidth,clwhite);
|
|
Result.SubLabl := Createlabel(hParent,false,false,hleft,htop+hheight+2,hwidth,hheight,10,clwhite,hSubCaption,taleftjustify);
|
|
ImgApplyChanges(hParent.Handle);
|
|
end;
|
|
|
|
function CreateUiLabl2(hParent :TWinControl;hleft,htop,hwidth,hheight,hFontSize,hStrokeWidth:Integer; hFontColor :TColor; hCaption, hSubCaption:String):TUiLabl;
|
|
begin
|
|
Result.labl := Createlbl(hParent,false,false,hLeft,htop,hwidth,hheight,hFontSize,hFontColor,hCaption,Allign);
|
|
result.Labl.Font.Name := 'Segoe UI Bold';
|
|
result.labl.Layout := tlCenter;
|
|
result.bottomLine := CreatePanel(hParent,hleft,htop+hheight-hStrokeWidth,hwidth,hStrokeWidth,clwhite);
|
|
Result.SubLabl := Createlbl(hParent,false,false,hleft,htop+hheight+2,hwidth,hheight,10,clwhite,hSubCaption,taleftjustify);
|
|
ImgApplyChanges(hParent.Handle);
|
|
end;
|
|
|
|
function CreateEdt(hParent :TWinControl; hleft,htop,hwidth,hheight,hFontSize,hStrokeWidth,hbtnLength:Integer;hImgSfx :string; hFontCol, hbackCol,hBorderCol :TColor):TMetroEdt;
|
|
begin
|
|
Result.base := TListView.Create(hParent);
|
|
with Result.base do
|
|
begin
|
|
Parent := hParent;
|
|
SetBounds(hleft,htop,hwidth,hheight);
|
|
Color := hbackCol;
|
|
BorderStyle := bsNone;
|
|
end;
|
|
Border(result.base,hStrokeWidth,hBorderCol);
|
|
Result.Text := Createlabel(Result.base,false,false,hstrokewidth*2,hstrokewidth,hWidth-hbtnLength-(hstrokewidth*2),hheight-hstrokewidth,hFontsize,hFontCol,'Hello',taLeftJustify);
|
|
Result.Text.layout := tlCenter;
|
|
Result.Btn := ImgLoad(result.base.handle,hImgSfx+'_{#ColorName}.PNG',hwidth-(hStrokeWidth*2)-hbtnLength,hStrokeWidth*2,hbtnLength,hbtnLength,true,true);
|
|
Result.btnlabl := TLabel.create(result.base);
|
|
with Result.btnlabl do
|
|
begin
|
|
Parent:=result.base;
|
|
AutoSize:=false;
|
|
SetBounds(hwidth-(hStrokeWidth*2)-hbtnLength,hStrokeWidth*2,hbtnLength,hbtnLength);
|
|
WordWrap := True;
|
|
with Font do
|
|
begin
|
|
Name:= 'Segoe UI';
|
|
Size:=8;
|
|
Color:=clwhite;
|
|
end;
|
|
Alignment:=taCenter;
|
|
ShowHint := True;
|
|
Hint := 'Browse';
|
|
ParentShowHint := False;
|
|
OnClick := @BrowseBtnClick;
|
|
end;
|
|
ImgApplyChanges(Result.base.handle);
|
|
end;
|
|
|
|
procedure MetroBtnVisibility(var btn :TMetroBtn; Visible :Boolean );
|
|
begin
|
|
btn.base.Visible := Visible;
|
|
end;
|
|
|
|
procedure MetroBtnEvent(var btn :TMetroBtn; Event :TNotifyEvent );
|
|
begin
|
|
btn.base.OnClick := Event;
|
|
end;
|
|
|
|
procedure MetroBtnCaption(var btn :TMetroBtn; hCaption :String);
|
|
begin
|
|
btn.base.caption := hCaption;
|
|
end;
|
|
|
|
function ButtonCreate(hParent :TWinControl; hLeft, hTop, hWidth, hHeight, hBorderWidth :Integer;hBorderCol,hColor :TColor;hCaption :String;Modal: Integer): TMetroBtn;
|
|
begin
|
|
Result.Base:= TPanel.Create(hParent);
|
|
with Result.Base do
|
|
begin
|
|
Parent:=hParent;
|
|
Left:=hLeft;
|
|
Top:=hTop;
|
|
Width:=hWidth;
|
|
Height:=hHeight;
|
|
Color:=hcolor;
|
|
BorderStyle := bsNone;
|
|
BevelInner := bvNone;
|
|
BevelOuter := bvNone;
|
|
BorderWidth := 0;
|
|
ParentBackground := False;
|
|
Caption := hCaption;
|
|
with Font do
|
|
begin
|
|
Name := {#FontName};
|
|
Color := clwhite;
|
|
end;
|
|
end;
|
|
Border(result.base,hBorderWidth,hBorderCol);
|
|
Result.ModalBtn:= TButton.Create(hParent);
|
|
with Result.ModalBtn do
|
|
begin
|
|
SetBounds(0,0,0,0);
|
|
ModalResult:=Modal;
|
|
Parent:= hParent;
|
|
end;
|
|
end;
|
|
|
|
procedure UpdateStateCompare(var sc :TStateCompare; Compare1, Compare2 :Extended);
|
|
begin
|
|
ImgSetVisibility(sc.ifEqual,False);
|
|
ImgSetVisibility(sc.ifGreater,False);
|
|
ImgSetVisibility(sc.iflesser,False);
|
|
if ( Compare1 = Compare2) then
|
|
ImgSetVisibility(sc.ifEqual,True)
|
|
else if ( Compare1 > Compare2 ) then
|
|
ImgSetVisibility(sc.ifGreater,True)
|
|
else if ( Compare1 < Compare2 ) then
|
|
ImgSetVisibility(sc.iflesser,True);
|
|
ImgApplyChanges(sc.Parent_Handle);
|
|
end;
|
|
|
|
function CreateStateCompare(hHandle :HWND; hLeft, hTop, hWidth, hHeight :Integer; ifGreaterImg, ifequalImg, ifLessImg :String):TStateCompare;
|
|
begin
|
|
Result.Parent_Handle := hHandle;
|
|
Result.ifEqual := ImgLoad(Result.parent_Handle,ifequalImg,hLeft, hTop, hWidth, hHeight, true, true);
|
|
Result.ifGreater := ImgLoad(Result.parent_Handle,ifGreaterImg,hLeft, hTop, hWidth, hHeight, true, true);
|
|
Result.iflesser := ImgLoad(Result.parent_Handle,ifLessImg,hLeft, hTop, hWidth, hHeight, true, true);
|
|
ImgSetVisibility(Result.ifEqual,False);
|
|
ImgSetVisibility(Result.ifGreater,False);
|
|
ImgSetVisibility(Result.iflesser,False);
|
|
ImgApplyChanges(result.Parent_Handle);
|
|
end;
|
|
|
|
procedure WFMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|
begin
|
|
SetLayeredWindowAttributes(StrToInt(ExpandConstant('{wizardhwnd}')), 0, 155, LWA_ALPHA);
|
|
ReleaseCapture;
|
|
SendMessage(WizardForm.Handle,$0112,$F012,0);
|
|
SetLayeredWindowAttributes(StrToInt(ExpandConstant('{wizardhwnd}')), 0, 255, LWA_ALPHA);
|
|
end;
|
|
|
|
procedure DFMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|
begin
|
|
ReleaseCapture;
|
|
SendMessage(DialogForm.Form.Handle,$0112,$F012,0);
|
|
end;
|
|
|
|
procedure WFMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|
begin
|
|
|
|
end;
|
|
|
|
procedure WFShow(Sender: TObject);
|
|
begin
|
|
// AnimateWindow(WizardForm.Handle,1000, AW_SLIDE_IN_RIGHT);
|
|
end;
|
|
|
|
procedure BrowseBtnClick(Sender :TObject);
|
|
begin
|
|
WizardForm.DirBrowseButton.Click;
|
|
end;
|
|
|
|
procedure CancelBtnclick(Sender: TObject);
|
|
begin
|
|
WizardForm.CancelButton.Click;
|
|
end;
|
|
|
|
procedure MinimizeBtnclick(Sender: TObject);
|
|
begin
|
|
ReleaseCapture;
|
|
SendMessage(WizardForm.Handle,$112,61472,0);
|
|
end;
|
|
|
|
procedure MetroNextBtnClick(Sender: TObject);
|
|
begin
|
|
if WizardForm.CurPageID = wpInstalling then
|
|
WizardForm.CancelButton.Click
|
|
else
|
|
WizardForm.NextButton.Click;
|
|
end;
|
|
|
|
procedure MetroBackBtnClick(Sender: TObject);
|
|
begin
|
|
WizardForm.BackButton.Click;
|
|
end;
|
|
|
|
procedure CloseBtnClick(Sender: TObject);
|
|
begin
|
|
if WizardForm.CurPageID = wpFinished then
|
|
WizardForm.NextButton.Click
|
|
else
|
|
WizardForm.CancelButton.Click;
|
|
end;
|
|
|
|
procedure OnLangNav(Sender :TObject);
|
|
begin
|
|
LanguageLabel.Font.Color := {#Col};
|
|
langNav.Font.Color := {#Col};
|
|
end;
|
|
|
|
procedure OffLangNav(Sender :TObject);
|
|
begin
|
|
LanguageLabel.Font.Color := clwhite;
|
|
langNav.Font.Color := clwhite;
|
|
end;
|
|
|
|
procedure DirEdtChange(Sender :TObject);
|
|
begin
|
|
DirEdt.Text.Caption := MinimizePathName(WizardForm.DirEdit.Text, DirEdt.Text.Font, DirEdt.Text.Width);
|
|
ReadyPage.ComponentLabl[4].Caption := MinimizePathName(WizardForm.DirEdit.Text, DirEdt.Text.Font, DirEdt.Text.Width);
|
|
Drive:= ExtractFileDrive(WizardForm.DirEdit.Text);
|
|
GetSpaceOnDisk(Drive, True, FreeMB, TotalMB);
|
|
FreeSpace.Caption:= MbOrTb(FreeMB)+' ('+(NumToStr(FreeMB*100.0/TotalMB))+'%)';
|
|
NeedSpace.Caption:= MBorTb({#NeedSize}*1.0) ;
|
|
TotalSpace.Caption := MbOrTb(TotalMB*1.0);
|
|
if (FreeMB < {#NeedSize} ) then
|
|
begin
|
|
LeftSpace.Caption := MbOrTb2(FreeMB - {#NeedSize})+' ('+ NumToStr( Longint(FreeMB-{#NeedSize})*100/TotalMB) + '.' + NumToStr( -(Longint(FreeMB-{#NeedSize})*10000/TotalMB) mod 100 ) +'%)';
|
|
LeftSpace.Font.Color := clred
|
|
end else begin
|
|
LeftSpace.Font.Color := {#Col};
|
|
LeftSpace.Caption := MbOrTb(FreeMB-{#NeedSize})+' ('+(NumtoStr( (FreeMB-{#NeedSize})*100.0/TotalMB) )+'%)';
|
|
end;
|
|
UpdateStateCompare(ReadyPage.Compares[4],FreeMB,{#NEEDSIZE});
|
|
end;
|
|
|
|
procedure SidePnlUp(Sender :TOBject);
|
|
begin
|
|
SidePnl2.Show;
|
|
end;
|
|
|
|
procedure SidePnlDown(Sender :TOBject);
|
|
begin
|
|
SidePnl2.Hide;
|
|
end;
|
|
|
|
procedure SidePnlOperate(Sender :TObject);
|
|
begin
|
|
GetCursorPos(CurPoint);
|
|
if ( (CurPoint.x > WizardForm.Left) and (CurPoint.y > WizardForm.Top) ) then
|
|
begin
|
|
if ( (CurPoint.x - WizardForm.Left <= 56) ) then
|
|
SidePnl2.Show
|
|
else if ( CurPoint.x - WizardForm.Left >= 256 ) then
|
|
SidePnl2.Hide
|
|
end else
|
|
SidePnl2.Hide;
|
|
ImgApplyChanges(WizardForm.handle);
|
|
end;
|
|
|
|
procedure SidePnlOnMouse(Sender: TObject; Shift: TShiftState; X, Y: Integer);
|
|
begin
|
|
SidePnl.Width := SidePnl.Width + 200;
|
|
WizardForm.Repaint;
|
|
end;
|
|
|
|
procedure MetroUiHide;
|
|
var g: Integer;
|
|
begin
|
|
WelcomeUi.Base.Hide;
|
|
ConfigUi.Base.Hide;
|
|
InfoUi.Base.Hide;
|
|
for g := 0 to 3 do
|
|
SysCheckPage[g].Base.Hide;
|
|
SideBtnVisibility(HomeSideBtn,False);
|
|
SideBtnVisibility(OptionSideBtn,False);
|
|
SideBtnVisibility(InfoSideBtn,False);
|
|
SideBtnVisibility(SysSideBtn,False);
|
|
ImgApplyChanges(WizardForm.Handle);
|
|
end;
|
|
|
|
procedure MetroUiShow;
|
|
var g:Integer;
|
|
begin
|
|
WelcomeUi.Base.Show;
|
|
ConfigUi.Base.Hide;
|
|
InfoUi.Base.Hide;
|
|
for g := 0 to 3 do
|
|
SysCheckPage[g].Base.Hide;
|
|
SideBtnVisibility(HomeSideBtn,TRUE);
|
|
SideBtnVisibility(OptionSideBtn,TRUE);
|
|
SideBtnVisibility(InfoSideBtn,TRUE);
|
|
SideBtnVisibility(SysSideBtn,TRUE);
|
|
end;
|
|
|
|
procedure SystemPageShow(Sender :TObject);
|
|
begin
|
|
AllSidebtnDisable;
|
|
MetroUiPageHide;
|
|
SideBtnClick(SysSideBtn);
|
|
SysCheckPage[ProcessorCheckpage].Base.Show;
|
|
end;
|
|
|
|
procedure WelcomeUiCreate;
|
|
begin
|
|
with WelcomeUi do
|
|
begin
|
|
Base := TListView.Create(WizardForm);
|
|
with Base do
|
|
begin
|
|
SetBounds(0,32,854,480);
|
|
Parent := WizardForm;
|
|
Color := WizardForm.Color;
|
|
BorderStyle := bsNone;
|
|
Createlabel(Base,False,False,0,0,Width,Height,0,0,'',taLeftJustify);
|
|
end;
|
|
ImgLoad(Base.Handle,'{#BackGround}',0,0,854,480,true,true);
|
|
#ifdef DARK
|
|
ImgLoad(Base.Handle,'DARK.PNG',0,0,854,480,true,true);
|
|
#endif
|
|
{Coordinates Are Taken From ASC and are Comparative to Wizardform}
|
|
PageTitle := Createlabel(Base,false,false,80-Base.Left,48-Base.Top,498,42,18,clwhite,'Home',allign);
|
|
PageTitle.Font.Name := 'Segoe Ui SemiBold';
|
|
PageTitle.Layout := tlCenter;
|
|
|
|
LeftUiLabl := CreateUiLabl(Base,80-Base.Left,86-Base.Top,498,42,12,2,clwhite,'WELCOME','Welcome to {#AppName} setup wizard' +#13+
|
|
'This will install {#AppName} on your computer');
|
|
BottomLeftUiLabl := CreateUiLabl(Base,80-Base.Left,196-Base.Top,498,42,12,2,clwhite,'GUIDE FOR INSTALLATION','Follow these guides to help installation run smoothly');
|
|
RightUiLabl := CreateUiLabl(Base,600-Base.Left,86-Base.Top,228,42,12,2,clwhite,'NAVIGATION','Use the sidebar on the left');
|
|
RightUiLabl.Sublabl.Font.style := {#UIfontStyles};
|
|
RightUiLabl.Sublabl.Font.Color := {#col};
|
|
BottomRightUiLabl := CreateUiLabl(Base,600-Base.Left,166-Base.Top,228,42,12,2,clwhite,'MORE','');
|
|
|
|
GuideLine := Createlabel(Base,false,false,100-Base.Left,268-Base.Top,478,181,10,{#Col},'Please turn off antivirus software during installation'+#13+
|
|
'If this is an online installation, please make sure you have internet',taLeftJustify);
|
|
GuideLine.Font.Style := {#UIfontStyles};
|
|
|
|
Extra1 := TLabel.Create(Base);
|
|
with Extra1 do
|
|
begin
|
|
Parent := Base;
|
|
SetBounds(600-Base.Left,210-Base.Top,228,30);
|
|
Caption := 'Check if PC supports this app';
|
|
with Font do
|
|
begin
|
|
Style := {#UIfontStyles};
|
|
Name := 'Segoe UI';
|
|
Size := 10;
|
|
Color := {#COL};
|
|
end;
|
|
OnCLick := @SystemPageShow;
|
|
end;
|
|
|
|
Extra2 := TLabel.Create(Base);
|
|
with Extra2 do
|
|
begin
|
|
Parent := Base;
|
|
SetBounds(600-Base.Left,230-Base.Top,228,30);
|
|
Caption := 'Start Installation';
|
|
with Font do
|
|
begin
|
|
Style := {#UIfontStyles};
|
|
Name := 'Segoe UI';
|
|
Size := 10;
|
|
Color := {#COL};
|
|
end;
|
|
OnClick := @MetroNextBtnClick;
|
|
end;
|
|
|
|
ImgApplyChanges(Base.Handle);
|
|
end;
|
|
end;
|
|
|
|
procedure InfoUiCreate;
|
|
begin
|
|
with InfoUi do
|
|
begin
|
|
Base := TListView.Create(WizardForm);
|
|
with Base do
|
|
begin
|
|
SetBounds(0,32,854,480);
|
|
Parent := WizardForm;
|
|
Color := WizardForm.Color;
|
|
BorderStyle := bsNone;
|
|
Createlabel(Base,False,False,0,0,Width,Height,0,0,'',taLeftJustify);
|
|
end;
|
|
|
|
#ifexist "Graphics\Background2.JPG"
|
|
ImgLoad(Base.Handle,'Background2.JPG',0,0,854,480,true,true);
|
|
#else
|
|
ImgLoad(Base.Handle,'{#BackGround}',0,0,854,480,true,true);
|
|
#endif
|
|
|
|
#ifdef DARK
|
|
ImgLoad(Base.Handle,'DARK.PNG',0,0,854,480,true,true);
|
|
#endif
|
|
|
|
{Coordinates Are Taken From ASC and are Comparative to Wizardform}
|
|
PageTitle := Createlabel(Base,false,false,80-Base.Left,48-Base.Top,498,42,18,clwhite,'Information',allign);
|
|
PageTitle.Font.Name := 'Segoe Ui SemiBold';
|
|
PageTitle.Layout := tlCenter;
|
|
|
|
LeftUiLabl := CreateUiLabl(Base,80-Base.Left,86-Base.Top,498,42,12,2,clwhite,'{#AppName}','');
|
|
|
|
BottomLeftUiLabl := CreateUiLabl(Base,80-Base.Left,326-Base.Top,498,42,12,2,clwhite,'PACKAGE','{#PACKAGEDESCRIPTION}');
|
|
|
|
RightUiLabl := CreateUiLabl(Base,600-Base.Left,86-Base.Top,228,42,12,2,clwhite,'OTHER','Genre: {#GAMEGENRE}' +#13+'Rating: {#GAMERATING}');
|
|
RightUiLabl.Sublabl.Font.style := {#UIfontStyles};
|
|
RightUiLabl.Sublabl.Font.Color := {#col};
|
|
|
|
BottomRightUiLabl := CreateUiLabl(Base,600-Base.Left,166-Base.Top,228,42,12,2,clwhite,'MORE','');
|
|
|
|
with WizardForm.InfoBeforeMemo do
|
|
begin
|
|
Parent := Base;
|
|
SetBounds(80-Base.Left,130-Base.Top,498,200);
|
|
ExtractTemporaryFile('{#GameInfoFile}');
|
|
Lines.LoadFromFile(ExpandConstant('{tmp}\{#GameInfoFile}'));
|
|
Color := $00171616;
|
|
with Font do
|
|
Begin
|
|
Name := 'Segoe Ui';
|
|
Color := {#Col};
|
|
end;
|
|
BorderStyle := bsNone;
|
|
Show;
|
|
end;
|
|
|
|
Extra1 := TLabel.Create(Base);
|
|
with Extra1 do
|
|
begin
|
|
Parent := Base;
|
|
SetBounds(600-Base.Left,210-Base.Top,228,30);
|
|
Caption := 'Check if PC supports this app';
|
|
with Font do
|
|
begin
|
|
Style := {#UIfontStyles};
|
|
Name := 'Segoe UI';
|
|
Size := 10;
|
|
Color := {#COL};
|
|
end;
|
|
OnCLick := @SystemPageShow;
|
|
end;
|
|
|
|
Extra2 := TLabel.Create(Base);
|
|
with Extra2 do
|
|
begin
|
|
Parent := Base;
|
|
SetBounds(600-Base.Left,230-Base.Top,228,30);
|
|
Caption := 'Start Installation';
|
|
with Font do
|
|
begin
|
|
Style := {#UIfontStyles};
|
|
Name := 'Segoe UI';
|
|
Size := 10;
|
|
Color := {#COL};
|
|
end;
|
|
OnClick := @MetroNextBtnClick;
|
|
end;
|
|
ImgApplyChanges(Base.Handle);
|
|
end;
|
|
|
|
end;
|
|
|
|
procedure ConfigUiCreate;
|
|
begin
|
|
with ConfigUi do
|
|
begin
|
|
Base := TListView.Create(WizardForm);
|
|
with Base do
|
|
begin
|
|
SetBounds(0,32,854,480);
|
|
Parent := WizardForm;
|
|
Color := WizardForm.Color;
|
|
BorderStyle := bsNone;
|
|
Createlabel(Base,False,False,0,0,Width,Height,0,0,'',taLeftJustify);
|
|
end;
|
|
#ifexist "Graphics\Background3.JPG"
|
|
ImgLoad(Base.Handle,'Background3.JPG',0,0,854,480,true,true);
|
|
#else
|
|
ImgLoad(Base.Handle,'{#BackGround}',0,0,854,480,true,true);
|
|
#endif
|
|
#ifdef DARK
|
|
ImgLoad(Base.Handle,'DARK.PNG',0,0,854,480,true,true);
|
|
#endif
|
|
{Coordinates Are Taken From ASC and are Comparative to Wizardform}
|
|
PageTitle := Createlabel(Base,false,false,80-Base.Left,48-Base.Top,498,42,18,clwhite,'Configuration',allign);
|
|
PageTitle.Font.Name := 'Segoe Ui SemiBold';
|
|
PageTitle.Layout := tlCenter;
|
|
|
|
LeftUiLabl := CreateUiLabl(Base,80-Base.Left,86-Base.Top,498,42,12,2,clwhite,'INSTALLATION PATH','{#AppName} will be installed in:');
|
|
BottomLeftUiLabl := CreateUiLabl(Base,80-Base.Left,196-Base.Top,498,42,12,2,clwhite,'SELECTED PATH DETAILS','');
|
|
RightUiLabl := CreateUiLabl(Base,600-Base.Left,86-Base.Top,228,42,12,2,clwhite,'TIPS','Make sure you have enough space');
|
|
RightUiLabl.Sublabl.Font.Style := {#UIfontStyles}
|
|
RightUiLabl.Sublabl.Font.Color := {#Col};
|
|
DirEdt := CreateEdt(Base,100-Base.Left,160-Base.Top,478,30,10,2,20,'browse',clWhite,$00171616,{#Col});
|
|
DirEdt.text.Caption := WizardDirValue;
|
|
DirEdt.base.Show;
|
|
|
|
FreeSpaceTitle := Createlabel(Base,false,false,80-Base.Left,250-Base.Top,498,30,12,clwhite,'Free Space',taLeftJustify);
|
|
FreeSpace := Createlabel(Base,false,false,100-Base.Left,280-Base.Top,478,30,12,clwhite,'Free Space',taLeftJustify);
|
|
FreeSpace.Font.Color := {#col};
|
|
FreeSpace.Font.Style := {#UIfontStyles};
|
|
NeedSpaceTitle := Createlabel(Base,false,false,80-Base.Left,310-Base.Top,498,30,12,clwhite,'Needed Space',taLeftJustify);
|
|
NeedSpace := Createlabel(Base,false,false,100-Base.Left,340-Base.Top,478,30,12,clwhite,'Free Space',taLeftJustify)
|
|
NeedSpace.Font.Color := {#col};
|
|
NeedSpace.Font.Style := {#UIfontStyles};
|
|
TotalSpaceTitle := Createlabel(Base,false,false,80-Base.Left+260,250-Base.Top,498,30,12,clwhite,'Total Space',taLeftJustify);
|
|
TotalSpace := Createlabel(Base,false,false,100-Base.Left+260,280-Base.Top,478,30,12,clwhite,'Total Space',taLeftJustify)
|
|
TotalSpace.Font.Color := {#col};
|
|
TotalSpace.Font.Style := {#UIfontStyles};
|
|
LeftSpaceTitle := Createlabel(Base,false,false,80-Base.Left+260,310-Base.Top,498,30,12,clwhite,'Space After Installation',taLeftJustify);
|
|
LeftSpace := Createlabel(Base,false,false,100-Base.Left+260,340-Base.Top,478,30,12,clwhite,'Left Space',taLeftJustify)
|
|
LeftSpace.Font.Color := {#col};
|
|
LeftSpace.Font.Style := {#UIfontStyles};
|
|
|
|
ImgApplyChanges(Base.Handle);
|
|
end;
|
|
end;
|
|
|
|
procedure SysChange(Sender :TObject);
|
|
begin
|
|
MetroUiPageHide;
|
|
case TPanel(Sender).Caption of
|
|
{#MemoryBtnCaption}:
|
|
begin
|
|
SysCheckPage[MemoryCheckpage].Base.Show;
|
|
end;
|
|
{#GraphicBtnCaption}:
|
|
begin
|
|
SysCheckPage[GraphicCheckPage].Base.Show;
|
|
end;
|
|
{#WindowBtnCaption}:
|
|
begin
|
|
SysCheckPage[WindowCheckPage].Base.Show;
|
|
end;
|
|
{#ProcessorBtnCaption}:
|
|
begin
|
|
SysCheckPage[ProcessorCheckpage].Base.Show;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
function SekeletonSyspage(hPagetitle :String):TMetroUiSysPage;
|
|
begin
|
|
with result do
|
|
begin
|
|
Base := TListView.Create(WizardForm);
|
|
with Base do
|
|
begin
|
|
SetBounds(0,32,854,480);
|
|
Parent := WizardForm;
|
|
Color := WizardForm.Color;
|
|
BorderStyle := bsNone;
|
|
OnMouseDown := @WFMouseDown;
|
|
OnMouseup := @WFMouseup;
|
|
Createlabel(Base,False,False,0,0,Width,Height,0,0,'',taLeftJustify);
|
|
end;
|
|
|
|
#ifexist "Graphics\Background4.JPG"
|
|
ImgLoad(Base.Handle,'Background4.JPG',0,0,854,480,true,true);
|
|
#else
|
|
ImgLoad(Base.Handle,'{#BackGround}',0,0,854,480,true,true);
|
|
#endif
|
|
|
|
#ifdef DARK
|
|
ImgLoad(Base.Handle,'DARK.PNG',0,0,854,480,true,true);
|
|
#endif
|
|
{Coordinates Are Taken From ASC and are Comparative to Wizardform}
|
|
PageTitle := Createlabel(Base,false,false,80-Base.Left,48-Base.Top,498,42,18,clwhite,hPagetitle,allign);
|
|
PageTitle.Font.Name := 'Segoe Ui SemiBold';
|
|
PageTitle.Layout := tlCenter;
|
|
|
|
SetArrayLength(UiLabl,5);
|
|
UiLabl[0] := CreateUiLabl(Base,80-Base.Left,86-Base.Top,238,42,12,2,clwhite,'REQUIRED','');
|
|
UiLabl[1] := CreateUiLabl(Base,340-Base.Left,86-Base.Top,238,42,12,2,clwhite,'YOUR SYSTEM','');
|
|
UiLabl[2] := CreateUiLabl(Base,600-Base.Left,86-Base.Top,238,42,12,2,clwhite,'MORE','');
|
|
UiLabl[3] := CreateUiLabl(Base,80-Base.Left,246-Base.Top,498,42,12,2,clwhite,'VERDICT','');
|
|
UiLabl[4] := CreateUiLabl(Base,80-Base.Left,316-Base.Top,498,42,12,2,clwhite,'OTHER COMPONENT','');
|
|
|
|
LeftBtn := ButtonCreate(Base,258-Base.Left,370-Base.Top,100,32,2,{#Col},$00171616,'',mrNone);
|
|
MidBtn := ButtonCreate(Base,368-Base.Left,370-Base.Top,100,32,2,{#Col},$00171616,'',mrNone);
|
|
RightBtn := ButtonCreate(Base,478-Base.Left,370-Base.Top,100,32,2,{#Col},$00171616,'',mrNone);
|
|
MetroBtnEvent(LeftBtn,@SysChange);
|
|
MetroBtnEvent(MidBtn,@SysChange);
|
|
MetroBtnEvent(RightBtn,@SysChange);
|
|
|
|
|
|
LeftTitle := Createlabel(Base,false,false,80-Base.Left,130-Base.Top,238,30,12,clwhite,'',taLeftJustify);
|
|
Left := Createlabel(Base,false,false,100-Base.Left,160-Base.Top,218,30,12,{#Col},'',taLeftJustify);
|
|
Left.Font.Style := {#UIfontStyles};
|
|
|
|
BottomLeftTitle := Createlabel(Base,false,false,80-Base.Left,190-Base.Top,238,30,12,clwhite,'',taLeftJustify);
|
|
BottomLeft := Createlabel(Base,false,false,100-Base.Left,220-Base.Top,218,30,12,{#Col},'',taLeftJustify);
|
|
BottomLeft.Font.Style := {#UIfontStyles};
|
|
|
|
RightTitle := Createlabel(Base,false,false,340-Base.Left,130-Base.Top,238,30,12,clwhite,'',taLeftJustify);
|
|
Right := Createlabel(Base,false,false,360-Base.Left,160-Base.Top,218,30,12,{#Col},'',taLeftJustify);
|
|
Right.Font.Style := {#UIfontStyles};
|
|
|
|
BottomRightTitle := Createlabel(Base,false,false,340-Base.Left,190-Base.Top,238,30,12,clwhite,'',taLeftJustify);
|
|
BottomRight := Createlabel(Base,false,false,360-Base.Left,220-Base.Top,218,30,12,{#Col},'',taLeftJustify);
|
|
BottomRight.Font.Style := {#UIfontStyles};
|
|
|
|
LeftTitle.Hide; Left.Hide; RightTitle.Hide; Right.Hide;
|
|
BottomLeftTitle.Hide; BottomLeft.Hide; BottomRightTitle.Hide; BottomRight.Hide;
|
|
|
|
Verdict := CreatePB(Base,80-Base.Left,295-Base.Top,498,25,2,2,$00171616,clwhite,{#Col});
|
|
CreatePanel(Verdict.Base,Round(Verdict.Base.Width/1.4)-2,0,6,Verdict.Base.Height,$00171616);
|
|
CreatePanel(Verdict.Base,Round(Verdict.Base.Width/1.4),0,2,Verdict.Base.Height,clwhite);
|
|
Border(Verdict.Base,2,clwhite)
|
|
|
|
Extra1 := TLabel.Create(Base);
|
|
with Extra1 do
|
|
begin
|
|
Parent := Base;
|
|
SetBounds(600-Base.Left,130-Base.Top,228,30);
|
|
Caption := 'Start Installation';
|
|
with Font do
|
|
begin
|
|
Style := {#UIfontStyles};
|
|
Name := 'Segoe UI';
|
|
Size := 10;
|
|
Color := {#COL};
|
|
end;
|
|
OnClick := @MetroNextBtnClick;
|
|
end;
|
|
|
|
ImgApplyChanges(Base.Handle);
|
|
end
|
|
end;
|
|
|
|
procedure SysUiCreate;
|
|
begin
|
|
SetArrayLength(SysCheckPage,4);
|
|
//---------------------------------------------------------------------------------------------
|
|
SysCheckPage[ProcessorCheckpage] := SekeletonSyspage('System requirements | Processor');
|
|
with SysCheckPage[ProcessorCheckpage] do
|
|
begin
|
|
LeftTitle.Show; Left.Show; RightTitle.Show; Right.Show;
|
|
BottomLeftTitle.Show; BottomLeft.Show; BottomRightTitle.Show; BottomRight.Show;
|
|
RightTitle.Caption := 'Cores';
|
|
Right.Caption := IntToStr( GetCpuLogicalCores ) + ' Cores';
|
|
BottomRightTitle.Caption := 'Speed';
|
|
BottomRight.Caption := IntToStr( GetCpuCurrentClockSpeed ) + ' MHz';
|
|
LeftTitle.Caption := 'Cores';
|
|
Left.Caption := '{#CPUCores} Cores';
|
|
BottomLeftTitle.Caption := 'Speed';
|
|
BottomLeft.Caption := '{#CPUSpeed} MHz';
|
|
PBSetProgressEx(Verdict,GetCpuCurrentClockSpeed*GetCpuLogicalCores,{#CPUCores}*{#CpuSpeed}*1.4);
|
|
MetroBtnCaption(LeftBtn,{#MemoryBtnCaption});
|
|
MetroBtnCaption(MidBtn,{#GraphicBtnCaption});
|
|
MetroBtnCaption(rightBtn,{#WindowBtnCaption});
|
|
end;
|
|
//---------------------------------------------------------------------------------------------
|
|
SysCheckPage[MemoryCheckpage] := SekeletonSyspage('System requirements | Memory');
|
|
with SysCheckPage[MemoryCheckpage] do
|
|
begin
|
|
LeftTitle.Show; Left.Show; RightTitle.Show; Right.Show;
|
|
RightTitle.Caption := 'Size';
|
|
Right.Caption := IntToStr( GetTotalVisibleMemory ) + ' MB';
|
|
LeftTitle.Caption := 'Size';
|
|
Left.Caption := '{#RAMSIZE} MB';
|
|
PBSetProgressEx(Verdict,GetTotalVisibleMemory,{#RAMSIZE}*1.4);
|
|
MetroBtnCaption(LeftBtn,{#ProcessorBtnCaption});
|
|
MetroBtnCaption(MidBtn,{#GraphicBtnCaption});
|
|
MetroBtnCaption(rightBtn,{#WindowBtnCaption})
|
|
end;
|
|
//---------------------------------------------------------------------------------------------
|
|
SysCheckPage[GraphicCheckPage] := SekeletonSyspage('System requirements | Graphics');
|
|
with SysCheckPage[GraphicCheckPage] do
|
|
begin
|
|
LeftTitle.Show; Left.Show; RightTitle.Show; Right.Show;
|
|
BottomLeftTitle.Show; BottomLeft.Show; BottomRightTitle.Show; BottomRight.Show;
|
|
RightTitle.Caption := 'Size';
|
|
Right.Caption := IntToStr( GetGpuVRam ) + ' MB';
|
|
BottomRightTitle.Caption := 'DirectX';
|
|
BottomRight.Caption := (string(GetDirectXVersion( Dx_Gpu )));
|
|
LeftTitle.Caption := 'Size';
|
|
Left.Caption := '{#GPUSize} MB';
|
|
BottomLeftTitle.Caption := 'DirectX';
|
|
BottomLeft.Caption := '{#GPUDX}';
|
|
PBSetProgressEx(Verdict,GetGpuVRam,{#GPUSize}*1.4);
|
|
MetroBtnCaption(LeftBtn,{#MemoryBtnCaption});
|
|
MetroBtnCaption(MidBtn,{#ProcessorBtnCaption});
|
|
MetroBtnCaption(rightBtn,{#WindowBtnCaption});
|
|
end;
|
|
//---------------------------------------------------------------------------------------------
|
|
SysCheckPage[WindowCheckPage] := SekeletonSyspage('System requirements | Windows');
|
|
with SysCheckPage[WindowCheckPage] do
|
|
begin
|
|
LeftTitle.Show; Left.Show; RightTitle.Show; Right.Show;
|
|
BottomLeftTitle.Show; BottomLeft.Show; BottomRightTitle.Show; BottomRight.Show;
|
|
RightTitle.Caption := 'Version';
|
|
Right.Caption := InttoStr(GetOSVersionMajor);
|
|
BottomRightTitle.Caption := 'Build';
|
|
BottomRight.Caption := (IntTostr(GetOSBuildNumbers));
|
|
LeftTitle.Caption := 'Version';
|
|
Left.Caption := '{#OSVersion}';
|
|
BottomLeftTitle.Caption := 'Build';
|
|
BottomLeft.Caption := '{#OSBuild}';
|
|
PBSetProgressEx(Verdict,GetOSBuildNumbers*GetOSVersionMajor,{#OSVersion}*{#OSBuild}*1.4);
|
|
MetroBtnCaption(LeftBtn,{#MemoryBtnCaption});
|
|
MetroBtnCaption(MidBtn,{#GraphicBtnCaption});
|
|
MetroBtnCaption(rightBtn,{#ProcessorBtnCaption});
|
|
end;
|
|
//---------------------------------------------------------------------------------------------
|
|
end;
|
|
|
|
procedure CheckBtnClicks(Sender :TObject);
|
|
begin
|
|
case TPanel(Sender) of
|
|
ReadyPage.Btns[0].Base: begin
|
|
WizardForm.BackButton.Click;
|
|
SysCheckPage[ProcessorCheckpage].Base.Show;
|
|
AllSidebtnDisable;
|
|
SideBtnClick(SysSideBtn);
|
|
end;
|
|
ReadyPage.Btns[1].Base: begin
|
|
WizardForm.BackButton.Click;
|
|
SysCheckPage[MemoryCheckpage].Base.Show;
|
|
AllSidebtnDisable;
|
|
SideBtnClick(SysSideBtn);
|
|
end;
|
|
ReadyPage.Btns[2].Base: begin
|
|
WizardForm.BackButton.Click;
|
|
SysCheckPage[GraphicCheckPage].Base.Show;
|
|
AllSidebtnDisable;
|
|
SideBtnClick(SysSideBtn);
|
|
end;
|
|
ReadyPage.Btns[3].Base: begin
|
|
WizardForm.BackButton.Click;
|
|
SysCheckPage[WindowCheckPage].Base.Show;
|
|
AllSidebtnDisable;
|
|
SideBtnClick(SysSideBtn);
|
|
end;
|
|
ReadyPage.Btns[4].Base: begin
|
|
WizardForm.BackButton.Click;
|
|
ConfigUi.Base.Show;
|
|
AllSidebtnDisable;
|
|
SideBtnClick(OptionSideBtn);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
procedure ReadyUiCreate;
|
|
var g, cleft,ctop,lleft,ltop:integer;
|
|
begin
|
|
with ReadyPage do
|
|
begin
|
|
Base := TListView.Create(WizardForm);
|
|
with Base do
|
|
begin
|
|
SetBounds(0,32,854,480);
|
|
Parent := WizardForm;
|
|
Color := WizardForm.Color;
|
|
BorderStyle := bsNone;
|
|
Createlabel(Base,False,False,0,0,Width,Height,0,0,'',taLeftJustify);
|
|
end;
|
|
#ifexist "Graphics\Background2.JPG"
|
|
ImgLoad(Base.Handle,'Background2.JPG',0,0,854,480,true,true);
|
|
#else
|
|
ImgLoad(Base.Handle,'{#BackGround}',0,0,854,480,true,true);
|
|
#endif
|
|
#ifdef DARK
|
|
ImgLoad(Base.Handle,'DARK.PNG',0,0,854,480,true,true);
|
|
#endif
|
|
{Coordinates Are Taken From ASC and are Comparative to Wizardform}
|
|
PageTitle := Createlabel(Base,false,false,80-Base.Left,48-Base.Top,498,42,18,clwhite,'Review',allign);
|
|
PageTitle.Font.Name := 'Segoe Ui SemiBold';
|
|
PageTitle.Layout := tlCenter;
|
|
|
|
LeftUiLabl := CreateUiLabl(Base,80-Base.Left,86-Base.Top,498,42,12,2,clwhite,'SYSTEM COMPONENTS','');
|
|
BottomLeftUiLabl := CreateUiLabl(Base,80-Base.Left,250-Base.Top,498,42,12,2,clwhite,'INSTALLATION LOCATION','');
|
|
RightUiLabl := CreateUiLabl(Base,600-Base.Left,86-Base.Top,228,42,12,2,clwhite,'TIPS','Start Installation');
|
|
RightUiLabl.Sublabl.Font.style := {#UIfontStyles};
|
|
RightUiLabl.Sublabl.Font.Color := {#col};
|
|
|
|
SetArrayLength(ComponentLabl,5);
|
|
SetArrayLength(Btns,5);
|
|
SetArrayLength(Compares,5);
|
|
lleft := 80;
|
|
ltop := 130
|
|
cleft := 492;
|
|
ctop := 134;
|
|
|
|
for g := 0 to 3 do
|
|
begin
|
|
ComponentLabl[g] := Createlabel(Base,false,false,lleft-Base.Left,ltop-Base.top,408,30,10,clwhite,'',taLeftJustify);
|
|
ComponentLabl[g].Layout := tlCenter;
|
|
Compares[g] := CreateStateCompare(Base.Handle,cleft-Base.Left,ctop-Base.Top,22,22,'tick.png','tick.png','cross.png');
|
|
Btns[g] := ButtonCreate(Base,cleft+22-Base.left+4,ctop-Base.Top,60,22,1,{#Col},$001F1F1F,'Check',mrNone);
|
|
MetroBtnEvent(Btns[g],@CheckBtnClicks);
|
|
ltop := ltop + 30;
|
|
ctop := ctop + 30;
|
|
end;
|
|
|
|
UpdateStateCompare(Compares[0],GetCpuCurrentClockSpeed*GetCpuLogicalCores,{#CPUCores}*{#CpuSpeed});
|
|
UpdateStateCompare(Compares[1],GetTotalVisibleMemory,{#RAMSIZE});
|
|
UpdateStateCompare(Compares[2],GetGpuVRam,{#GPUSize});
|
|
UpdateStateCompare(Compares[3],GetOSBuildNumbers*GetOSVersionMajor,{#OSVersion}*{#OSBuild});
|
|
|
|
ComponentLabl[0].Caption := GetCpuName;
|
|
ComponentLabl[1].Caption := MbOrTb(GetTotalVisibleMemory) + ' system memory';
|
|
ComponentLabl[2].Caption := GetGpuName;
|
|
ComponentLabl[3].Caption := GetOSName + ' ( Build ' + InttoStr(GetOSBuildNumbers) + ' )' ;
|
|
|
|
ComponentLabl[4] := Createlabel(Base,false,false,80-Base.Left,295-Base.top,408,30,10,clwhite,WizardDirValue,taLeftJustify);
|
|
ComponentLabl[4].Layout := tlCenter;
|
|
Btns[4] := ButtonCreate(Base,518-Base.Left,300-Base.Top,60,22,1,{#Col},$001F1F1F,'Change',mrNone);
|
|
Compares[4] := CreateStateCompare(Base.Handle,492-Base.Left,300-Base.Top,22,22,'tick.png','tick.png','cross.png');
|
|
UpdateStateCompare(Compares[4],GetVolumeFreeSpace(ExtractFileDrive(WizardDirValue),TF_InMegaBytes),{#NEEDSIZE});
|
|
MetroBtnEvent(Btns[4],@CheckBtnClicks);
|
|
|
|
Extra1 := TLabel.Create(Base);
|
|
with Extra1 do
|
|
begin
|
|
Parent := Base;
|
|
SetBounds(600-Base.Left,130-Base.Top,228,30);
|
|
Caption := 'Start Installation';
|
|
with Font do
|
|
begin
|
|
Style := {#UIfontStyles};
|
|
Name := 'Segoe UI';
|
|
Size := 10;
|
|
Color := {#COL};
|
|
end;
|
|
OnClick := @MetroNextBtnClick;
|
|
end;
|
|
|
|
ImgApplyChanges(Base.Handle);
|
|
end;
|
|
end;
|
|
|
|
procedure InstallUiCreate;
|
|
var g:Integer;
|
|
begin
|
|
with InstallPage do
|
|
begin
|
|
Base := TListView.Create(WizardForm);
|
|
with Base do
|
|
begin
|
|
SetBounds(0,32,854,480);
|
|
Parent := WizardForm;
|
|
Color := WizardForm.Color;
|
|
BorderStyle := bsNone;
|
|
Createlabel(Base,False,False,0,0,Width,Height,0,0,'',taLeftJustify);
|
|
end;
|
|
#ifexist "Graphics\Background3.JPG"
|
|
ImgLoad(Base.Handle,'Background3.JPG',0,0,854,480,true,true);
|
|
#else
|
|
ImgLoad(Base.Handle,'{#BackGround}',0,0,854,480,true,true);
|
|
#endif
|
|
#ifdef DARK
|
|
ImgLoad(Base.Handle,'DARK.PNG',0,0,854,480,true,true);
|
|
#endif
|
|
{Coordinates Are Taken From ASC and are Comparative to Wizardform}
|
|
PageTitle := Createlabel(Base,false,false,80-Base.Left,48-Base.Top,498,42,18,clwhite,'Installation',allign);
|
|
PageTitle.Font.Name := 'Segoe Ui SemiBold';
|
|
PageTitle.Layout := tlCenter;
|
|
|
|
LeftUiLabl := CreateUiLabl(Base,80-Base.Left,86-Base.Top,498,42,12,2,clwhite,'PROGRESS','');
|
|
BottomLeftUiLabl := CreateUiLabl(Base,80-Base.Left,161-Base.Top,498,42,12,2,clwhite,'STATISTICS','');
|
|
RightUiLabl := CreateUiLabl(Base,600-Base.Left,86-Base.Top,228,42,12,2,clwhite,'TIPS','Please wait while app is installed');
|
|
RightUiLabl.Sublabl.Font.style := {#UIfontStyles};
|
|
RightUiLabl.Sublabl.Font.Color := {#col};
|
|
BottomRightUiLabl := CreateUiLabl(Base,600-Base.Left,161-Base.Top,228,42,12,2,clwhite,'MORE','');
|
|
|
|
ProgressBar := CreatePB(Base,80-Base.Left,135-Base.Top,498,25,2,2,$00171616,clwhite,{#Col});
|
|
|
|
SetArrayLength(StatTitles,5);
|
|
StatTitles[0] := Createlabel(Base,false,false,080-Base.Left,205-Base.Top,238,30,12,clwhite,'Elapsed time',taLeftJustify);
|
|
StatTitles[1] := Createlabel(Base,false,false,080-Base.Left,265-Base.Top,238,30,12,clwhite,'Estimated Time',taLeftJustify);
|
|
StatTitles[2] := Createlabel(Base,false,false,340-Base.Left,205-Base.Top,238,30,12,clwhite,'Remaining Time',taLeftJustify);
|
|
StatTitles[3] := Createlabel(Base,false,false,340-Base.Left,265-Base.Top,238,30,12,clwhite,'Transfer Rate',taLeftJustify);
|
|
StatTitles[4] := Createlabel(Base,false,false,080-Base.Left,325-Base.Top,238,30,12,clwhite,'File',taLeftJustify);
|
|
|
|
SetArrayLength(StatLabls,5);
|
|
StatLabls[0] := Createlabel(Base,false,false,100-Base.Left,235-Base.Top,218,30,12,{#Col},'Elapsed time',taLeftJustify);
|
|
StatLabls[1] := Createlabel(Base,false,false,100-Base.Left,295-Base.Top,218,30,12,{#Col},'Estimated Time',taLeftJustify);
|
|
StatLabls[2] := Createlabel(Base,false,false,360-Base.Left,235-Base.Top,218,30,12,{#Col},'Remaining Time',taLeftJustify);
|
|
StatLabls[3] := Createlabel(Base,false,false,360-Base.Left,295-Base.Top,218,30,12,{#Col},'Transfer Rate',taLeftJustify);
|
|
StatLabls[4] := Createlabel(Base,false,false,100-Base.Left,355-Base.Top,468,30,12,{#Col},'File',taLeftJustify);
|
|
for g:= 0 to 4 do
|
|
StatLabls[g].Font.Style := {#UIfontStyles};
|
|
|
|
SetArrayLength(MonitorLabls,3);
|
|
MonitorLabls[0] := Createlabel(Base,false,false,600-Base.Left,205-Base.Top,228,30,12,{#Col},'CPU Usage',taLeftJustify);
|
|
MonitorLabls[1] := Createlabel(Base,false,false,600-Base.Left,235-Base.Top,228,30,12,{#Col},'',taLeftJustify);
|
|
MonitorLabls[2] := Createlabel(Base,false,false,600-Base.Left,265-Base.Top,228,30,12,{#Col},' Disk Free Space',taLeftJustify);
|
|
for g:= 0 to 2 do
|
|
MonitorLabls[g].Font.Style := {#UIfontStyles};
|
|
|
|
ImgApplyChanges(Base.Handle);
|
|
end;
|
|
end;
|
|
|
|
procedure FinishUiCreate;
|
|
begin
|
|
with FinishPage do
|
|
begin
|
|
Base := TListView.Create(WizardForm);
|
|
with Base do
|
|
begin
|
|
SetBounds(0,32,854,480);
|
|
Parent := WizardForm;
|
|
Color := WizardForm.Color;
|
|
BorderStyle := bsNone;
|
|
Createlabel(Base,False,False,0,0,Width,Height,0,0,'',taLeftJustify);
|
|
end;
|
|
#ifexist "Graphics\Background4.JPG"
|
|
ImgLoad(Base.Handle,'Background4.JPG',0,0,854,480,true,true);
|
|
#else
|
|
ImgLoad(Base.Handle,'{#BackGround}',0,0,854,480,true,true);
|
|
#endif
|
|
#ifdef DARK
|
|
ImgLoad(Base.Handle,'DARK.PNG',0,0,854,480,true,true);
|
|
#endif
|
|
{Coordinates Are Taken From ASC and are Comparative to Wizardform}
|
|
PageTitle := Createlabel(Base,false,false,80-Base.Left,48-Base.Top,698,42,18,clwhite,'Finish',allign);
|
|
PageTitle.Font.Name := 'Segoe Ui SemiBold';
|
|
PageTitle.Layout := tlCenter;
|
|
|
|
LeftUiLabl := CreateUiLabl(Base,80-Base.Left,86-Base.Top,698,42,12,2,clwhite,'COMPLETING SETUP','{#AppName} has been installed successfully' +#13+
|
|
'Click Finish to close setup wizard');
|
|
|
|
BottomLeftUiLabl := CreateUiLabl(Base,80-Base.Left,196-Base.Top,698,42,12,2,clwhite,'GUIDE FOR APPLICATION','Follow these guides to help run {#AppName}');
|
|
GuideLineLabl := Createlabel(Base,false,false,100-Base.Left,268-Base.Top,678,181,10,{#Col},'You can now launch the application from your desktop'+#13+
|
|
'You can find another launcher under your startmenu'+#13+
|
|
'Use control panel programs and features to uninstall the application',taLeftJustify);
|
|
GuideLineLabl.Font.Style := {#UIfontStyles};
|
|
ImgApplyChanges(Base.Handle);
|
|
end;
|
|
end;
|
|
|
|
function isthatSideBtn(hSideBtn :TSideBtn; Compareto :TObject):Boolean;
|
|
begin
|
|
Result := false;
|
|
case Compareto of
|
|
hSideBtn.SidePnl: result := true;
|
|
hSideBtn.Labl1: result := true;
|
|
hSideBtn.Labl2: result := true;
|
|
end;
|
|
end;
|
|
|
|
procedure BtnClicks(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|
begin
|
|
AllSidebtnDisable;
|
|
MetroUiPageHide;
|
|
if isthatSideBtn(HomeSideBtn,Sender) then
|
|
begin
|
|
if not WelcomeUi.Base.Visible then
|
|
WelcomeUi.Base.Show;
|
|
SideBtnClick(HomeSideBtn);
|
|
end else
|
|
if isthatSideBtn(InfoSideBtn,Sender) then
|
|
begin
|
|
if not InfoUi.Base.Visible then
|
|
InfoUi.Base.Show;
|
|
SideBtnClick(InfoSideBtn);
|
|
end else
|
|
if isthatSideBtn(OptionSideBtn,Sender) then
|
|
begin
|
|
DirEdtChange(Sender)
|
|
if not ConfigUi.Base.Visible then;
|
|
ConfigUi.Base.Show;
|
|
SideBtnClick(OptionSideBtn);
|
|
end else
|
|
if isthatSideBtn(SysSideBtn,Sender) then
|
|
begin
|
|
if not SysCheckPage[0].Base.Visible then
|
|
SysCheckPage[0].Base.Show;
|
|
SideBtnClick(SysSideBtn);
|
|
end;
|
|
ImgApplyChanges(WizardForm.Handle);
|
|
end;
|
|
|
|
procedure SetupLang;
|
|
var g:Integer;
|
|
begin
|
|
#define public TotalLangs
|
|
#sub Dummy
|
|
#endsub
|
|
#for { TotalLangs = 0 ; FileExists( "Resources\Languages\" + StringChange( "LanguageCounter.txt", "Counter", str(TotalLangs+1)) ) ; TotalLangs++ } Dummy
|
|
SetArrayLength(Language,{#TotalLangs});
|
|
for g := 0 to GetArrayLength(Language)-1 do
|
|
ExtractTemporaryFile('Language'+IntToStr(g+1)+'.txt');
|
|
CurLang := 0;
|
|
end;
|
|
|
|
procedure LangUpdate;
|
|
var g:Integer;
|
|
begin
|
|
LanguageLabel.Caption := GetLangLabel('Language');
|
|
langNav.Caption := GetLangLabel('LanguageChange');
|
|
if WizardForm.CurPageID = wpWelcome then
|
|
begin
|
|
MetroNextBtn.base.Caption := GetLangLabel('ProceedBtn');
|
|
|
|
HomeSideBtn.Labl1.Caption := GetLangLabel('HomeLabel')
|
|
InfoSideBtn.Labl1.Caption := GetLangLabel('InfoLabel')
|
|
SysSideBtn.Labl1.Caption := GetLangLabel('SystemLabel')
|
|
OptionSideBtn.Labl1.Caption := GetLangLabel('ConfigLabel')
|
|
|
|
// if WelcomeUi.Base.Showing then
|
|
with WelcomeUi do
|
|
begin
|
|
Pagetitle.Caption := GetLangLabel('WelcomePageTitle');
|
|
GuideLine.Caption := GetLangLabel('Guide');
|
|
Extra1.Caption := GetLangLabel('SystemCheckNavigation');
|
|
Extra2.Caption := GetLangLabel('InstalltionNavigation');
|
|
UilablSetLabl(LeftUiLabl,GetLangLabel('WelcomeTitle'),GetLangLabel('WelcomeCaption'));
|
|
UilablSetLabl(BottomLeftUiLabl,GetLangLabel('GuideTitle'),GetLangLabel('GuideCaption'));
|
|
UilablSetLabl(RightUiLabl,GetLangLabel('NavigationTitle'),GetLangLabel('NavigationCaption'));
|
|
UilablSetLabl(BottomRightUiLabl,GetLangLabel('More'),'');
|
|
end;
|
|
// else if InfoUi.Base.Showing then
|
|
with InfoUi do
|
|
begin
|
|
Pagetitle.Caption := GetLangLabel('InfoPageTitle');
|
|
Extra1.Caption := GetLangLabel('SystemCheckNavigation');
|
|
Extra2.Caption := GetLangLabel('InstalltionNavigation');
|
|
UilablSetLabl(LeftUiLabl,GetLangLabel('InfoTitle'),'');
|
|
UilablSetLabl(BottomLeftUiLabl,GetLangLabel('PackageTitle'),GetLangLabel('PackageDescription'));
|
|
UilablSetLabl(RightUiLabl,GetLangLabel('Other'),GetLangLabel('OtherPackageDescription'));
|
|
UilablSetLabl(BottomRightUiLabl,GetLangLabel('More'),'');
|
|
FreeSpaceTitle.Caption := GetLangLabel('FreeSpace');
|
|
NeedSpaceTitle.Caption := GetLangLabel('NeedSpace');
|
|
TotalSpaceTitle.Caption := GetLangLabel('TotalSpace');
|
|
LeftSpaceTitle.Caption := GetLangLabel('AfterSpace')
|
|
end;
|
|
//else if ConfigUi.Base.Showing then
|
|
with ConfigUi do
|
|
begin
|
|
Pagetitle.Caption := GetLangLabel('ConfigPageTitle');
|
|
FreeSpace.Caption := GetLangLabel('FreeSpace');
|
|
NeedSpace.Caption := GetLangLabel('NeedSpace');
|
|
UilablSetLabl(LeftUiLabl,GetLangLabel('DirPath'),GetLangLabel('SelectDirlabel'));
|
|
UilablSetLabl(BottomLeftUiLabl,GetLangLabel('PathDetails'),(''));
|
|
UilablSetLabl(RightUiLabl,GetLangLabel('TipsCaption'),GetLangLabel('DirTip'));
|
|
DirEdtChange(WizardForm.DirBrowseButton);
|
|
end;
|
|
//else begin
|
|
for g:=0 to GetArrayLength(SysCheckPage)-1 do
|
|
with SysCheckPage[g] do
|
|
begin
|
|
UilablSetLabl(Uilabl[0],GetLangLabel('RequiredLabel'),'');
|
|
UilablSetLabl(Uilabl[1],GetLangLabel('YourSystemLabel'),'');
|
|
UilablSetLabl(Uilabl[2],GetLangLabel('MoreLabel'),'');
|
|
UilablSetLabl(Uilabl[3],GetLangLabel('VerdictLabel'),'');
|
|
UilablSetLabl(Uilabl[4],GetLangLabel('OtherComponentlabel'),'');
|
|
Extra1.Caption := GetLangLabel('SystemCheckNavigation');
|
|
end;
|
|
with SysCheckPage[ProcessorCheckPage] do
|
|
begin
|
|
MetroBtnCaption(LeftBtn,{#MemoryBtnCaption});
|
|
MetroBtnCaption(MidBtn,{#GraphicBtnCaption});
|
|
MetroBtnCaption(rightBtn,{#WindowBtnCaption});
|
|
Pagetitle.Caption := GetLangLabel('ProcessorPagelabel');
|
|
end;
|
|
with SysCheckPage[MemoryCheckpage] do
|
|
begin
|
|
MetroBtnCaption(LeftBtn,{#ProcessorBtnCaption});
|
|
MetroBtnCaption(MidBtn,{#GraphicBtnCaption});
|
|
MetroBtnCaption(rightBtn,{#WindowBtnCaption})
|
|
Pagetitle.Caption := GetLangLabel('MemoryPageLabel');
|
|
end;
|
|
with SysCheckPage[GraphicCheckPage] do
|
|
begin
|
|
MetroBtnCaption(LeftBtn,{#MemoryBtnCaption});
|
|
MetroBtnCaption(MidBtn,{#ProcessorBtnCaption});
|
|
MetroBtnCaption(rightBtn,{#WindowBtnCaption});
|
|
Pagetitle.Caption := GetLangLabel('GraphicPageLabel');
|
|
end;
|
|
with SysCheckPage[WindowCheckPage] do
|
|
begin
|
|
MetroBtnCaption(LeftBtn,{#MemoryBtnCaption});
|
|
MetroBtnCaption(MidBtn,{#GraphicBtnCaption});
|
|
MetroBtnCaption(rightBtn,{#ProcessorBtnCaption});
|
|
Pagetitle.Caption := GetLangLabel('WindowPageLabel');
|
|
end;
|
|
end else if WizardForm.CurPageID = wpReady then
|
|
with ReadyPage do
|
|
begin
|
|
NotesSideBtn.Labl1.Caption := GetLangLabel('ReadySideLabel');
|
|
MetroNextBtn.base.Caption := GetLangLabel('InstalBtn');
|
|
Pagetitle.Caption := GetLangLabel('ReadyPageLabel');
|
|
UilablSetLabl(LeftUiLabl,GetLangLabel('SysReviewLabel'),'');
|
|
UilablSetLabl(BottomLeftUiLabl,GetLangLabel('DirPathReviewTitle'),'');
|
|
UilablSetLabl(RightUiLabl,GetLangLabel('TipsCaption'),'');
|
|
for g:= 0 to GetArrayLength(Btns)-2 do
|
|
Btns[g].Base.Caption := GetLangLabel('CheckBtnLabel');
|
|
Btns[GetArrayLength(Btns)-1].base.Caption := GetLangLabel('BrowseBtn');
|
|
Extra1.Caption := GetLangLabel('InstalltionNavigation');
|
|
end
|
|
|
|
else if WizardForm.CurPageID = wpInstalling then
|
|
with InstallPage do
|
|
begin
|
|
InstallSideBtn.Labl1.Caption := GetLangLabel('InstallSideLabel');
|
|
MetroNextBtn.base.Caption := GetLangLabel('CancelBtn');
|
|
UiLablSetLabl(LeftUiLabl,GetLangLabel('ProgressLabel'),'');
|
|
UiLablSetLabl(BottomLeftUiLabl,GetLangLabel('StatsLabel'),'');
|
|
UiLablSetLabl(RightUiLabl,GetLangLabel('TipsCaption'),GetLangLabel('InstallationTip'));
|
|
UiLablSetLabl(BottomRightUiLabl,GetLangLabel('MoreLabel'),'');
|
|
StatTitles[0].Caption := GetLangLabel('Elapsedtime');
|
|
StatTitles[1].Caption := GetLangLabel('EstimatedTime');
|
|
StatTitles[2].Caption := GetLangLabel('RemainingTime');
|
|
StatTitles[3].Caption := GetLangLabel('TransferRate');
|
|
StatTitles[4].Caption := GetLangLabel('CurrFile');
|
|
PageTitle.Caption := GetLangLabel('InstallPagelabel');
|
|
end
|
|
|
|
else if WizardForm.CurPageID = wpFinished then
|
|
with FinishPage do
|
|
begin
|
|
FinishSideBtn.Labl1.Caption := GetLangLabel('FinishSideLabel');
|
|
MetroNextBtn.base.Caption := GetLangLabel('FinshBtn');
|
|
Pagetitle.Caption := GetLangLabel('FinishPageLabel');
|
|
GuideLineLabl.Caption := GetLangLabel('FinishedGuideLabel');
|
|
UilablSetLabl(LeftUiLabl,GetLangLabel('FinishHeadingLabel'),GetLangLabel('FinishedLabel'));
|
|
UilablSetLabl(BottomLeftUiLabl,GetLangLabel('FinishGuideHeading'),GetLangLabel('FinishGuideHint'));
|
|
end;
|
|
end;
|
|
|
|
procedure LangChange(Sender :TObject);
|
|
begin
|
|
if CurLang <> GetArrayLength(Language)-1 then
|
|
CurLang := CurLang + 1
|
|
else
|
|
Curlang := 0;
|
|
LangUpdate;
|
|
end;
|
|
|
|
procedure BASS_OnOffClick(Sender :TObject);
|
|
begin
|
|
if (_BASS_ChannelIsActive(Mp3Handle) = BASS_ACTIVE_PAUSED) then _BASS_ChannelPlay(Mp3Handle, False) else
|
|
_BASS_ChannelPause(Mp3Handle)
|
|
end;
|
|
|
|
procedure YesBtnClick(Sender :TObject);
|
|
begin
|
|
DialogForm.YesBtn.ModalBtn.Click;
|
|
end;
|
|
|
|
procedure NoBtnClick(Sender :TObject);
|
|
begin
|
|
DialogForm.NoBtn.ModalBtn.Click;
|
|
end;
|
|
|
|
procedure DFShow(Sender: TObject);
|
|
begin
|
|
with DialogForm do
|
|
begin
|
|
NotificationLabl.Caption := GetLangLabel('DialogMessage1'); //Notification
|
|
ResponseUiLabl.labl.Caption := GetLangLabel('DialogMessage2'); // Response
|
|
MessageUiLabl.labl.Caption := GetLangLabel('DialogMessage3'); // Response
|
|
YesBtn.base.Caption := GetLangLabel('YesBtn');
|
|
NoBtn.base.Caption := GetLangLabel('NoBtn');
|
|
end;
|
|
end;
|
|
|
|
procedure SetDialogMessage(dMessage :string);
|
|
begin
|
|
DialogForm.MessageUiLabl.Sublabl.Caption := GetLangLabel(dMessage);
|
|
end;
|
|
|
|
function ShowCancelBox:Integer;
|
|
begin
|
|
SetWindowPos(DialogForm.Form.Handle,0,(WizardForm.Left+(WizardForm.Width-DialogForm.Form.Width)/2),WizardForm.Top+(WizardForm.Height-DialogForm.Form.Height)/2,0,0,$515);
|
|
SetDialogMessage('SetupExit');
|
|
Result:= DialogForm.Form.ShowModal;
|
|
end;
|
|
|
|
function ChangeDisc(var FileName :String; findFile : Boolean):Boolean;
|
|
var str :string;
|
|
begin
|
|
SetWindowPos(DialogForm.Form.Handle,0,(WizardForm.Left+(WizardForm.Width-DialogForm.Form.Width)/2),WizardForm.Top+(WizardForm.Height-DialogForm.Form.Height)/2,0,0,$515);
|
|
FileName := ExpandConstant(FileName);
|
|
if not FileExists(FileName) then
|
|
begin
|
|
str := GetLangLabel('FileNotInDir');
|
|
StringChange(str,'<FileName>', ExtractFileName( Filename ) );
|
|
StringChange(str,'<FileDir>', ExtractFileDir( Filename ) );
|
|
DialogForm.MessageUiLabl.Sublabl.Caption := str;
|
|
if DialogForm.Form.ShowModal = mrYes then
|
|
Result := GetOpenFileName('',FileName,ExtractFilePath( FileName ),ExtractFileName(FileName)+ '|' + ExtractFileName(FileName),ExtractFileName(FileName))
|
|
else
|
|
result := false;
|
|
end else
|
|
Result := true;
|
|
end;
|
|
|
|
//
|
|
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
|
|
#if defined( MC )
|
|
var ResultCode :Integer;
|
|
#endif
|
|
begin
|
|
Confirm := false;
|
|
if ShowCancelBox = mryes then
|
|
Cancel := true
|
|
else
|
|
Cancel := false;
|
|
#if defined(MC)
|
|
if CurPageID = wpInstalling then
|
|
begin
|
|
SuspendProc;
|
|
if Cancel then
|
|
begin
|
|
ISDoneCancel:=1;
|
|
Exec(ExpandConstant('{sys}\taskkill.exe'), ' /F /IM pZLib.exe', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
|
|
Exec(ExpandConstant('{sys}\taskkill.exe'), ' /F /IM fazip.exe', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
|
|
end;
|
|
ResumeProc;
|
|
end;
|
|
#endif
|
|
end;
|
|
//
|
|
|
|
function InitializeSetup(): Boolean;
|
|
var
|
|
LangSelect, LangFile: string;
|
|
begin
|
|
if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then
|
|
ExtractTemporaryFile('botva2.dll');
|
|
if not FileExists(ExpandConstant('{tmp}\CallbackCtrl.dll')) then
|
|
ExtractTemporaryFile('CallbackCtrl.dll');
|
|
if not FileExists(ExpandConstant('{tmp}\InnoCallback.dll')) then
|
|
ExtractTemporaryFile('InnoCallback.dll');
|
|
if not FileExists(ExpandConstant('{tmp}\ISSysInfo.dll')) then
|
|
ExtractTemporaryFile('ISSysInfo.dll');
|
|
if not FileExists(ExpandConstant('{tmp}\Bass.dll')) then
|
|
ExtractTemporaryFile('Bass.dll');
|
|
|
|
LangSelect := '{#LangSetup}';
|
|
LangFile := ExpandConstant('{tmp}');
|
|
if LangSelect = 'English' then begin
|
|
ExtractTemporaryFile('English.txt');
|
|
FileCopy(LangFile +'\English.txt', LangFile +'\Language1.txt', false);
|
|
Application.ProcessMessages;
|
|
Sleep(150);
|
|
DeleteFile(LangFile +'\English.txt');
|
|
end;
|
|
if LangSelect = 'Hungarian' then begin
|
|
ExtractTemporaryFile('Hungarian.txt');
|
|
FileCopy(LangFile +'\Hungarian.txt', LangFile +'\Language1.txt', false);
|
|
Application.ProcessMessages;
|
|
Sleep(150);
|
|
DeleteFile(LangFile +'\Hungarian.txt');
|
|
end;
|
|
if LangSelect = 'French' then begin
|
|
ExtractTemporaryFile('French.txt');
|
|
FileCopy(LangFile +'\French.txt', LangFile +'\Language1.txt', false);
|
|
Application.ProcessMessages;
|
|
Sleep(150);
|
|
DeleteFile(LangFile +'\French.txt');
|
|
end;
|
|
|
|
#ifexist "Graphics\Music.mp3"
|
|
if not FileExists(ExpandConstant('{tmp}\Music.mp3')) then
|
|
ExtractTemporaryFile('Music.mp3');
|
|
#endif
|
|
|
|
#ifdef UnArc_Protect
|
|
ExtractTemporaryFile('unarc.dll');
|
|
#endif
|
|
#ifdef UnArc_None
|
|
ExtractTemporaryFile('unarc.dll');
|
|
#endif
|
|
|
|
// Seting up Languages
|
|
SetupLang;
|
|
|
|
#ifexist "Graphics\Music.mp3"
|
|
// Initialising Music
|
|
BASS_Init(-1, 44100, 0, 0, 0);
|
|
mp3Handle := BASS_StreamCreateFile(FALSE, PAnsiChar(ExpandConstant('{tmp}\Music.mp3')), 0, 0, 0, 0, 4);
|
|
BASS_Start();
|
|
BASS_ChannelPlay(mp3Handle, False);
|
|
#endif
|
|
|
|
// Dialog Form
|
|
with DialogForm do
|
|
begin
|
|
Form := CreateCustomForm;
|
|
with Form do
|
|
begin
|
|
Width := 540;
|
|
Height := 288;
|
|
BorderStyle := bsNone;
|
|
Color := $001E1E1E;
|
|
FormStyle := fsStayOnTop;
|
|
OnShow := @DFShow;
|
|
Position := poScreenCenter
|
|
end;
|
|
|
|
UpperPanel := CreatePanel(Form,0,0,540,32,$00141414);
|
|
UpperPanelLabl := Createlbl(UpperPanel,true,false,10,10,0,0,8,clwhite,'{#AppName}',taCenter);
|
|
UpperPanellabl.OnMouseDown := @DFMouseDown;
|
|
UpperPanel.OnMouseDown := @DFMouseDown;
|
|
LowerPanel := CreatePanel(Form,0,280,540,8,{#Col});
|
|
LowerPanel.OnMouseDown := @DFMouseDown;
|
|
NotificationLabl := Createlbl(Form,false,false,20,42,500,42,18,clwhite,'Notification',taLeftJustify);
|
|
NotificationLabl.Layout := tlCenter;
|
|
|
|
MessageUiLabl := CreateUiLabl2(Form,20,76,500,44,12,2,clwhite,'MESSAGE','');
|
|
MessageUiLabl.Sublabl.WordWrap := true;
|
|
ResponseUiLabl := CreateUiLabl2(Form,20,174,500,44,12,2,clwhite,'RESPONSE','');
|
|
|
|
NoBtn := ButtonCreate(DialogForm.Form,420,225,100,32,1,{#Col},$001E1E1E,'No',mrNo);
|
|
NoBtn.base.Font.Size := 10;
|
|
NoBtn.Base.Onclick := @NoBtnClick;
|
|
YesBtn := ButtonCreate(DialogForm.Form,316,225,100,32,1,{#Col},$001E1E1E,'Yes',mrYes);
|
|
YesBtn.base.Font.Size := 10;
|
|
YesBtn.Base.Onclick := @YesBtnClick;
|
|
|
|
with TLabel.Create(Form) do
|
|
begin
|
|
Parent := Form;
|
|
SetBounds(0,0,Form.Width,Form.Height)
|
|
OnMouseDown := @DFMouseDown;
|
|
end;
|
|
end;
|
|
//Dialog Form
|
|
// Return Type
|
|
#ifdef MC
|
|
ExtractTemporaryFile('Archive.ini');
|
|
Result := True
|
|
#else
|
|
Result := True;
|
|
#endif
|
|
#ifndef DEBUG
|
|
// Whether App is Installed or not?
|
|
if RegValueExists(HKLM, 'SOFTWARE\{#AppName}', 'InstallPath') then begin
|
|
// App is Installed, Asking whether to continue or not?
|
|
DialogForm.MessageUiLabl.Sublabl.Caption := 'A copy of this program is already installed! Installation should be aborted.'+#13+'Do you want to abort?';
|
|
Result:= DialogForm.Form.ShowModal <> mrYes;
|
|
end;
|
|
#endif
|
|
end;
|
|
|
|
function ShouldSkipPage(PageID: Integer): Boolean;
|
|
begin
|
|
Result := True;
|
|
if ( (PageID = wpWelcome) or (PageID = wpReady) or (PageID = wpInstalling) or ( (PageID = wpFinished) and not ISDoneError ) ) then
|
|
Result := False;
|
|
end;
|
|
|
|
procedure InitializeWizard();
|
|
var g:Integer;
|
|
begin
|
|
with WizardForm do
|
|
begin
|
|
BorderStyle:=bsNone;
|
|
ClientWidth:=854;
|
|
ClientHeight:=576;
|
|
Center;
|
|
Color:=$FF1F1F1F;
|
|
OuterNotebook.Hide;
|
|
InnerNotebook.Hide;
|
|
Bevel.Hide;
|
|
PageNameLabel.Hide;
|
|
PageDescriptionLabel.Hide;
|
|
MainPanel.Hide;
|
|
BackButton.SetBounds(0,0,0,0);
|
|
NextButton.SetBounds(0,0,0,0);
|
|
CancelButton.SetBounds(0,0,0,0);
|
|
DirBrowseButton.SetBounds(0,0,0,0);
|
|
GroupBrowseButton.SetBounds(0,0,0,0);
|
|
DirEdit.OnChange := @DirEdtChange;
|
|
OnShow := @WFShow;
|
|
SetWindowLong(StrToInt(ExpandConstant('{wizardhwnd}')),GWL_EXSTYLE, WS_EX_LAYERED);
|
|
SetLayeredWindowAttributes(StrToInt(ExpandConstant('{wizardhwnd}')), 0, 255, LWA_ALPHA);
|
|
end;
|
|
|
|
Createlabel(WizardForm,False,False,0,0,854,576,0,0,'',taLeftJustify); //WizardForm Move Label
|
|
ImgLoad(WizardForm.Handle,'{#BackGround}',0,32,854,480,true,true);
|
|
AppLabel := Createlabel(WizardForm,true,false,10,8,0,0,10,clwhite,'{#AppName}',taLeftJustify);
|
|
|
|
CloseBtn := CreateSmlBtn(WizardForm,808,0,46,32,10,4,24,24,$FF1F1F1F,clred,$FF1F1F1F,'Close.PNG');
|
|
SmlBtnEvent(CloseBtn,@CloseBtnclick);
|
|
MinimizeBtn := CreateSmlBtn(WizardForm,770,0,38,32,10,8,16,16,$FF1F1F1F,clGrayText,$FF1F1F1F,'Minimize.PNG');
|
|
SmlBtnEvent(MinimizeBtn,@MinimizeBtnclick);
|
|
#ifexist "Graphics\Music.mp3"
|
|
MusicBtn := CreateSmlBtn(WizardForm,770-38,0,38,32,10,8,16,16,$FF1F1F1F,clGrayText,$FF1F1F1F,'Music.PNG');
|
|
SmlBtnEvent(MusicBtn,@BASS_OnOffClick);
|
|
#endif
|
|
MetroNextBtn := ButtonCreate(WizardForm,736,530,100,32,1,{#Col},$001F1F1F,'Proceed',mrNone)
|
|
MetroBtnEvent(MetroNextBtn,@MetroNextBtnClick);
|
|
|
|
//---------------------------------------------------------------------------------------------------//
|
|
WelcomeUiCreate; //
|
|
InfoUiCreate; //
|
|
ConfigUiCreate; //
|
|
SysUiCreate; //
|
|
ReadyUiCreate; //
|
|
InstallUiCreate; //
|
|
FinishUiCreate; //
|
|
//---------------------------------------------------------------------------------------------------//
|
|
SidePnl2 := CreatePanel(WizardForm,-2,31,256,482,WizardForm.Color);
|
|
SidePnl2.Hide;
|
|
SidePnl := CreatePanel(WizardForm,-2,31,56,482,WizardForm.Color);
|
|
|
|
LanguageLabel := TLabel.Create(WizardForm);
|
|
with LanguageLabel do
|
|
begin
|
|
Parent := SidePnl;
|
|
SetBounds(0,444,56,18);
|
|
AutoSize := false;
|
|
with Font do
|
|
begin
|
|
Name := {#FontName};
|
|
Size := 12;
|
|
Color := clwhite;
|
|
end;
|
|
Caption := GetLangLabel('language');
|
|
OnClick := @LangChange;
|
|
OnMouseEnter := @OnLangNav;
|
|
OnMouseLeave := @OffLangnav;
|
|
Layout := tlCenter;
|
|
Alignment := taCenter;
|
|
end;
|
|
|
|
langNav := TLabel.Create(SidePnl2)
|
|
with langNav do
|
|
begin
|
|
Parent := SidePnl2;
|
|
SetBounds(12,444,256,LanguageLabel.Height);
|
|
AutoSize := false;
|
|
with Font do
|
|
begin
|
|
name := {#FontName};
|
|
Size := 10;
|
|
Color := clwhite;
|
|
end;
|
|
caption := GetLangLabel('languagechange');
|
|
OnClick := @LangChange;
|
|
OnMouseEnter := @OnLangNav;
|
|
OnMouseLeave := @OffLangnav;
|
|
Layout := tlCenter;
|
|
Alignment := taCenter;
|
|
end;
|
|
|
|
with TTimer.Create(WizardForm) do
|
|
begin
|
|
Interval := 100;
|
|
OnTimer := @SidePnlOperate;
|
|
Enabled := true;
|
|
end;
|
|
|
|
HomeSideBtn := CreateSideBtn(SidePnl,0,48-SidePnl.Top,256,48,'Home','Home');
|
|
SetSideBtnOnCLick(HomeSideBtn,@BtnClicks);
|
|
InfoSideBtn := CreateSideBtn(SidePnl,0,96-SidePnl.Top,256,48,'Info','Information');
|
|
SetSideBtnOnCLick(InfoSideBtn,@BtnClicks);
|
|
SysSideBtn := CreateSideBtn(SidePnl,0,144-SidePnl.Top,256,48,'System','System Check');
|
|
SetSideBtnOnCLick(SysSideBtn,@BtnClicks);
|
|
OptionSideBtn:= CreateSideBtn(SidePnl,0,192-SidePnl.Top,256,48,'Settings','Configuration');
|
|
SetSideBtnOnCLick(OptionSideBtn,@BtnClicks);
|
|
|
|
NotesSideBtn := CreateSideBtn(SidePnl,0,48-SidePnl.Top,256,48,'Notes','Logs');
|
|
ImgSetPosition(NotesSideBtn.Img,12,48-SidePnl.Top+4,36,36);
|
|
ImgSetPosition(NotesSideBtn.OnMouseImg,12,48-SidePnl.Top+4,36,36);
|
|
SideBtnVisibility(NotesSideBtn,False);
|
|
|
|
InstallSideBtn := CreateSideBtn(SidePnl,0,48-SidePnl.Top,256,48,'Install','Installation');
|
|
SideBtnClick(InstallSideBtn);
|
|
|
|
FinishSideBtn := CreateSideBtn(SidePnl,0,48-SidePnl.Top,256,48,'Finish','Finalization');
|
|
SideBtnClick(FinishSideBtn);
|
|
|
|
AllSidebtnDisable;
|
|
SideBtnClick(HomeSideBtn);
|
|
|
|
WelcomeUi.Base.Show;
|
|
InfoUi.Base.Hide;
|
|
ConfigUi.Base.Hide;
|
|
for g := 0 to 3 do
|
|
SysCheckPage[g].Base.Hide;
|
|
|
|
Createlabel(WizardForm,true,false,16,532,480,24,10,{#Col},'{#Watermark}',taLeftJustify);
|
|
CreatePanel(WizardForm,0,WizardForm.Height-4,WizardForm.Width,4,{#Col});
|
|
|
|
ImgApplyChanges(WizardForm.Handle);
|
|
end;
|
|
|
|
procedure CurPageChanged(CurPageID: Integer);
|
|
begin
|
|
MetroUiHide;
|
|
ReadyPage.Base.Hide;
|
|
InstallPage.Base.Hide;
|
|
FinishPage.Base.Hide;
|
|
SideBtnVisibility(NotesSideBtn,False);
|
|
SideBtnVisibility(InstallSideBtn,False);
|
|
SideBtnVisibility(FinishSideBtn,False);
|
|
case CurPageID of
|
|
wpWelcome:
|
|
begin
|
|
LangUpdate;
|
|
SideBtnVisibility(NotesSideBtn,False);
|
|
MetroUiShow;
|
|
SideBtnClick(HomeSideBtn);
|
|
DirEdtChange(nil);
|
|
end;
|
|
wpReady:
|
|
begin
|
|
LangUpdate;
|
|
SideBtnVisibility(NotesSideBtn,True);
|
|
SideBtnClick(NotesSideBtn);
|
|
ReadyPage.Base.Show;
|
|
end;
|
|
wpInstalling:
|
|
begin
|
|
LangUpdate;
|
|
WizardForm.CancelButton.Enabled := True;
|
|
InstallPage.Base.Show;
|
|
Time := 0;
|
|
TransferRate := 0;
|
|
Startedat := GetTickCount;
|
|
TimerID:= SetTimer(0, 0, 900 , WrapBGI(@BGIChanger,0));
|
|
SideBtnVisibility(InstallSideBtn,True);
|
|
SideBtnClick(InstallSideBtn);
|
|
end;
|
|
wpFinished:
|
|
begin
|
|
LangUpdate;
|
|
FinishPage.Base.Show;
|
|
SideBtnVisibility(FinishSideBtn,True);
|
|
SideBtnClick(FinishSideBtn);
|
|
end;
|
|
end;
|
|
ImgApplyChanges(WizardForm.Handle);
|
|
end;
|
|
|
|
procedure CurStepChanged(CurStep: TSetupStep);
|
|
#if defined( MC )
|
|
var
|
|
ResultCode :Integer;
|
|
#endif
|
|
begin
|
|
#ifdef MC
|
|
if FileExists(ExpandConstant('{tmp}\Archive.ini')) and (CurStep = ssInstall) then
|
|
MC_Process;
|
|
#endif
|
|
#if defined( MC )
|
|
if (CurStep=ssPostInstall) and ISDoneError then begin
|
|
Exec(ExpandConstant('{sys}\taskkill.exe'), ' /F /IM pZLib.exe', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
|
|
Exec(ExpandConstant('{sys}\taskkill.exe'), ' /F /IM fazip.exe', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
|
|
Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
|
|
DelTree(ExpandConstant('{app}'), True, True, True);
|
|
RemoveDir(ExpandConstant('{app}'));
|
|
end;
|
|
if (CurStep=ssPostInstall) and not ISDoneError then
|
|
begin
|
|
#define public RedistsINI ".\Redist.ini"
|
|
#ifnexist RedistsINI
|
|
#error Ini for redists reading can't be find
|
|
#endif
|
|
#define public Section
|
|
#define public i
|
|
#define public Counter
|
|
#expr Counter = 0
|
|
#define public RedistName
|
|
#define public RedistFileName
|
|
#define public RedistParameters
|
|
#sub AddRedist
|
|
#expr Counter = Counter + 1
|
|
#expr Section = StringChange("RedistCounter", "Counter", str(Counter) )
|
|
#expr RedistName = ReadIni(SourcePath + RedistsINI , Section , "Name","")
|
|
#expr RedistFileName = ReadIni(SourcePath + RedistsINI , Section , "FileName","")
|
|
#expr RedistParameters = Readini(SourcePath + RedistsINI , Section , "Parameters","")
|
|
#if RedistFileName != ""
|
|
if MsgBox('Do you want install: "{#RedistName}"?', mbError, MB_OKCANCEL) = IDOK then
|
|
Exec(ExpandConstant('{#RedistFileName}'),'{#RedistParameters}', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
|
|
#endif
|
|
#endsub
|
|
#for { i = 1 ; ReadIni( SourcePath + RedistsINI, StringChange( "RedistCounter", "Counter", str(i)) , "FileName" , "" ) != "" ; i++ } AddRedist
|
|
end;
|
|
#endif
|
|
end;
|
|
|
|
procedure DeinitializeSetup();
|
|
begin
|
|
gdipShutdown;
|
|
KillTimer(0,TimerId);
|
|
#ifexist "Graphics\Music.mp3"
|
|
BASS_Stop();
|
|
BASS_Free();
|
|
#endif
|
|
end; |