xDarkSTALKERx
Новичок
Здраствуйте уважаемые много знающие люди, на старости лет решил заняться РеПакерством..... нашел урок и даже шаблон по которому создавать инсталятор и репак, одна проблема в инсталляторе есть пара элементов которые я бы хотел убрать это бегущая строка, куски букв( обвел на скриншоте) и как то увеличить строку с автором , а то там всего 10 символов... не знаю где редактировать скрипт Подскажите......
Cкрипт прилагаю . и скриншот.(желтая надпись GTA это бегущая строка)
Cкрипт прилагаю . и скриншот.(желтая надпись GTA это бегущая строка)
#define ExeVerName "GTA ViceCity - Mod Edition"
#define NeedSize "7432185788"
;Имя ехе файла
#define ExeName "GTA ViceCity"
[Setup]
AppName={#ExeName}
AppVerName={#ExeName}
AppPublisher=Repack by DarkSTALKER
DefaultDirName={pf}\GTA ViceCity - Mod Edition
DefaultGroupName=\GTA ViceCity - Mod Edition
DirExistsWarning=no
SetupIconFile=InstallFiles\GTAVICE.ico
VersionInfoDescription={#ExeName}
;MinVersion=0,5.01
DisableReadyPage=True
DiskSpanning=yes
//=========Без Сжатия
Compression=None
//=========Сильное сжатие
;SolidCompression=yes
//=========Нормальное сжатие(рекомендуется)
;Compression =lzma/normal
//=========разделять каждый файл по 21000000 байт
;DiskSliceSize=21000000
SlicesPerDisk=1
[Languages]
Name: "rus"; MessagesFile: "compiler:Languages\Russian.isl"
[Messages]
rus.WinVersionTooLowError=Программа установки несовместима с версией Вашей операционной системы.
rus.ExitSetupMessage=Вы действительно хотите отменить установку игры {#ExeName}?
rus.SelectDirDesc=
rus.SetupWindowTitle={#ExeName}
rus.InstallingLabel=Пожалуйста, подождите, пока игра установится на Ваш компьютер.
rus.UninstallAppTitle=Удаление
rus.UninstallAppFullTitle={#ExeName}
rus.ConfirmUninstall=Вы действительно хотите удалить игру {#ExeName}?
rus.UninstalledAll=Игра {#ExeName} была полностью удалена с Вашего компьютера.
rus.UninstalledMost=Удаление игры {#ExeName} завершено.%n%nЧасть элементов не удалось удалить. Вы можете удалить их самостоятельно.
rus.ButtonBack=< Назад
rus.ButtonNext=Далее >
rus.ButtonInstall=Установить
rus.ButtonFinish=Завершить
rus.ButtonWizardBrowse=Обзор...
[CustomMessages]
rus.Welcome=Приветствие
rus.Catalogue=Каталог
rus.StartMenu=Меню «Пуск»
rus.Installing=Установка
rus.Uninstalling=Удаление
rus.Finish=Завершение
rus.Uninstalling=Удаление
rus.Uninstall=Удалить игру {#ExeName}
rus.Welcome1=
rus.Welcome2=%n%n%n%nНажмите «Далее», чтобы продолжить, или «Отмена», чтобы выйти из программы установки.
rus.FreeSpace=Доступно места на диске:
rus.NeedSpace=Требуется места на диске:
rus.StartMenuFolderBrowse=
rus.NoProgramGroupCheck=Не создвать ярлыки в меню «Пуск»
rus.AllProgress=Общий прогресс распаковки игры:
rus.FinishedHeading=Завершение Мастера установки игры%n{#ExeName}
rus.FinishedLabel=Игра {#ExeVerName} была успешно установлена на Ваш компьютер.%n%nДля запуска игры выберите соответствующий ярлык в меню «Пуск» или на Рабочем столе.
rus.FinishedLabel2=Нажмите «Завершить», чтобы выйти из программы установки.
rus.WizardUninst=Состояние удаления
rus.UninstDescript=Пожалуйста, подождите, пока игра будет удалена с Вашего компьютера.
rus.StatusUninst=Удаление игры {#ExeName}...
rus.AllProgressUninst=Общий прогресс удаления игры:
[Files]
Source: "InstallFiles\*"; Flags: dontcopy;
Source: "InstallFiles\WizardImage.JPG"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\botva2.dll"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\StatusPanel2.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
;Source: "InstallFiles\StatusPanel.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\Button.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\back.cjstyles"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\Workspace.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\ISSkin.dll"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\InnoCallback.dll"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
;Source: "C:\Users\x_DARKStalker_x\Desktop\RePack\GTA Mod Edition\Готовая сборка\GTA VC - Mod Edition\Vice City.exe";DestDir: "{app}"; Flags: ignoreversion
;Source: "C:\Users\x_DARKStalker_x\Desktop\RePack\GTA Mod Edition\Готовая сборка\GTA VC - Mod Edition\*";DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{commondesktop}\GTA ViceCity - Mod Edition"; Filename: "{app}\Vice City.exe";
[Registry]
#define NeedSize "7432185788"
;Имя ехе файла
#define ExeName "GTA ViceCity"
[Setup]
AppName={#ExeName}
AppVerName={#ExeName}
AppPublisher=Repack by DarkSTALKER
DefaultDirName={pf}\GTA ViceCity - Mod Edition
DefaultGroupName=\GTA ViceCity - Mod Edition
DirExistsWarning=no
SetupIconFile=InstallFiles\GTAVICE.ico
VersionInfoDescription={#ExeName}
;MinVersion=0,5.01
DisableReadyPage=True
DiskSpanning=yes
//=========Без Сжатия
Compression=None
//=========Сильное сжатие
;SolidCompression=yes
//=========Нормальное сжатие(рекомендуется)
;Compression =lzma/normal
//=========разделять каждый файл по 21000000 байт
;DiskSliceSize=21000000
SlicesPerDisk=1
[Languages]
Name: "rus"; MessagesFile: "compiler:Languages\Russian.isl"
[Messages]
rus.WinVersionTooLowError=Программа установки несовместима с версией Вашей операционной системы.
rus.ExitSetupMessage=Вы действительно хотите отменить установку игры {#ExeName}?
rus.SelectDirDesc=
rus.SetupWindowTitle={#ExeName}
rus.InstallingLabel=Пожалуйста, подождите, пока игра установится на Ваш компьютер.
rus.UninstallAppTitle=Удаление
rus.UninstallAppFullTitle={#ExeName}
rus.ConfirmUninstall=Вы действительно хотите удалить игру {#ExeName}?
rus.UninstalledAll=Игра {#ExeName} была полностью удалена с Вашего компьютера.
rus.UninstalledMost=Удаление игры {#ExeName} завершено.%n%nЧасть элементов не удалось удалить. Вы можете удалить их самостоятельно.
rus.ButtonBack=< Назад
rus.ButtonNext=Далее >
rus.ButtonInstall=Установить
rus.ButtonFinish=Завершить
rus.ButtonWizardBrowse=Обзор...
[CustomMessages]
rus.Welcome=Приветствие
rus.Catalogue=Каталог
rus.StartMenu=Меню «Пуск»
rus.Installing=Установка
rus.Uninstalling=Удаление
rus.Finish=Завершение
rus.Uninstalling=Удаление
rus.Uninstall=Удалить игру {#ExeName}
rus.Welcome1=
rus.Welcome2=%n%n%n%nНажмите «Далее», чтобы продолжить, или «Отмена», чтобы выйти из программы установки.
rus.FreeSpace=Доступно места на диске:
rus.NeedSpace=Требуется места на диске:
rus.StartMenuFolderBrowse=
rus.NoProgramGroupCheck=Не создвать ярлыки в меню «Пуск»
rus.AllProgress=Общий прогресс распаковки игры:
rus.FinishedHeading=Завершение Мастера установки игры%n{#ExeName}
rus.FinishedLabel=Игра {#ExeVerName} была успешно установлена на Ваш компьютер.%n%nДля запуска игры выберите соответствующий ярлык в меню «Пуск» или на Рабочем столе.
rus.FinishedLabel2=Нажмите «Завершить», чтобы выйти из программы установки.
rus.WizardUninst=Состояние удаления
rus.UninstDescript=Пожалуйста, подождите, пока игра будет удалена с Вашего компьютера.
rus.StatusUninst=Удаление игры {#ExeName}...
rus.AllProgressUninst=Общий прогресс удаления игры:
[Files]
Source: "InstallFiles\*"; Flags: dontcopy;
Source: "InstallFiles\WizardImage.JPG"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\botva2.dll"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\StatusPanel2.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
;Source: "InstallFiles\StatusPanel.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\Button.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\back.cjstyles"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\Workspace.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\ISSkin.dll"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
Source: "InstallFiles\InnoCallback.dll"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system;
;Source: "C:\Users\x_DARKStalker_x\Desktop\RePack\GTA Mod Edition\Готовая сборка\GTA VC - Mod Edition\Vice City.exe";DestDir: "{app}"; Flags: ignoreversion
;Source: "C:\Users\x_DARKStalker_x\Desktop\RePack\GTA Mod Edition\Готовая сборка\GTA VC - Mod Edition\*";DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{commondesktop}\GTA ViceCity - Mod Edition"; Filename: "{app}\Vice City.exe";
[Registry]
Код:
type
TTimerProc = procedure (h: Longword; msg: Longword; idevent: Longword; dwTime: Longword);
TBtnEventProc = procedure (h:HWND);
TALabel = array of TLabel;
TPercentsProc = function (h:hWnd;Msg,wParam,lParam:Longint):Longint;
const
BtnClickEventID = 1;
BtnMouseEnterEventID = 2;
ARTitleTimerID = 2;
WFDiskTimerID = 1;
BASS_ACTIVE_PAUSED = 3;
BASS_SAMPLE_LOOP = 4;
var
Welcome, Catalogue, StartMenu, Installing, Finish, Uninstalling,
PageNameLabel, PageDescriptionLabel, GameNameLabel,
WelcomeLabel1, WelcomeLabel2,
SelectDirBrowseLabel, DirEditLabel, NeedSpaceLabel, FreeSpaceLabel,
SelectStartMenuFolderBrowseLabel, GroupEditLabel, NoIconsLabel,
FilenameLabel, PercentsLabel,
FinishedHeadingLabel, FinishedLabel,
WizardUninstLabel, UninstPageDescriptLabel, StatusUninstLabel, PercentsUninstLabel: TLabel;
StatusPanel, hNewCursor1, hNewCursor2, Edit, DirFolder, GroupFolder, PercentsOldProc: Longint;
MusicButton, mp3Handle, NoIconsCheck, Logotype,
hCancelBtn, hNextBtn, hBackBtn, hDirBrowseBtn, hGroupBrowseBtn, hCancelUninstBtn: HWND;
WFButtonFont, UPFButtonFont, GameNameFont, LogoFont : TFont;
IsCustomFontInstalled: boolean;
mp3Name, OldDisk, FontName: string;
FreeMB, TotalMB: Cardinal;
ADisk: TALabel;
function WrapBtnCallback(Callback: TBtnEventProc; ParamCount: Integer): Longword; external 'wrapcallback@{tmp}\innocallback.dll stdcall delayload';
function BtnCreate(hParent:HWND; Left,Top,Width,Height:integer; FileName:PAnsiChar; ShadowWidth:integer; IsCheckBtn:boolean):HWND; external 'BtnCreate@{tmp}\botva2.dll stdcall delayload';
procedure BtnRefresh(h:HWND); external 'BtnRefresh@{tmp}\botva2.dll stdcall delayload';
function BtnGetChecked(h:HWND):boolean; external 'BtnGetChecked@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetChecked(h:HWND; Value:boolean); external 'BtnSetChecked@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetText(h:HWND; Text:PAnsiChar); external 'BtnSetText@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetVisibility(h:HWND; Value:boolean); external 'BtnSetVisibility@{tmp}\botva2.dll stdcall delayload';
function BtnGetEnabled(h:HWND):boolean; external 'BtnGetEnabled@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetEnabled(h:HWND; Value:boolean); external 'BtnSetEnabled@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetFont(h:HWND; Font:Cardinal); external 'BtnSetFont@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetFontColor(h:HWND; NormalFontColor, FocusedFontColor, PressedFontColor, DisabledFontColor: Cardinal); external 'BtnSetFontColor@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetEvent(h:HWND; EventID:integer; Event:Longword); external 'BtnSetEvent@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetCursor(h:HWND; hCur:Cardinal); external 'BtnSetCursor@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetPosition(h:HWND; NewLeft, NewTop, NewWidth, NewHeight: integer); external 'BtnSetPosition@{tmp}\botva2.dll stdcall delayload';
function sndPlaySound(lpszSoundName: AnsiString; uFlags: cardinal):integer; external 'sndPlaySoundA@winmm.dll stdcall';
procedure LoadSkin(lpszPath: PAnsiChar; lpszIniFileName: PAnsiChar); external 'LoadSkin@{tmp}\isskin.dll stdcall delayload';
procedure UnloadSkin; external 'UnloadSkin@{tmp}\isskin.dll stdcall delayload';
function ShowWindow(hWnd: Integer; uType: Integer): Integer; external 'ShowWindow@user32.dll stdcall';
function ImgLoad(Wnd :HWND; FileName :PAnsiChar; Left, Top, Width, Height :integer; Stretch, IsBkg :boolean) :Longint; external 'ImgLoad@{tmp}\botva2.dll stdcall delayload';
procedure ImgSetPosition(img :Longint; NewLeft, NewTop, NewWidth, NewHeight :integer); external 'ImgSetPosition@{tmp}\botva2.dll stdcall delayload';
procedure ImgRelease(img :Longint); external 'ImgRelease@{tmp}\botva2.dll stdcall delayload';
procedure ImgSetVisibility(img :Longint; Visible :boolean); external 'ImgSetVisibility@{tmp}\botva2.dll stdcall delayload';
function ImgGetVisibility(img:Longint):boolean; external 'ImgGetVisibility@{tmp}\botva2.dll stdcall delayload';
procedure ImgApplyChanges(h:HWND); external 'ImgApplyChanges@{tmp}\botva2.dll stdcall delayload';
procedure gdipShutdown; external 'gdipShutdown@{tmp}\botva2.dll stdcall delayload';
function SetClassLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): DWORD; external 'SetClassLongA@user32.dll stdcall';
function DestroyCursor(hCursor: Longint): BOOL; external 'DestroyCursor@user32.dll stdcall';
function LoadCursorFromFile(lpFileName: PAnsiChar): Longint; external 'LoadCursorFromFileA@user32.dll stdcall';
function AddFontResource(FileName: PAnsiChar): Integer; external 'AddFontResourceA@gdi32.dll stdcall';
function RemoveFontResource(FileName: PAnsiChar): BOOL; external 'RemoveFontResourceA@gdi32.dll stdcall';
function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall';
function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): LongWord; external 'SetTimer@user32.dll stdcall';
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@user32.dll stdcall';
function WrapTimerProc(callback:TTimerProc; paramcount:integer):LongWord; external 'wrapcallback@{tmp}\innocallback.dll stdcall delayload';
function CallBackProc(P:TPercentsProc;ParamCount:integer):LongWord; external 'wrapcallback@{tmp}\innocallback.dll stdcall delayload';
function CallWindowProc(lpPrevWndFunc: Longint; hWnd: HWND; Msg: UINT; wParam, lParam: Longint): Longint; external 'CallWindowProcA@user32.dll stdcall';
function GetTickCount: DWord; external 'GetTickCount@kernel32 stdcall';
function ReleaseCapture: Longint; external 'ReleaseCapture@user32.dll stdcall';
function GetAppDir(Path: String): String;
begin
if RegKeyExists(HKLM, 'Software\divinity_2') then begin
RegQueryStringValue(HKLM, 'Software\The Thing', 'InstallPath', Path);
Result := Path end else
Result := ExpandConstant('{pf}\GSC World Publishing\The Thing')
end;
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('isskin.dll');
ExtractTemporaryFile('back.cjstyles');
LoadSkin(ExpandConstant('{tmp}\back.cjstyles'), '');
if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');
if not FileExists(ExpandConstant('{tmp}\innocallback.dll')) then ExtractTemporaryFile('innocallback.dll');
Result := True;
end;
procedure LabelOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
SendMessage(WizardForm.Handle,$0112,$F012,0);
end;
procedure GameName(h: Longword; msg: Longword; idevent: Longword; dwTime: Longword);
var
str: string;
begin
str:=GameNameLabel.Caption;
GameNameLabel.Caption:=Copy(str,2,Length(str)-1)+Copy(str,1,1);
end;
procedure CreateWizardImage;
//=======================задать размер окна
begin
with WizardForm do begin
ClientWidth:=ScaleX(790);
ClientHeight:=ScaleY(533);
OuterNotebook.Hide;
InnerNotebook.Hide;
Bevel.Hide;
Center;
ExtractTemporaryFile('WizardImage.JPG');
ExtractTemporaryFile('StatusPanel2.png');
ExtractTemporaryFile('Workspace.png');
ExtractTemporaryFile('Logo.png');
ExtractTemporaryFile('Edit.png');
ExtractTemporaryFile('DirFolder.png');
ExtractTemporaryFile('GroupFolder.png');
ExtractTemporaryFile('Cursor.ani');
ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\WizardImage.jpg'),ScaleX(0),ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\StatusPanel.png'),ScaleX(10), ScaleY(80),ScaleX(770),ScaleY(40),True,True);
StatusPanel:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\StatusPanel2.png'),ScaleX(8), ScaleY(74),ScaleX(117),ScaleY(48),True,True);
ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Workspace.png'),ScaleX(45), ScaleY(170),ScaleX(700),ScaleY(300),True,True);
Edit:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Edit.png'),ScaleX(125), ScaleY(347),ScaleX(460),ScaleY(22),True,True);
DirFolder:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\DirFolder.png'),ScaleX(75), ScaleY(280),ScaleX(40),ScaleY(56),True,True);
GroupFolder:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\GroupFolder.png'),ScaleX(75), ScaleY(280),ScaleX(40),ScaleY(56),True,True);
end;
ImgApplyChanges(WizardForm.Handle);
end;
//************************************************ [Начало - Текстуры кнопок] ***************************************************//
procedure SetStateNewButtons;
begin
with WizardForm.BackButton do begin
BtnSetText(hBackBtn,PAnsiChar(Caption));
BtnSetVisibility(hBackBtn,Visible);
BtnSetEnabled(hBackBtn,Enabled);
end;
with WizardForm.NextButton do begin
BtnSetText(hNextBtn,PAnsiChar(Caption));
BtnSetVisibility(hNextBtn,Visible);
BtnSetEnabled(hNextBtn,Enabled);
end;
with WizardForm.CancelButton do begin
BtnSetText(hCancelBtn,PAnsiChar(Caption));
BtnSetVisibility(hCancelBtn,Visible);
BtnSetEnabled(hCancelBtn,Enabled);
end;
BtnSetText(hDirBrowseBtn,PAnsiChar(WizardForm.DirBrowseButton.Caption));
BtnSetText(hGroupBrowseBtn,PAnsiChar(WizardForm.GroupBrowseButton.Caption));
end;
procedure WizardFormBtnClick(hBtn:HWND);
var
Btn:TButton;
begin
sndPlaySound(ExpandConstant('{tmp}\Click.wav'),$0001);
case hBtn of
hCancelBtn: Btn:=WizardForm.CancelButton;
hNextBtn: Btn:=WizardForm.NextButton;
hBackBtn: Btn:=WizardForm.BackButton;
hDirBrowseBtn: Btn:=WizardForm.DirBrowseButton;
hGroupBrowseBtn: Btn:=WizardForm.GroupBrowseButton;
end;
Btn.OnClick(Btn);
SetStateNewButtons;
BtnRefresh(hBtn);
end;
procedure WFBtnEnter(hBtn:HWND);
begin
sndPlaySound(ExpandConstant('{tmp}\Enter.wav'),$0001);
end;
procedure ButtonsTextures;
begin
ExtractTemporaryFile('button.png');
ExtractTemporaryFile('Enter.wav');
ExtractTemporaryFile('Click.wav');
ExtractTemporaryFile('Cursor2.ani');
ExtractTemporaryFile('Hamurz Free Version.ttf');
IsCustomFontInstalled:=AddFontResource(ExpandConstant('{tmp}')+'\Alterna.ttf')>0;
if IsCustomFontInstalled then PostMessage(HWND_BROADCAST,$1D,0,0);
if FontExists('Alterna') then FontName:='Alterna' else FontName:='Arial';
if IsCustomFontInstalled then FontName:='Alterna';
WFButtonFont:=TFont.Create;
with WFButtonFont do begin
Name:=FontName;
Color:=$FFFFFF;
Style:=[fsBold];
Size:=11;
end;
with WizardForm.BackButton do begin
hBackBtn:=BtnCreate(WizardForm.Handle,Left+120,Top+155,Width+40,Height+3,ExpandConstant('{tmp}\button.png'),0,False);
BtnSetEvent(hBackBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hBackBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hBackBtn,WFButtonFont.Handle);
BtnSetFontColor(hBackBtn,$DAE369,$00FFFF,$0000FF,$B6B6B6);
BtnSetCursor(hBackBtn,LoadCursorFromFile(ExpandConstant('{tmp}\Cursor2.ani')));
Width:=0;
Height:=0;
end;
with WizardForm.NextButton do begin
hNextBtn:=BtnCreate(WizardForm.Handle,Left+170,Top+155,Width+40,Height+3,ExpandConstant('{tmp}\button.png'),0,False);
BtnSetEvent(hNextBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hNextBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hNextBtn,WFButtonFont.Handle);
BtnSetFontColor(hNextBtn,$DAE369,$00FFFF,$0000FF,$B6B6B6);
BtnSetCursor(hNextBtn,LoadCursorFromFile(ExpandConstant('{tmp}\Cursor2.ani')));
Width:=0;
Height:=0;
end;
with WizardForm.CancelButton do begin
hCancelBtn:=BtnCreate(WizardForm.Handle,Left+210,Top+155,Width+40,Height+3,ExpandConstant('{tmp}\button.png'),0,False);
BtnSetEvent(hCancelBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hCancelBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hCancelBtn,WFButtonFont.Handle);
BtnSetFontColor(hCancelBtn,$DAE369,$00FFFF,$0000FF,$B6B6B6);
BtnSetCursor(hCancelBtn,LoadCursorFromFile(ExpandConstant('{tmp}\Cursor2.ani')));
Width:=0;
Height:=0;
end;
with WizardForm.DirBrowseButton do begin
hDirBrowseBtn:=BtnCreate(WizardForm.Handle,Left+260,Top+265,Width+40,Height+3,ExpandConstant('{tmp}\button.png'),0,False);
BtnSetEvent(hDirBrowseBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hDirBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hDirBrowseBtn,WFButtonFont.Handle);
BtnSetFontColor(hDirBrowseBtn,$DAE369,$00FFFF,$0000FF,$B6B6B6);
BtnSetCursor(hDirBrowseBtn,LoadCursorFromFile(ExpandConstant('{tmp}\Cursor2.ani')));
Width:=0;
Height:=0;
end;
with WizardForm.GroupBrowseButton do begin
hGroupBrowseBtn:=BtnCreate(WizardForm.Handle,Left+260,Top+265,Width+40,Height+3,ExpandConstant('{tmp}\button.png'),0,False);
BtnSetEvent(hGroupBrowseBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hGroupBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hGroupBrowseBtn,WFButtonFont.Handle);
BtnSetFontColor(hGroupBrowseBtn,$DAE369,$00FFFF,$0000FF,$B6B6B6);
BtnSetCursor(hGroupBrowseBtn,LoadCursorFromFile(ExpandConstant('{tmp}\Cursor2.ani')));
Width:=0;
Height:=0;
end;
end;
//************************************************ [Конец - Текстуры кнопок] ***************************************************//
//************************************************ [Начало - Музыка] ***************************************************//
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; offset: DWORD; length: DWORD; flags: DWORD): DWORD; external 'BASS_StreamCreateFile@files:BASS.dll stdcall delayload';
function BASS_Start: Boolean; external 'BASS_Start@files:BASS.dll stdcall delayload';
function BASS_ChannelPlay(handle: DWORD; restart: BOOL): Boolean; external 'BASS_ChannelPlay@files:BASS.dll stdcall delayload';
function BASS_ChannelIsActive(handle: DWORD): Integer; external 'BASS_ChannelIsActive@files:BASS.dll stdcall delayload';
function BASS_ChannelPause(handle: DWORD): Boolean; external 'BASS_ChannelPause@files:BASS.dll stdcall delayload';
function BASS_Pause: Boolean; external 'BASS_Pause@files:BASS.dll stdcall delayload';
function BASS_Stop: Boolean; external 'BASS_Stop@files:BASS.dll stdcall delayload';
function BASS_Free: Boolean; external 'BASS_Free@files:BASS.dll stdcall delayload';
procedure MusicButtonClick(hBtn:HWND);
begin
sndPlaySound(ExpandConstant('{tmp}\Click.wav'), $0001);
if BtnGetChecked(MusicButton) then BASS_ChannelPause(mp3Handle)
else if BASS_ChannelIsActive(mp3Handle)=BASS_ACTIVE_PAUSED then BASS_ChannelPlay(mp3Handle, False);
end;
procedure InsertMusic;
begin
ExtractTemporaryFile('MusicButton.png');
ExtractTemporaryFile('BASS.dll');
ExtractTemporaryFile('Music.mp3');
MusicButton:=BtnCreate(WizardForm.Handle,ScaleX(730),ScaleY(20),ScaleX(35),ScaleY(35),ExpandConstant('{tmp}\MusicButton.png'),0,True);
BtnSetEvent(MusicButton,BtnClickEventID,WrapBtnCallback(@MusicButtonClick,1));
BtnSetEvent(MusicButton,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetVisibility(MusicButton,True);
BtnSetCursor(MusicButton,LoadCursorFromFile(ExpandConstant('{tmp}\Cursor2.ani')));
mp3Name:=ExpandConstant('{tmp}\Music.mp3');
BASS_Init(-1,44100,0,0,0);
mp3Handle:=BASS_StreamCreateFile(FALSE,PAnsiChar(mp3Name),0,0,BASS_SAMPLE_LOOP);
BASS_Start;
BASS_ChannelPlay(mp3Handle,False);
end;
//************************************************ [Конец - Музыка] ***************************************************//
//************************************************ [Начало - Панель] ***************************************************//
procedure CreateStatusPanel;
begin
Welcome := TLabel.Create(WizardForm);
with Welcome do begin
AutoSize:=False;
SetBounds(ScaleX(30), ScaleY(92), ScaleX(110), ScaleY(20));
Transparent:=True;
Font.Name:= 'Arial';
Font.Color := $00FFFF;
Font.Size:= 9;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:Welcome}');
Parent := WizardForm;
end;
Catalogue := TLabel.Create(WizardForm);
with Catalogue do begin
AutoSize:=False;
SetBounds(ScaleX(210), ScaleY(92), ScaleX(110), ScaleY(20));
Transparent:=True;
Font.Name:= 'Arial';
Font.Color := $FFFFFF;
Font.Size:= 9;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:Catalogue}');
Parent := WizardForm;
end;
StartMenu := TLabel.Create(WizardForm);
with StartMenu do begin
AutoSize:=False;
SetBounds(ScaleX(355), ScaleY(92), ScaleX(80), ScaleY(20));
Transparent:=True;
Font.Name:= 'Arial';
Font.Color := $FFFFFF;
Font.Size:= 9;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:StartMenu}');
Parent := WizardForm;
end;
Installing := TLabel.Create(WizardForm);
with Installing do begin
AutoSize:=False;
SetBounds(ScaleX(530), ScaleY(92), ScaleX(114), ScaleY(20));
Transparent:=True;
Font.Name:= 'Arial';
Font.Color := $FFFFFF;
Font.Size:= 9;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:Installing}');
Parent := WizardForm;
end;
Finish := TLabel.Create(WizardForm);
with Finish do begin
AutoSize:=False;
SetBounds(ScaleX(685), ScaleY(92), ScaleX(114), ScaleY(20));
Transparent:=True;
Font.Name:= 'Arial';
Font.Color := $FFFFFF;
Font.Size:= 9;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:Finish}');
Parent := WizardForm;
end;
end;
//************************************************ [Конец - Панель] ***************************************************//
//************************************************ [Начало - Компоненты страниц] ***************************************************//
procedure GroupChange(Sender: TObject);
begin
GroupEditLabel.Caption := MinimizePathName(WizardForm.GroupEdit.Text, GroupEditLabel.Font, GroupEditLabel.Width);
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 MbOrTB(Float: Extended): string;
begin
if Float<1024 then Result:=NumToStr(Float)+' MB'
else if (Float/1024)<1024 then Result:=NumToStr(Float/1024)+' GB'
else if (Float/(1024*1024))<1024 then Result:=NumToStr(Float/(1024*1024))+' TB'
end;
procedure DiskFlashing(h: Longword; msg: Longword; idevent: Longword; dwTime: Longword);
var
i:integer;
begin
for i:= 0 to GetArrayLength(ADisk)-1 do
if ADisk[i].Font.Color=$FFFFFF then ADisk[i].Font.Color:=$0000FF else ADisk[i].Font.Color:=$FFFFFF;
end;
function GetElementIndex(a:TALabel; lbl:TLabel):integer;
var
i:integer;
f:boolean;
begin
Result:=-1;
f:=False;
for i:=0 to GetArrayLength(a)-1 do
if a[i]=lbl then begin
f:=True;
Break;
end;
if f then Result:=i;
end;
procedure AddLabelToArray(var a:TALabel; lbl:TLabel);
begin
if GetElementIndex(a,lbl)=-1 then begin
SetArrayLength(a,GetArrayLength(a)+1);
a[GetArrayLength(a)-1]:=lbl;
end;
end;
procedure DeleteLabelFromArray(var a:TALabel; lbl:integer);
var
Last,i:integer;
begin
if lbl<>-1 then begin
Last:=GetArrayLength(a)-1;
if lbl<Last then
for i:=lbl to Last-1 do a[i]:=a[i+1];
SetArrayLength(a,Last);
end;
end;
procedure GetFreeSpaceCaption(Sender: TObject);
var
CurrentDisk: String;
i:integer;
begin
CurrentDisk:=ExtractFileDrive(WizardForm.DirEdit.Text);
DirEditLabel.Caption:=MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
if not GetSpaceOnDisk(CurrentDisk,True,FreeMB,TotalMB) then begin
KillTimer(WizardForm.Handle,WFDiskTimerID);
SetArrayLength(ADisk,0);
FreeSpaceLabel.Visible:=False;
BtnSetEnabled(hNextBtn,False);
WizardForm.NextButton.Enabled:=False;
OldDisk:=CurrentDisk;
Exit;
end;
FreeSpaceLabel.Visible:=True;
if CurrentDisk<>OldDisk then begin
OldDisk:=CurrentDisk;
FreeSpaceLabel.Caption := ExpandConstant('{cm:FreeSpace} ') + MbOrTB(FreeMb) + ' (' + IntToStr((FreeMb*100) div TotalMB) + ' %)';
if WizardForm.CurPageID = wpSelectDir then begin
if FreeMB>={#NeedSize} then begin
i:=GetElementIndex(ADisk,FreeSpaceLabel);
if i<>-1 then begin
DeleteLabelFromArray(ADisk,i);
FreeSpaceLabel.Font.Color:=$FFFFFF;
if GetArrayLength(ADisk)=0 then KillTimer(WizardForm.Handle,WFDiskTimerID);
end;
end else AddLabelToArray(ADisk,FreeSpaceLabel);
if GetArrayLength(ADisk)>0 then SetTimer(WizardForm.Handle,WFDiskTimerID,1000,WrapTimerProc(@DiskFlashing,4));
BtnSetEnabled(hNextBtn,not (GetArrayLength(ADisk)>0));
WizardForm.NextButton.Enabled:=not (GetArrayLength(ADisk)>0);
end;
end;
end;
function NoIcons: Boolean;
begin
Result:= BtnGetEnabled(hGroupBrowseBtn);
end;
procedure NoIconsClick(hBtn:HWND);
var
Check:boolean;
begin
sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001);
Check:=BtnGetChecked(hBtn);
BtnSetEnabled(hGroupBrowseBtn, not Check);
GroupEditLabel.Enabled:=not Check;
if Check then NoIconsLabel.Font.Color:=$008080 else NoIconsLabel.Font.Color:=$FFFFFF;
end;
procedure NoIconsLabelClick(Sender:TObject);
begin
BtnSetChecked(NoIconsCheck, not BtnGetChecked(NoIconsCheck));
NoIconsClick(NoIconsCheck);
end;
procedure LogoOnClick(hBtn:HWND);
var
ErrCode:integer;
begin
sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
end;
procedure CreatePageComponents;
begin
PageNameLabel:=TLabel.Create(WizardForm);
with PageNameLabel do begin
AutoSize:= False;
SetBounds(ScaleX(85), ScaleY(230), ScaleX(500), ScaleY(22));
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 12;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Parent:=WizardForm;
end;
PageDescriptionLabel:=TLabel.Create(WizardForm);
with PageDescriptionLabel do begin
AutoSize:= False;
SetBounds(ScaleX(105), ScaleY(260), ScaleX(580), ScaleY(20));
Wordwrap:= True;
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 9;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Parent:=WizardForm;
end;
GameNameLabel:= TLabel.Create(WizardForm);
with GameNameLabel do begin
Parent:= WizardForm;
AutoSize:= False;
SetBounds(ScaleX(80), ScaleY(190), ScaleX(555), ScaleY(20));
Transparent:= True;
Caption:= ExpandConstant('{#ExeName} ');
Font.Color:=$00FFFF;
Font.Size:=16;
Font.Name:= FontName;
Font.Style:= [fsBold];
end;
SetTimer(WizardForm.Handle,ARTitleTimerID,120,WrapTimerProc(@GameName,4));
LogoFont:=TFont.Create;
with LogoFont do begin
Name:=FontName;
Style:=[fsBold];
Size:=14;
end;
Logotype:=BtnCreate(WizardForm.Handle,ScaleX(50),ScaleY(490),ScaleX(110),ScaleY(19),ExpandConstant('{tmp}\Logo.png'),0,False);
BtnSetEvent(Logotype,BtnClickEventID,WrapBtnCallback(@LogoOnClick,1));
BtnSetEvent(Logotype,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetFont(Logotype,LogoFont.Handle);
BtnSetFontColor(Logotype,$008000,$FF0000,$0000FF,$B6B6B6);
BtnSetText(Logotype,ExpandConstant('{#SetupSetting("AppPublisher")}'));
BtnSetCursor(Logotype,LoadCursorFromFile(ExpandConstant('{tmp}\Cursor2.ani')));
////////////////////// WelcomePage //////////////////////
WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do begin
AutoSize:=False
SetBounds(ScaleX(100), ScaleY(230), ScaleX(590), ScaleY(55));
WordWrap:=True
Alignment := taCenter;
Transparent:=True
Font.Name:='Georgia';
Font.Size:= 15;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold]
Caption:= ExpandConstant('{cm:Welcome1}');
Parent:=WizardForm
end;
WelcomeLabel2:=TLabel.Create(WizardForm);
with WelcomeLabel2 do begin
AutoSize:=False
SetBounds(ScaleX(90), ScaleY(295), ScaleX(610), ScaleY(130));
WordWrap:=True
Transparent:=True
Font.Name:='Georgia';
Font.Size:= 12;
Font.Color:=$FFFFFF;
Font.Style := [fsBold, fsItalic];
Caption:= ExpandConstant('{cm:Welcome2}');
Parent:=WizardForm
end;
////////////////////// WelcomePage //////////////////////
////////////////////// SelectDirPage //////////////////////
SelectDirBrowseLabel := TLabel.Create(WizardForm);
with SelectDirBrowseLabel do begin
AutoSize:=False;
SetBounds(ScaleX(125), ScaleY(295), ScaleX(590), ScaleY(35));
WordWrap:= True;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Caption:= WizardForm.SelectDirBrowseLabel.Caption;
Parent := WizardForm;
end;
DirEditLabel := TLabel.Create(WizardForm);
with DirEditLabel do begin
AutoSize:=False;
SetBounds(ScaleX(132), ScaleY(350), ScaleX(446), ScaleY(15));
WordWrap:= True;
ShowAccelChar := False;
Transparent:=True;
Font.Name:= 'Arial'
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption := MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
Parent := WizardForm;
end;
//////////////////////=====Настройка бегущей строки
NeedSpaceLabel := TLabel.Create(WizardForm);
with NeedSpaceLabel do begin
AutoSize:=False;
SetBounds(ScaleX(125), ScaleY(390), ScaleX(270), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 28;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Caption := ExpandConstant('{cm:NeedSpace} ') + MbOrTB({#NeedSize});
Parent := WizardForm;
end;
FreeSpaceLabel := TLabel.Create(WizardForm);
with FreeSpaceLabel do begin
AutoSize:=False;
SetBounds(ScaleX(125), ScaleY(410), ScaleX(280), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 28;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Parent := WizardForm;
end;
////////////////////// SelectDirPage //////////////////////
////////////////////// SelectProgramGroupPage //////////////////////
SelectStartMenuFolderBrowseLabel := TLabel.Create(WizardForm);
with SelectStartMenuFolderBrowseLabel do begin
AutoSize:=False;
SetBounds(ScaleX(125), ScaleY(295), ScaleX(590), ScaleY(35));
WordWrap:= True;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 9;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Caption:= ExpandConstant('{cm:StartMenuFolderBrowse}');
Parent := WizardForm;
end;
GroupEditLabel := TLabel.Create(WizardForm);
with GroupEditLabel do begin
AutoSize:=False;
SetBounds(ScaleX(132), ScaleY(350), ScaleX(446), ScaleY(15));
WordWrap:= True;
ShowAccelChar := False;
Transparent:=True;
Font.Name:= 'Arial'
Font.Size:= 9;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption := MinimizePathName(WizardForm.GroupEdit.Text, GroupEditLabel.Font, GroupEditLabel.Width);
Parent := WizardForm;
end;
ExtractTemporaryFile('Check.wav');
ExtractTemporaryFile('CheckBox.png');
NoIconsCheck:=BtnCreate(WizardForm.Handle,ScaleX(120),ScaleY(400),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\CheckBox.png'),8,True);
BtnSetEvent(NoIconsCheck,BtnClickEventID,WrapBtnCallback(@NoIconsClick,1));
BtnSetEvent(NoIconsCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetCursor(NoIconsCheck,LoadCursorFromFile(ExpandConstant('{tmp}\Cursor2.ani')));
WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
WizardForm.GroupEdit.OnChange := @GroupChange;
////////////////////// SelectProgramGroupPage //////////////////////
////////////////////// InstallingPage //////////////////////
FilenameLabel := TLabel.Create(WizardForm);
with FilenameLabel do begin
AutoSize:=False;
SetBounds(ScaleX(125), ScaleY(295), ScaleX(540), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 9;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold,fsItalic];
Parent := WizardForm;
end;
PercentsLabel := TLabel.Create(WizardForm);
with PercentsLabel do
begin
AutoSize:=False;
SetBounds(ScaleX(240), ScaleY(375), ScaleX(350), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold,fsItalic];
Parent := WizardForm;
end;
WizardForm.ProgressGauge.Parent:=WizardForm;
WizardForm.ProgressGauge.SetBounds(ScaleX(125), ScaleY(330), ScaleX(540), ScaleY(25));
////////////////////// InstallingPage //////////////////////
////////////////////// FinishedPage //////////////////////
FinishedHeadingLabel:= TLabel.Create(WizardForm);
with FinishedHeadingLabel do begin
AutoSize:=False
SetBounds(ScaleX(100), ScaleY(230), ScaleX(590), ScaleY(55));
WordWrap:=True
Alignment := taCenter;
Transparent:=True
Font.Name:='Georgia';
Font.Size:= 15;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold]
Caption:= ExpandConstant('{cm:FinishedHeading}');
Parent:=WizardForm
end;
FinishedLabel:=TLabel.Create(WizardForm);
with FinishedLabel do begin
AutoSize:=False
SetBounds(ScaleX(90), ScaleY(295), ScaleX(610), ScaleY(130));
WordWrap:=True
Transparent:=True
Font.Name:='Georgia';
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style := [fsBold, fsItalic];
Caption:= ExpandConstant('{cm:FinishedLabel}')+#13#13+ExpandConstant('{cm:FinishedLabel2}');
Parent:=WizardForm
end;
with TLabel.Create(WizardForm) do begin
AutoSize:=False;
Parent:=WizardForm;
SetBounds(ScaleX(0), ScaleY(0), WizardForm.Width, WizardForm.Height);
OnMouseDown:=@LabelOnMouseDown;
Transparent:=True;
end;
NoIconsLabel := TLabel.Create(WizardForm);
with NoIconsLabel do begin
AutoSize:=False;
SetBounds(ScaleX(157), ScaleY(408), ScaleX(250), ScaleY(17));
OnClick:= @NoIconsLabelClick;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 9;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold,fsItalic];
Caption := ExpandConstant('{cm:NoProgramGroupCheck}');
Parent := WizardForm;
end;
end;
////////////////////// FinishedPage //////////////////////
////////////////////// UninstallingPage //////////////////////
function InitializeUninstall: Boolean;
begin
FileCopy(ExpandConstant('{app}\botva2.dll'), ExpandConstant('{tmp}\botva2.dll'), False);
FileCopy(ExpandConstant('{app}\InnoCallback.dll'), ExpandConstant('{tmp}\InnoCallback.dll'), False);
FileCopy(ExpandConstant('{app}\isskin.dll'), ExpandConstant('{tmp}\isskin.dll'), False);
FileCopy(ExpandConstant('{app}\STALKER.cjstyles'), ExpandConstant('{tmp}\STALKER.cjstyles'), False);
LoadSkin(ExpandConstant('{tmp}\STALKER.cjstyles'), '');
Result:=True;
end;
// ==================================настройка окна игры
procedure InitializeUninstallProgressForm;
var
h:HWND;
begin
with UninstallProgressForm do begin
Position:=poScreenCenter;
ClientWidth:=ScaleX(790);
ClientHeight:=ScaleY(533);
BorderStyle:=bsSingle
BorderIcons:=[biSystemMenu]
OuterNotebook.Hide;
InnerNotebook.Hide;
Bevel.Hide;
UninstallProgressForm.ProgressBar.Parent:=UninstallProgressForm;
UninstallProgressForm.ProgressBar.SetBounds(ScaleX(125), ScaleY(330), ScaleX(540), ScaleY(25));
WizardUninstLabel := TLabel.Create(UninstallProgressForm);
with WizardUninstLabel do begin
AutoSize:=False;
SetBounds(ScaleX(85), ScaleY(230), ScaleX(500), ScaleY(22));
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 32;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption:= ExpandConstant('{cm:WizardUninst}');
Parent := UninstallProgressForm;
end;
UninstPageDescriptLabel := TLabel.Create(UninstallProgressForm);
with UninstPageDescriptLabel do begin
AutoSize:=False;
SetBounds(ScaleX(105), ScaleY(260), ScaleX(580), ScaleY(20));
WordWrap:= True;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 29;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Caption:= ExpandConstant('{cm:UninstDescript}');
Parent := UninstallProgressForm;
end;
StatusUninstLabel := TLabel.Create(UninstallProgressForm);
with StatusUninstLabel do begin
AutoSize:=False;
SetBounds(ScaleX(125), ScaleY(295), ScaleX(540), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 19;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Caption:= ExpandConstant('{cm:StatusUninst}');
Parent := UninstallProgressForm;
end;
Installing := TLabel.Create(UninstallProgressForm);
with Installing do begin
AutoSize:=False;
SetBounds(ScaleX(172), ScaleY(92), ScaleX(60), ScaleY(20));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:Installing}');
Parent := UninstallProgressForm;
end;
Uninstalling := TLabel.Create(UninstallProgressForm);
with Uninstalling do begin
AutoSize:=False;
SetBounds(ScaleX(557), ScaleY(92), ScaleX(60), ScaleY(20));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:=$00FFFF;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:Uninstalling}');
Parent := UninstallProgressForm;
end;
PercentsUninstLabel := TLabel.Create(UninstallProgressForm);
with PercentsUninstLabel do begin
AutoSize:=False;
SetBounds(ScaleX(240), ScaleY(375), ScaleX(350), ScaleY(17));
Alignment := taCenter;
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold,fsItalic];
Parent := UninstallProgressForm;
end;
h:=UninstallProgressForm.Handle;
FileCopy(ExpandConstant('{app}\WizardImage.jpg'), ExpandConstant('{tmp}\WizardImage.jpg'), False);
FileCopy(ExpandConstant('{app}\Workspace.png'), ExpandConstant('{tmp}\Workspace.png'), False);
FileCopy(ExpandConstant('{app}\StatusPanel.png'), ExpandConstant('{tmp}\StatusPanel.png'), False);
FileCopy(ExpandConstant('{app}\StatusPanel2.png'), ExpandConstant('{tmp}\StatusPanel2.png'), False);
FileCopy(ExpandConstant('{app}\button.png'), ExpandConstant('{tmp}\button.png'), False);
ImgLoad(h,ExpandConstant('{tmp}\WizardImage.jpg'),ScaleX(0),ScaleY(0),UninstallProgressForm.ClientWidth,UninstallProgressForm.ClientHeight,True,True);
ImgLoad(h,ExpandConstant('{tmp}\Workspace.png'),ScaleX(45), ScaleY(170),ScaleX(700),ScaleY(300),True,True);
ImgLoad(h,ExpandConstant('{tmp}\StatusPanel.png'),ScaleX(10), ScaleY(80),ScaleX(770),ScaleY(40),True,True);
ImgLoad(h,ExpandConstant('{tmp}\StatusPanel2.png'),ScaleX(527), ScaleY(74),ScaleX(117), ScaleY(48),True,True);
UPFButtonFont:=TFont.Create;
UPFButtonFont.Style:=[fsBold];
UninstallProgressForm.CancelButton.Visible:=False;
with UninstallProgressForm.CancelButton do begin
hCancelUninstBtn:=BtnCreate(h,Left+210,Top+155,Width+40,Height+3,ExpandConstant('{tmp}\button.png'),0,False);
BtnSetText(hCancelUninstBtn, UninstallProgressForm.CancelButton.Caption);
BtnSetFont(hCancelUninstBtn,UPFButtonFont.Handle);
BtnSetFontColor(hCancelUninstBtn,$DAE369,$00FFFF,$0000FF,$B6B6B6);
BtnSetEnabled(hCancelUninstBtn,False);
end;
end;
ImgApplyChanges(h);
end;
////////////////////// UninstallingPage //////////////////////
procedure HideComponents;
begin
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
WizardForm.InfoBeforeMemo.Hide;
SelectDirBrowseLabel.Hide;
DirEditLabel.Hide;
FreeSpaceLabel.Hide;
NeedSpaceLabel.Hide;
SelectStartMenuFolderBrowseLabel.Hide;
GroupEditLabel.Hide;
NoIconsLabel.Hide;
FilenameLabel.Hide;
PercentsLabel.Hide;
WizardForm.ProgressGauge.Hide
FinishedHeadingLabel.Hide;
FinishedLabel.Hide;
end;
procedure ShowComponents(CurPageID: Integer);
begin
PageNameLabel.Caption:=WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption:=WizardForm.PageDescriptionLabel.Caption;
case CurPageID of
wpWelcome:
begin
Welcome.Font.Color := $00FFFF;
ImgSetPosition(StatusPanel,ScaleX(8),ScaleY(74),ScaleX(117),ScaleY(48));
WelcomeLabel1.Show;
WelcomeLabel2.Show;
end;
wpSelectDir:
begin
Catalogue.Font.Color := $00FFFF;
ImgSetPosition(StatusPanel,ScaleX(174),ScaleY(74),ScaleX(117),ScaleY(48));
ImgSetVisibility(Edit,True);
ImgSetVisibility(DirFolder,True);
BtnSetVisibility(hDirBrowseBtn,True);
SelectDirBrowseLabel.Show
DirEditLabel.Show;
FreeSpaceLabel.Show;
NeedSpaceLabel.Show;
end;
wpSelectProgramGroup:
begin
StartMenu.Font.Color := $00FFFF;
ImgSetPosition(StatusPanel,ScaleX(336),ScaleY(74),ScaleX(117),ScaleY(48));
ImgSetVisibility(Edit,True);
ImgSetVisibility(GroupFolder,True);
BtnSetVisibility(hGroupBrowseBtn,True);
BtnSetVisibility(NoIconsCheck,True);
SelectStartMenuFolderBrowseLabel.Show;
GroupEditLabel.Show;
NoIconsLabel.Show;
WizardForm.NextButton.Caption:=SetupMessage(msgButtonInstall);
end;
wpInstalling:
begin
Installing.Font.Color := $00FFFF;
ImgSetPosition(StatusPanel,ScaleX(500),ScaleY(74),ScaleX(117),ScaleY(48));
FilenameLabel.Show;
PercentsLabel.Show;
WizardForm.ProgressGauge.Show;
end;
wpFinished:
begin
Finish.Font.Color := $00FFFF;
ImgSetPosition(StatusPanel,ScaleX(662),ScaleY(74),ScaleX(117),ScaleY(48));
BtnSetPosition(hNextBtn, ScaleX(622),ScaleY(482),ScaleX(115),ScaleY(26));
FinishedHeadingLabel.Show;
FinishedLabel.Show;
end
end;
end;
//************************************************ [Конец - Компоненты страниц] ***************************************************//
//************************************************ [Начало - Процент распаковки] ***************************************************//
function PercentsProc(h:hWnd;Msg,wParam,lParam:Longint):Longint;
var
pr,i1,i2:Extended;
Percents:string;
begin
Result:=CallWindowProc(PercentsOldProc,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;
Percents:= Format(' %f',[pr])+' %';
StringChange(Percents,',','.');
PercentsLabel.Caption:=ExpandConstant('{cm:AllProgress} ')+Percents;
if FileNameLabel.Caption<>WizardForm.FilenameLabel.Caption then FileNameLabel.Caption:=WizardForm.FilenameLabel.Caption;
end;
end;
function PercentsProcUninst(h:hWnd;Msg,wParam,lParam:Longint):Longint;
var
pr,i1,i2:Extended;
Percents:string;
begin
if Msg=$2 then SetWindowLong(h,-4,PercentsOldProc);
Result:=CallWindowProc(PercentsOldProc,h,Msg,wParam,lParam);
if (Msg=$402) and (UninstallProgressForm.ProgressBar.Position>UninstallProgressForm.ProgressBar.Min) then begin
i1:=UninstallProgressForm.ProgressBar.Position-UninstallProgressForm.ProgressBar.Min;
i2:=UninstallProgressForm.ProgressBar.Max-UninstallProgressForm.ProgressBar.Min;
pr:=i1*100/i2;
Percents:= Format(' %f',[pr])+' %';
PercentsUninstLabel.Caption:=ExpandConstant('{cm:AllProgressUninst} ')+Percents;
end;
end;
//************************************************ [Конец - Процент распаковки] ***************************************************//
procedure CurStepChanged(CurStep: TSetupStep);
begin
case CurStep of
ssInstall: begin
PercentsOldProc:=SetWindowLong(WizardForm.ProgressGauge.Handle,-4,CallBackProc(@PercentsProc,4));
if GetArrayLength(ADisk)>0 then begin
KillTimer(WizardForm.Handle,WFDiskTimerID);
SetArrayLength(ADisk,0);
end;
end;
ssPostInstall: SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PercentsOldProc);
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
case CurUninstallStep of
usUninstall:
PercentsOldProc:=SetWindowLong(UninstallProgressForm.ProgressBar.Handle,-4,CallBackProc(@PercentsProcUninst,4));
end;
end;
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
if CurPageID=wpInstalling then begin
Confirm:=False;
Cancel:=ExitSetupMsgBox;
if Cancel then begin
SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PercentsOldProc);
FileNameLabel.Caption:=SetupMessage(msgStatusRollback);
PercentsLabel.Hide;
WizardForm.CancelButton.Enabled:=False;
end;
end;
end;
procedure InitializeWizard();
begin
CreateStatusPanel;
CreateWizardImage;
ButtonsTextures;
InsertMusic;
CreatePageComponents;
hNewCursor1:=LoadCursorFromFile(ExpandConstant('{tmp}')+'\Cursor1.ani');
if hNewCursor1<>0 then SetClassLong(WizardForm.Handle,-12,hNewCursor1);
end;
procedure CurPageChanged(CurPageID: Integer);
begin
SetStateNewButtons;
Welcome.Font.Color := $FFFFFF;
Catalogue.Font.Color := $FFFFFF;
StartMenu.Font.Color := $FFFFFF;
Installing.Font.Color :=$FFFFFF;
Finish.Font.Color := $FFFFFF;
HideComponents;
ImgSetVisibility(Edit,False);
ImgSetVisibility(DirFolder,False);
ImgSetVisibility(GroupFolder,False);
BtnSetVisibility(hDirBrowseBtn,False);
BtnSetVisibility(hGroupBrowseBtn,False);
BtnSetVisibility(NoIconsCheck,False);
ShowComponents(CurPageID);
ImgApplyChanges(WizardForm.Handle);
if CurPageID=wpSelectDir then begin
OldDisk:='';
GetFreeSpaceCaption(nil);
end else if GetArrayLength(ADisk)>0 then KillTimer(WizardForm.Handle,WFDiskTimerID);
end;
procedure DeinitializeSetup();
begin
gdipShutdown;
BASS_Stop;
BASS_Free;
WFButtonFont.Free;
LogoFont.Free;
KillTimer(WizardForm.Handle,ARTitleTimerID);
ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
UnloadSkin();
if hNewCursor1<>0 then DestroyCursor(hNewCursor1);
if IsCustomFontInstalled then
if RemoveFontResource(ExpandConstant('{tmp}')+'\Alterna.ttf') then PostMessage(HWND_BROADCAST,$1D,0,0);
end;
procedure DeinitializeUninstall;
begin
gdipShutdown;
UnloadSkin;
if Assigned(UPFButtonFont) then UPFButtonFont.Free;
end;
[/SPOILER]
Вложения
-
299.9 KB Просмотры: 35