#define GameName "WGMUs16"
#define GameName2 "WG MU Online"
#define NeedInstallSize "0" ;в байтах требуемое место
#define Font1 "Russo_One.ttf"
#define FontName1 "Russo One"
//===== [Дополнительное ПО 'Вкл' или 'Выкл'] =====\\:
#define Redist
[Setup]
AppName={#GameName}
AppVersion=1.5
DefaultDirName={pf}\{#GameName}
DefaultGroupName={#GameName}
SetupIconFile=Img\icon.ico
BitmapResource=CBImg:Img\CBImg.bmp
ExtraDiskSpaceRequired={#NeedInstallSize}
DirExistsWarning=no
InternalCompressLevel=ultra64
Compression=lzma2/ultra64
SolidCompression=yes
//====={ иконки на рабюстоле, меню пуск и удаления }=====\\
[Icons]
Name: {group}\{cm:UninstallProgram,game}; Filename: {uninstallexe}
Name: {commondesktop}\{#GameName2}; Filename: {app}\Launcher.exe; Tasks: desktopicon; IconFilename: {app}\Launcher.exe
Name: {group}\{#GameName2}; Filename: {app}\Launcher.exe; IconFilename: {app}\Launcher.exe
//====={ иконки на раб стол и понель быстрого запуска }=====\\
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon};
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon};
#ifdef Redist
//===== [дополнительные задачи] =====\\
[Run]
Filename: {tmp}\Redist\dxwebsetup.exe; WorkingDir: {tmp}\Redist\; Check: DirectX
Filename: {tmp}\Redist\vcredist_x86.exe; WorkingDir: {tmp}\Redist\; Check: not IsWin64 and VCRedist
Filename: {tmp}\Redist\vcredist_x64.exe; WorkingDir: {tmp}\Redist\; Check: IsWin64 and VCRedist
#endif
[Files]
Source: Dll\*; Flags: dontcopy;
Source: Img\*; Flags: dontcopy;
#include "files.iss"
#ifdef Redist
Source: Redist\dxwebsetup.exe; DestDir: "{tmp}\Redist"; MinVersion: 0.0,5.0; Flags: ignoreversion
Source: Redist\vcredist_x86.exe; DestDir: "{tmp}\Redist"; MinVersion: 0.0,5.0; Flags: ignoreversion
Source: Redist\vcredist_x64.exe; DestDir: "{tmp}\Redist"; MinVersion: 0.0,5.0; Flags: ignoreversion
#endif
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl";
Name: "english"; MessagesFile: "compiler:Default.isl";
[UninstallDelete]
Type: filesandordirs; Name: {app};
[CustomMessages]
russian.Welcome=Программа установит {#GameName2} на ваш компьютер.%n%nРекомендуется закрыть все прочие приложения перед тем как продолжить.%n%nНажмите «Далее», чтобы продолжить установку, или «Выход», чтобы выйти из программы установки.
russian.Need1=Требуется
russian.Need2=свободного пространства.
russian.Need3=Недостаточно свободного места
russian.SelectDir=Выберите папку установки.
russian.SelectGroup=Выберите папку в меню «Пуск».
russian.Installing=Установка {#GameName2}...
russian.FinishedLabel=Завершение Мастера установки {#GameName2}%n%nПрограмма {#GameName2} установлена на Ваш компьютер. Приложение можно запустить с помощью соответствующего значка.%n%nНажмите «Завершить», чтобы выйти из программы установки.
russian.Cancel=Отмена
russian.Back=Назад
russian.Install=Установить
russian.Next=Далее
russian.Edit=Обзор
russian.Finish=Завершить
russian.DName=Директория установки:
russian.FName=Извлекаемый файл:
russian.Mb=Мб
russian.Gb=Гб
russian.Tb=Тб
russian.IconsCheck=Создать ярлык в меню «Пуск» ?
russian.DesktopTasks=Создать значок на рабочем столе ?
russian.DirectX= Установить DirectX
russian.VCRedist= Установить Visual++
english.Welcome=Program installs {#GameName} on your computer.%n%nIt is recommended to close all other applications before continuing.%n%nClick «Next» to continue the installation, or «Exit» to exit the installation program.
english.Need1=Required
english.Need2=free space.
english.Need3=Not enough free space
english.SelectDir=Select the installation folder.
english.SelectGroup=Select a folder in the «Start» menu.
english.Installing=Installation {#GameName}...
english.FinishedLabel=Completing the Setup Wizard {#GameName}%n%nPrograms {#GameName} installed on your computer. The application can be run using the corresponding icon.%n%nClick «Finish» to exit the installation program.
english.Cancel=Cancel
english.Back=Back
english.Install=Install
english.Next=Next
english.Edit=Edit
english.Finish=Finish
english.DName=Installation directory:
english.FName=Извлекаемый файл:
english.Mb=Mb
english.Gb=Gb
english.Tb=Tb
english.IconsCheck=Create a shortcut in the «Start» menu?
english.DesktopTasks=Create an icon on your desktop?
english.DirectX= Set DirectX
english.VCRedist= Set Visual++
[Code]
#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif
#include "Modules\botva2.iss"
#include "Modules\ProgressBar.iss"
#include "Modules\TrackBar.iss"
#include "Modules\WinTB.iss"
#include "Modules\Uninstall.iss"
type
TCallbackProc = function (h: hWnd; Msg, wParam, lParam: Longint): Longint;
const
FR_PRIVATE = $10;
GCL_STYLE = -26;
CS_NOCLOSE = $200;
var
IsInit, OldMinimizeAnimation: boolean;
CBImg: TBitmapImage;
Frame: TForm;
WizardImage, DirEdit, ProgramGroupEdit, PBBkgImg, PBImg, PBOldProc, WFOldProc: LongInt;
ButtonFont: TFont;
CancelButton, NextButton, BackButton, DirBrowseButton, GroupBrowseButton, CloseButton, NoIconsCheck, DesktopCheck, DirectXCheck, VCRedistCheck, MinButton: HWND;
WelcomeLabel, WelcomeLabel2, SelectDirLabel, DirEditLabel, SelectProgramGroupLabel, ProgramGroupEditLabel, InstallSpacelabel, FinishedLabel, InstallingLabel, DesktopLabel, NoIconsLabel, DPOLabel, DirectXLabel, VCRedistLabel,
PercentLabel, InstallingDirLabel, FileNameLabel: TLabel;
TrackLabel: array [0..1] of TLabel;
TB: integer;
function AddFontResource(lpszFilename: String; fl, pdv: DWORD): Integer;
external 'AddFontResourceEx{#A}@gdi32.dll stdcall';
function RemoveFontResource(lpFileName: String; fl, pdv: DWORD): BOOL;
external 'RemoveFontResourceEx{#A}@gdi32.dll stdcall';
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external 'ShowWindow@user32.dll stdcall';
function ReleaseCapture: Longint;
external 'ReleaseCapture@user32.dll stdcall';
function LoadImage(hInst: THandle; ImageName: PAnsiChar; ImageType: UINT; X, Y: Integer; Flags: UINT): THandle;
external 'LoadImageA@user32.dll stdcall';
function GetDC(hWnd: HWND): LongWord;
external 'GetDC@user32';
function SetWindowRgn(hWnd: HWND; hRgn: LongWord; bRedraw: BOOL): Integer;
external 'SetWindowRgn@user32.dll stdcall';
function ReleaseDC(hWnd: HWND; hDC: LongWord): Integer;
external 'ReleaseDC@user32.dll stdcall';
function DeleteObject(p1: LongWord): BOOL;
external 'DeleteObject@gdi32.dll stdcall';
function GetClassLong(Wnd: HWnd; Index: Integer): Longint;
external 'GetClassLong{#A}@user32.dll stdcall';
function SetClassLong(Wnd: HWnd; Index: Integer; NewLong: Longint): Longint;
external 'SetClassLong{#A}@user32.dll stdcall';
function SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND; X, Y, cx, cy: Integer; uFlags: UINT): BOOL;
external 'SetWindowPos@user32.dll stdcall';
function WndProcCallBack(P: TCallbackProc; ParamCount: integer): LongWord;
external 'wrapcallbackaddr@{tmp}\CallbackCtrl.dll stdcall delayload';
procedure FrameMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
WizardForm.SetFocus;
ReleaseCapture;
SendMessage(WizardForm.Handle, $0112, $F012, 0);
end;
function GetFloatFormText(const UndefText: String): String; // число из строки
var
i: Integer;
begin
for i := 1 to Length(UndefText) do
case UndefText[i] of
'0','1','2','3','4','5','6','7','8','9': Result := Result + UndefText[i];
',': Result := Result + '.';
end;
end;
function NumToStr(Float: Extended): String;
begin
Result := Format('%.2n', [Float]);
StringChange(Result, ',', '.');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do
SetLength(Result, Length(Result) - 1);
end;
function PBProc(h: hWnd; Msg, wParam, lParam: Longint): Longint;
var
pr, i1, i2: Extended;
w: integer;
begin
Result := CallWindowProc(PBOldProc, h, Msg, wParam, lParam);
if (Msg = $402) and (WizardForm.ProgressGauge.Position > WizardForm.ProgressGauge.Min) then begin
i1 := WizardForm.ProgressGauge.Position - WizardForm.ProgressGauge.Min;
i2 := WizardForm.ProgressGauge.Max - WizardForm.ProgressGauge.Min;
pr := i1 * 100 / i2;
w := Round(544 * pr / 100);
PercentLabel.Caption := NumToStr((WizardForm.ProgressGauge.Position * 100) / WizardForm.ProgressGauge.Max) + ' %';
InstallingDirLabel.Caption := ExpandConstant('{cm:DName} ') + WizardDirValue;
FileNameLabel.Caption := ExpandConstant('{cm:FName} ') + ExtractFileName(WizardForm.FilenameLabel.Caption);
ImgSetPosition(PBImg, ScaleX(36), ScaleY(171), w, 22);
ImgSetVisiblePart(PBImg, 0, 0, w, 22);
ImgApplyChanges(WizardForm.Handle);
end;
end;
procedure TracKLabelMouseDown(Sender: TObject);
begin
Case Sender of
TrackLabel[0]: ImgTBSetPosition(TB, ImgTBGetPosition(TB) - 25);
TrackLabel[1]: ImgTBSetPosition(TB, ImgTBGetPosition(TB) + 25);
end;
end;
procedure SetStateNewButtons;
var
CurPageID: Integer;
begin
WizardForm.BackButton.Caption := ExpandConstant('{cm:Back}');
WizardForm.NextButton.Caption := ExpandConstant('{cm:Next}');
WizardForm.CancelButton.Caption := ExpandConstant('{cm:Cancel}');
WizardForm.DirBrowseButton.Caption := ExpandConstant('{cm:Edit}');
WizardForm.GroupBrowseButton.Caption := ExpandConstant('{cm:Edit}');
if (WizardForm.CurPageID = wpSelectDir) then
WizardForm.NextButton.Caption := ExpandConstant('{cm:Install}');
if (WizardForm.CurPageID = wpFinished) then
WizardForm.NextButton.Caption := ExpandConstant('{cm:Finish}');
with WizardForm.BackButton do begin
BtnSetText(BackButton, PAnsiChar(Caption));
BtnSetVisibility(BackButton, Visible);
end;
with WizardForm.NextButton do begin
BtnSetText(NextButton, PAnsiChar(Caption));
BtnSetVisibility(NextButton, Visible);
end;
with WizardForm.CancelButton do begin
BtnSetText(CancelButton, PAnsiChar(Caption));
BtnSetVisibility(CancelButton, False);
end;
BtnSetText(DirBrowseButton, PAnsiChar(WizardForm.DirBrowseButton.Caption));
BtnSetText(GroupBrowseButton, PAnsiChar(WizardForm.GroupBrowseButton.Caption));
end;
procedure MinimizeBtnClick(h:HWND);
begin
SendMessage(WizardForm.Handle, $112, 61472, 0);
end;
function WFProc(h:hWnd;Msg,wParam,lParam:Longint):Longint;
begin
if Msg = $3 then
SetWindowPos(Frame.Handle, 0, WizardForm.Left, WizardForm.Top, 0, 0, $515);
Result := CallWindowProc(WFOldProc, h, Msg, wParam, lParam);
end;
procedure SetRgn(h: HWND; FileName: string; Width, Height: integer);
var
dc: LongWord;
FRgn: LongWord;
bmp: HBITMAP;
begin
BMP := LoadImage(0, PAnsiChar(ExpandConstant('{tmp}\') + FileName), 0, Width, Height, $10);
dc := GetDC(h);
FRgn := CreateBitmapRgn(dc,bmp,$ffffff,0,0);
SetWindowRgn(h, FRgn, True);
ReleaseDC(h, dc);
DeleteObject(BMP);
end;
procedure WizardFormBtnClick(hBtn: HWND);
var
Btn: TButton;
begin
case hBtn of
CancelButton: Btn := WizardForm.CancelButton;
CloseButton: Btn := WizardForm.CancelButton;
NextButton: Btn := WizardForm.NextButton;
BackButton: Btn := WizardForm.BackButton;
DirBrowseButton: Btn := WizardForm.DirBrowseButton;
GroupBrowseButton: Btn := WizardForm.GroupBrowseButton;
end;
Btn.OnClick(Btn);
SetStateNewButtons;
BtnRefresh(hBtn);
end;
function NoIcons: Boolean;
begin
Result:= BtnGetEnabled(GroupBrowseButton);
end;
function Desktop: Boolean;
begin
Result:= BtnGetChecked(DesktopCheck);
end;
function DirectX: Boolean;
begin
Result:= BtnGetChecked(DirectXCheck);
end;
function VCRedist: Boolean;
begin
Result:= BtnGetChecked(VCRedistCheck);
end;
procedure NoIconsClick(hBtn:HWND);
var
Check:boolean;
begin
Check:=BtnGetChecked(hBtn);
BtnSetEnabled(GroupBrowseButton, Check);
WizardForm.GroupEdit.Enabled:=Check;
if Check then NoIconsLabel.Font.Color:=$b3b3b3 else NoIconsLabel.Font.Color:=-16777199;
if Check then ProgramGroupEditLabel.Font.Color:=$808080 else ProgramGroupEditLabel.Font.Color:=$505050;
end;
procedure NoIconsLabelClick(Sender:TObject);
begin
BtnSetChecked(NoIconsCheck, not BtnGetChecked(NoIconsCheck));
NoIconsClick(NoIconsCheck);
end;
procedure DesktopClick(hBtn:HWND);
var
Check:boolean;
begin
Check:=BtnGetChecked(hBtn);
if Check then DesktopLabel.Font.Color:=$b3b3b3 else DesktopLabel.Font.Color:=-16777199;
end;
procedure DesktopLabelClick(Sender:TObject);
begin
BtnSetChecked(DesktopCheck, not BtnGetChecked(DesktopCheck));
DesktopClick(DesktopCheck);
end;
procedure DirectXClick(hBtn:HWND);
var
Check:boolean;
begin
Check:=BtnGetChecked(hBtn);
if Check then DirectXLabel.Font.Color:=$b3b3b3 else DirectXLabel.Font.Color:=-16777199;
end;
procedure DirectXLabelClick(Sender:TObject);
begin
BtnSetChecked(DirectXCheck, not BtnGetChecked(DirectXCheck));
DirectXClick(DirectXCheck);
end;
procedure VCRedistClick(hBtn:HWND);
var
Check:boolean;
begin
Check:=BtnGetChecked(hBtn);
if Check then VCRedistLabel.Font.Color:=$b3b3b3 else VCRedistLabel.Font.Color:=-16777199;
end;
procedure VCRedistLabelClick(Sender:TObject);
begin
BtnSetChecked(VCRedistCheck, not BtnGetChecked(VCRedistCheck));
VCRedistClick(VCRedistCheck);
end;
function MbOrTb(Float: Extended): String;
begin
if Float < 1024 then
Result := NumToStr(Float) + ExpandConstant(' {cm:Mb}') else
if Float/1024 < 1024 then
Result := NumToStr(Float / 1024 ) + ExpandConstant(' {cm:Gb}') else
Result := NumToStr(Float / (1024 * 1024)) + ExpandConstant(' {cm:Tb}');
end;
function GetFreeDriveSpace(const UndefInstallPath: String): Cardinal;
var
TotalMB: Cardinal;
begin
GetSpaceOnDisk(ExtractFileDrive(UndefInstallPath), True, Result, TotalMB);
end;
procedure DirEditOnChange(Sender: TObject);
var
UndefNeedSize, UndefFreeSize: Extended;
begin
DirEditLabel.Caption := MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
UndefNeedSize := StrToFloat(GetFloatFormText(WizardForm.ComponentsDiskSpaceLabel.Caption));
UndefFreeSize := Extended(GetFreeDriveSpace(WizardDirValue()));
if (UndefFreeSize > UndefNeedSize) then begin
InstallSpacelabel.Caption := ExpandConstant('{cm:Need1} ') + MbOrTb(UndefNeedSize) +
ExpandConstant(' {cm:Need2}');
BtnSetEnabled(NextButton, True);
end else begin
InstallSpacelabel.Caption := ExpandConstant('{cm:Need3}');
BtnSetEnabled(NextButton, False);
end;
end;
procedure GroupEditOnChange(Sender: TObject);
var Drive: String;
begin
ProgramGroupEditLabel.Caption:=MinimizePathName(WizardForm.GroupEdit.Text, ProgramGroupEditLabel.Font, ProgramGroupEditLabel.Width);
Drive:= ExtractFileDrive(WizardForm.GroupEdit.Text);
if WizardForm.CurPageID = wpSelectDir then begin
BtnSetEnabled(NextButton, True);
end
end;
function InitializeSetup:boolean;
begin
IsInit := False;
if not FileExists(ExpandConstant('{tmp}\b2p.dll')) then
ExtractTemporaryFile('b2p.dll');
if not FileExists(ExpandConstant('{tmp}\WinTB.dll')) then
ExtractTemporaryFile('WinTB.dll');
if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then
ExtractTemporaryFile('botva2.dll');
if not FileExists(ExpandConstant('{tmp}\CallbackCtrl.dll')) then
ExtractTemporaryFile('CallbackCtrl.dll');
if not FontExists('{#FontName1}') then begin
ExtractTemporaryFile('{#Font1}');
AddFontResource(ExpandConstant('{tmp}\{#Font1}'), FR_PRIVATE, 0);
end;
Result := True;
end;
procedure RedesignWizardForm;
var
i: integer;
begin
ShowWindow(WizardForm.Handle, SW_HIDE);
ExtractTemporaryFile('form.bmp');
CBImg := TBitmapImage.Create(WizardForm);
CBImg.Bitmap.LoadFromResourceName(HInstance, '_IS_CBImg');
with WizardForm do begin
BorderStyle := bsNone;
ClientWidth := ScaleX(619);
ClientHeight := ScaleY(412);
InnerNotebook.Hide;
OuterNotebook.Hide;
Bevel.Hide;
end;
SetRgn(WizardForm.Handle, 'form.bmp', ScaleX(619), ScaleY(412));
WizardImage := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\frame.png'), ScaleX(0), ScaleY(0), WizardForm.Width, WizardForm.Height, False, True);
Frame := TForm.Create(nil);
Frame.BorderStyle := bsNone;
CreateFormFromImage(Frame.Handle, ExpandConstant('{tmp}\frame.png'));
SetClassLong(Frame.Handle, GCL_STYLE, GetClassLong(Frame.Handle, GCL_STYLE) or CS_NOCLOSE);
with TLabel.Create(Frame) do begin
Parent := Frame;
AutoSize := False;
Align := alClient;
OnMouseDown := @FrameMouseDown;
end;
WizardForm.Left := Frame.Left;
WizardForm.Top := Frame.Top;
WFOldProc := SetWindowLong(WizardForm.Handle, -4, WndProcCallBack(@WFProc, 4));
with TLabel.Create(WizardForm) do begin
Parent := WizardForm;
AutoSize := False;
Transparent := True;
Align := alClient;
OnMouseDown := @FrameMouseDown;
end;
ButtonFont := TFont.Create;
with ButtonFont do begin
Name := '{#FontName1}';
Size := 10;
Height := 12;
end;
CloseButton := BtnCreate(WizardForm.Handle, ScaleX(590), ScaleY(20), ScaleX(11), ScaleY(11),
PAnsiChar(ExpandConstant('{tmp}\closebtn.png')), 2, False);
BtnSetEvent(CloseButton, BtnClickEventID, WrapBtnCallback(@WizardFormBtnClick, 1));
BtnSetCursor(CloseButton, GetSysCursorHandle(32649));
OldMinimizeAnimation := GetMinimizeAnimation;
SetMinimizeAnimation(False);
MinButton:=BtnCreate(WizardForm.Handle, ScaleX(572), ScaleY(23), ScaleX(13), ScaleY(11),
PAnsiChar(ExpandConstant('{tmp}\MinBtn.png')), 2, False);
BtnSetEvent(MinButton, BtnClickEventID, WrapBtnCallback(@MinimizeBtnClick, 1));
BtnSetCursor(MinButton, GetSysCursorHandle(32649));
with WizardForm.CancelButton do begin
CancelButton := BtnCreate(WizardForm.Handle, ScaleX(500), ScaleY(365), ScaleX(104), ScaleY(29),
ExpandConstant('{tmp}\button.png'), 1, False);
BtnSetEvent(CancelButton, BtnClickEventID, WrapBtnCallback(@WizardFormBtnClick, 1));
BtnSetFont(CancelButton, ButtonFont.Handle);
BtnSetFontColor(CancelButton, $808080, $2222b2, $808080, $545454);
BtnSetCursor(CancelButton, GetSysCursorHandle(32649));
Height := 0;
end;
with WizardForm.NextButton do begin
NextButton := BtnCreate(WizardForm.Handle, ScaleX(500), ScaleY(365), ScaleX(104), ScaleY(29),
ExpandConstant('{tmp}\button.png'), 1, False);
BtnSetEvent(NextButton, BtnClickEventID, WrapBtnCallback(@WizardFormBtnClick, 1));
BtnSetFont(NextButton, ButtonFont.Handle);
BtnSetFontColor(NextButton, $808080, $2222b2, $808080, $545454);
BtnSetCursor(NextButton, GetSysCursorHandle(32649));
Height := 0;
end;
with WizardForm.BackButton do begin
BackButton := BtnCreate(WizardForm.Handle, ScaleX(385), ScaleY(365), ScaleX(104), ScaleY(29),
ExpandConstant('{tmp}\button.png'), 1, False);
BtnSetEvent(BackButton, BtnClickEventID, WrapBtnCallback(@WizardFormBtnClick, 1));
BtnSetFont(BackButton, ButtonFont.Handle);
BtnSetFontColor(BackButton, $808080, $2222b2, $808080, $545454);
BtnSetCursor(BackButton, GetSysCursorHandle(32649));
Height := 0;
end;
with WizardForm.DirBrowseButton do begin
DirBrowseButton := BtnCreate(WizardForm.Handle, ScaleX(485), ScaleY(150), ScaleX(104), ScaleY(29),
ExpandConstant('{tmp}\button.png'), 1, False);
BtnSetEvent(DirBrowseButton, BtnClickEventID, WrapBtnCallback(@WizardFormBtnClick, 1));
BtnSetFont(DirBrowseButton, ButtonFont.Handle);
BtnSetFontColor(DirBrowseButton, $808080, $2222b2, $808080, $545454);
BtnSetCursor(DirBrowseButton, GetSysCursorHandle(32649));
Height := 0;
end;
with WizardForm.GroupBrowseButton do begin
GroupBrowseButton := BtnCreate(WizardForm.Handle, ScaleX(485), ScaleY(220), ScaleX(104), ScaleY(29),
ExpandConstant('{tmp}\button.png'), 1, False);
BtnSetEvent(GroupBrowseButton, BtnClickEventID, WrapBtnCallback(@WizardFormBtnClick, 1));
BtnSetFont(GroupBrowseButton, ButtonFont.Handle);
BtnSetFontColor(GroupBrowseButton, $808080, $2222b2, $808080, $545454);
BtnSetCursor(GroupBrowseButton, GetSysCursorHandle(32649));
Height := 0;
end;
DesktopCheck:=BtnCreate(WizardForm.Handle, ScaleX(250), ScaleY(280), ScaleX(16), ScaleY(16), ExpandConstant('CheckBox.png'), 1, True);
BtnSetChecked(DesktopCheck, True);
BtnSetEvent(DesktopCheck,BtnClickEventID,WrapBtnCallback(@DesktopClick,1));
NoIconsCheck:=BtnCreate(WizardForm.Handle,ScaleX(250),ScaleY(320),ScaleX(16), ScaleY(16), ExpandConstant('CheckBox.png'),1,True);
BtnSetChecked(NoIconsCheck, true);
BtnSetEvent(NoIconsCheck,BtnClickEventID,WrapBtnCallback(@NoIconsClick,1));
DirectXCheck:=BtnCreate(WizardForm.Handle, ScaleX(36), ScaleY(280), ScaleX(16), ScaleY(16), ExpandConstant('CheckBox.png'), 1, True);
BtnSetChecked(DirectXCheck, False);
BtnSetEvent(DirectXCheck,BtnClickEventID,WrapBtnCallback(@DirectXClick,1));
VCRedistCheck:=BtnCreate(WizardForm.Handle, ScaleX(36), ScaleY(320), ScaleX(16), ScaleY(16), ExpandConstant('CheckBox.png'), 1, True);
BtnSetChecked(VCRedistCheck, False);
BtnSetEvent(VCRedistCheck,BtnClickEventID,WrapBtnCallback(@VCRedistClick,1));
WelcomeLabel := TLabel.Create(WizardForm);
with WelcomeLabel do begin
SetBounds(ScaleX(35), ScaleY(150), ScaleX(550), ScaleY(230));
AutoSize := false;
Alignment := taCenter;
Transparent := true;
WordWrap := true;
Parent := WizardForm;
Font.Name := '{#FontName1}';
Font.Size := 14;
Font.Color := $808080;
Caption := ExpandConstant('{cm:Welcome}');
end;
FinishedLabel := TLabel.Create(WizardForm);
with FinishedLabel do begin
SetBounds(ScaleX(35), ScaleY(150), ScaleX(550), ScaleY(230));
AutoSize := false;
Alignment := taCenter;
Transparent := true;
WordWrap := true;
Parent := WizardForm;
Font.Name := '{#FontName1}';
Font.Size := 14;
Font.Color := $808080;
Caption := ExpandConstant('{cm:FinishedLabel}');
end;
SelectDirLabel := TLabel.Create(WizardForm);
with SelectDirLabel do begin
SetBounds(ScaleX(40), ScaleY(130), ScaleX(400), ScaleY(30));
AutoSize := false;
Transparent := true;
WordWrap := true;
Font.Name := '{#FontName1}';
Font.Size := 10;
Font.Color := $b3b3b3;
Parent := WizardForm;
Caption := ExpandConstant('{cm:SelectDir}');
end;
DirEdit := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\DirPanel1.png'),
ScaleX(50), ScaleY(150), ScaleX(413), ScaleY(29), True, True);
DirEditLabel := TLabel.Create(WizardForm);
with DirEditLabel do begin
SetBounds(ScaleX(55), ScaleY(157), ScaleX(400), ScaleY(20));
AutoSize := false;
Transparent := true;
WordWrap := false;
Font.Name := '{#FontName1}';
Font.Size := 10;
Font.Color := $808080;
Caption := MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
Parent := WizardForm;
end;
SelectProgramGroupLabel := TLabel.Create(WizardForm);
with SelectProgramGroupLabel do begin
SetBounds(ScaleX(40), ScaleY(200), ScaleX(400), ScaleY(30));
AutoSize := false;
Transparent := true;
WordWrap := true;
Font.Name := '{#FontName1}';
Font.Size := 10;
Font.Color := $b3b3b3;
Parent := WizardForm;
Caption := ExpandConstant('{cm:SelectGroup}');
end;
ProgramGroupEdit := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\DirPanel1.png'),
ScaleX(50), ScaleY(220), ScaleX(413), ScaleY(29), True, True);
ProgramGroupEditLabel := TLabel.Create(WizardForm);
with ProgramGroupEditLabel do begin
SetBounds(ScaleX(55), ScaleY(227), ScaleX(400), ScaleY(30));
AutoSize := false;
Transparent := true;
WordWrap := false;
Font.Name := '{#FontName1}';
Font.Size := 10;
Font.Color := $808080;
Caption := MinimizePathName(WizardForm.GroupEdit.Text, ProgramGroupEditLabel.Font, ProgramGroupEditLabel.Width);
Parent := WizardForm;
end;
WizardForm.DirEdit.OnChange := @DirEditOnChange;
WizardForm.GroupEdit.OnChange:=@GroupEditOnChange;
DesktopLabel:=TLabel.Create(WizardForm);
with DesktopLabel do
begin
Top:= ScaleY(280);
Left:= ScaleX(270);
Width:= ScaleX(250);
Height:= ScaleY(25);
AutoSize:= false;
WordWrap:= true;
Font.Name := '{#FontName1}';
Font.Size := 10;
Font.Color := $b3b3b3;
Transparent:= true;
Parent:= WizardForm;
OnClick:=@DesktopLabelClick;
Caption:= ExpandConstant('{cm:DesktopTasks}');
end;
NoIconsLabel:=TLabel.Create(WizardForm);
with NoIconsLabel do
begin
Top:= DesktopLabel.top+40;
Left:= DesktopLabel.left;
Width:= ScaleX(270);
Height:= ScaleY(25);
AutoSize:= false;
WordWrap:= true;
Font.Name := '{#FontName1}';
Font.Size := 10;
Font.Color := $b3b3b3;
Transparent:= true;
Parent:= WizardForm;
OnClick:=@NoIconsLabelClick;
Caption:= ExpandConstant('{cm:IconsCheck}');
end;
DirectXLabel:=TLabel.Create(WizardForm);
with DirectXLabel do
begin
Top:= ScaleY(280);
Left:= ScaleX(50);
Width:= ScaleX(150);
Height:= ScaleY(25);
AutoSize:= false;
WordWrap:= true;
Font.Name := '{#FontName1}';
Font.Size := 10;
Font.Color := $b3b3b3;
Transparent:= true;
Parent:= WizardForm;
OnClick:=@DirectXLabelClick;
Caption:= ExpandConstant('{cm:DirectX}');
end;
VCRedistLabel:=TLabel.Create(WizardForm);
with VCRedistLabel do
begin
Top:= DirectXLabel.top+40;
Left:= DirectXLabel.left;
Width:= ScaleX(150);
Height:= ScaleY(25);
AutoSize:= false;
WordWrap:= true;
Font.Name := '{#FontName1}';
Font.Size := 10;
Font.Color := $b3b3b3;
Transparent:= true;
Parent:= WizardForm;
OnClick:=@VCRedistLabelClick;
Caption:= ExpandConstant('{cm:VCRedist}');
end;
InstallSpacelabel := TLabel.Create(WizardForm);
with InstallSpacelabel do begin
SetBounds(ScaleX(30), ScaleY(370), ScaleX(450), ScaleY(23));
AutoSize := false;
Transparent := true;
WordWrap := true;
Font.Name := '{#FontName1}';
Font.Size := 10;
Font.Color := $2619bd;
Parent := WizardForm;
end;
with WizardForm.ProgressGauge do begin
Max := 1000;
end;
InstallingLabel := TLabel.Create(WizardForm);
with InstallingLabel do begin
SetBounds(ScaleX(36), ScaleY(140), ScaleX(390), ScaleY(30));
AutoSize := false;
Transparent := true;
WordWrap := true;
Font.Name := '{#FontName1}';
Font.Size := 12;
Font.Color := $b3b3b3;
Parent := WizardForm;
Caption := ExpandConstant('{cm:Installing}');
end;
PercentLabel := TLabel.Create(WizardForm);
with PercentLabel do begin
SetBounds(ScaleX(536), ScaleY(140), ScaleX(70), ScaleY(30));
AutoSize := false;
Transparent := true;
WordWrap := true;
Font.Name := '{#FontName1}';
Font.Size := 12;
Font.Color := $b3b3b3;
Parent := WizardForm;
end;
InstallingDirLabel := TLabel.Create(WizardForm);
with InstallingDirLabel do begin
SetBounds(ScaleX(36), ScaleY(205), ScaleX(542), ScaleY(32));
AutoSize := false;
Transparent := true;
WordWrap := true;
Font.Name := '{#FontName1}';
Font.Size := 12;
Font.Color := $b3b3b3;
Parent := WizardForm;
end;
FileNameLabel := TLabel.Create(WizardForm);
with FileNameLabel do begin
SetBounds(ScaleX(36), ScaleY(245), ScaleX(542), ScaleY(32));
AutoSize := false;
Transparent := true;
WordWrap := true;
Font.Name := '{#FontName1}';
Font.Size := 12;
Font.Color := $b3b3b3;
Parent := WizardForm;
end;
PBOldProc := 0;
PBBkgImg := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\ProgressBackground.png'),ScaleX(35), ScaleY(170), ScaleX(546), ScaleY(24), True, True);
PBImg := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\ProgressImg.png'),ScaleY(36), ScaleY(171), ScaleX(544), ScaleY(22), True, True);
PBOldProc := SetWindowLong(WizardForm.ProgressGauge.Handle, -4, WndProcCallBack(@PBProc, 4));
ImgApplyChanges(WizardForm.Handle);
IsInit := True;
ShowWindow(WizardForm.Handle, SW_SHOW);
Frame.Show;
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID = wpLicense) or (PageID = wpPassword) or (PageID = wpInfoBefore) or (PageID = wpSelectComponents)
or (PageID = wpUserInfo) or (PageID = wpReady) or (PageID = wpSelectProgramGroup) or (PageID = wpSelectTasks)
or (PageID = wpPreparing) or (PageID = wpInfoAfter) then
Result := True;
end;
procedure InitializeWizard();
begin
RedesignWizardForm;
Win7TaskBar20();
end;
procedure HideComponents;
begin
SetStateNewButtons;
BtnSetVisibility(CancelButton, False);
BtnSetVisibility(NextButton, False);
BtnSetVisibility(BackButton, False);
BtnSetVisibility(DirBrowseButton, False);
BtnSetVisibility(GroupBrowseButton, False);
ImgSetVisibility(DirEdit,False);
ImgSetVisibility(ProgramGroupEdit,False);
ImgSetVisibility(PBBkgImg, False);
ImgSetVisibility(PBImg, False);
WelcomeLabel.hide;
SelectDirLabel.hide;
SelectProgramGroupLabel.hide;
DirEditLabel.hide;
ProgramGroupEditLabel.hide;
InstallSpacelabel.hide;
FinishedLabel.Hide;
InstallingLabel.Hide;
PercentLabel.Hide;
FileNameLabel.Hide;
InstallingDirLabel.Hide;
DesktopLabel.Hide;
NoIconsLabel.Hide;
DirectXLabel.Hide;
VCRedistLabel.Hide;
BtnSetVisibility(DesktopCheck, false);
BtnSetVisibility(NoIconsCheck, false);
BtnSetVisibility(DirectXCheck, false);
BtnSetVisibility(VCRedistCheck, false);
end;
procedure ShowComponents(CurPageID: Integer);
begin
Application.Title := '{#GameName2}';
case CurPageID of
wpWelcome: begin
BtnSetVisibility(NextButton, True);
BtnSetEnabled(NextButton, True);
WelcomeLabel.Show;
end;
wpSelectDir: begin
BtnSetVisibility(DirBrowseButton, True);
BtnSetVisibility(GroupBrowseButton, True);
ImgSetVisibility(DirEdit, True);
ImgSetVisibility(ProgramGroupEdit,True);
SelectDirLabel.Show;
DirEditLabel.Show;
SelectProgramGroupLabel.Show;
ProgramGroupEditLabel.Show;
InstallSpacelabel.Show;
DesktopLabel.Show;
NoIconsLabel.Show;
DirectXLabel.Show;
VCRedistLabel.Show;
BtnSetVisibility(DesktopCheck, True);
BtnSetVisibility(NoIconsCheck, True);
BtnSetVisibility(DirectXCheck, True);
BtnSetVisibility(VCRedistCheck, True);
DirEditOnChange(nil);
end;
wpInstalling: begin
InstallingLabel.Show;
ImgSetVisibility(PBBkgImg, True);
ImgSetVisibility(PBImg, True);
PercentLabel.Show;
BtnSetVisibility(CancelButton, True);
FileNameLabel.Show;
InstallingDirLabel.Show;
end;
wpFinished: begin
FinishedLabel.Show;
end;
end;
ImgApplyChanges(WizardForm.Handle);
end;
procedure CurPageChanged(CurPageID: integer);
begin
HideComponents;
ShowComponents(CurPageID);
case CurPageID of
wpWelcome:
end;
end;
procedure DeinitializeSetup();
begin
If IsInit then begin
if PBOldProc <> 0 then
SetWindowLong(WizardForm.ProgressGauge.Handle, -4, PBOldProc);
SetWindowLong(WizardForm.Handle, -4, WFOldProc);
SetMinimizeAnimation(OldMinimizeAnimation);
ButtonFont.Free;
gdipShutdown;
RemoveFontResource(ExpandConstant('{tmp}\{#Font1}'), FR_PRIVATE, 0);
Frame.Free;
WizardForm.Free;
end;
end;