function KillTask(ExeFileName: string): Integer;
external 'KillTask@files:ISTask.dll stdcall delayload';
function RunTask(FileName: string; bFullpath: Boolean): Boolean;
external 'RunTask@files:ISTask.dll stdcall delayload';
var
Form, Buttons, CloseButton, Checkbox, Logo, Button: Longint;
Launcher1, Readme, Original, Treaty, Nilla, Ups :HWND;
Font1, Font2, Font3: TFont;
IsCustomFontInstalled: boolean;
FontName: string;
function sndPlaySound(lpszSoundName: AnsiString; uFlags: cardinal):integer; external 'sndPlaySoundA@winmm.dll stdcall';
function ReleaseCapture: Longint; external 'ReleaseCapture@user32.dll stdcall';
function AddFontResource(FileName: PAnsiChar): Integer; external 'AddFontResourceA@gdi32.dll stdcall';
function RemoveFontResource(FileName: PAnsiChar): BOOL; external 'RemoveFontResourceA@gdi32.dll stdcall';
procedure FrameMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
SendMessage(WizardForm.Handle,$0112,$F012,0);
end;
procedure BtnEnter(hBtn:HWND);
begin
sndPlaySound(ExpandConstant('{tmp}\Enter.wav'), $0001);
end;
procedure UpsClick(hBtn:HWND);
var
ErrCode:integer;
begin
sndPlaySound(ExpandConstant('{tmp}\Click.wav'), $0001);
Shellexec('open', '{#URLpath}', '', '',SW_SHOWNORMAL, ewnowait, ErrCode);
end;
procedure ReadmeClick(hBtn:HWND);
var
ErrCode:integer;
begin
ShellExec('open', ExpandConstant('{#ReadMepath}'),'','', SW_SHOW, ewNoWait, ErrCode);
end;
procedure OriginalClick(hBtn:HWND);
var
Res:integer;
begin
sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
Exec(ExpandConstant('{src}\age3y.exe'),'','',SW_SHOW,ewNoWait,Res)
begin
DeleteFile(ExpandConstant('{src}\data\civs.xml'));
DeleteFile(ExpandConstant('{src}\data\civs.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecitybritish.xml'));
DeleteFile(ExpandConstant('{src}\data\homecitybritish.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecitychinese.xml'));
DeleteFile(ExpandConstant('{src}\data\homecitychinese.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecitydutch.xml'));
DeleteFile(ExpandConstant('{src}\data\homecitydutch.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityfrench.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityfrench.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecitygerman.xml'));
DeleteFile(ExpandConstant('{src}\data\homecitygerman.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityindians.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityindians.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityjapanese.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityjapanese.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityottomans.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityottomans.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityportuguese.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityportuguese.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityrussians.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityrussians.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityspanish.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityspanish.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityxpaztec.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityxpaztec.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityxpiroquois.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityxpiroquois.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityxpsioux.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityxpsioux.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\protoy.xml'));
DeleteFile(ExpandConstant('{src}\data\protoy.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\stringtabley.xml'));
DeleteFile(ExpandConstant('{src}\data\stringtabley.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\techtreey.xml'));
DeleteFile(ExpandConstant('{src}\data\techtreey.xml.xmb'));
DelTree(ExpandConstant('{src}\data\tactics'),True, True, True);
DelTree(ExpandConstant('{src}\art\techs'),True, True, True);
DelTree(ExpandConstant('{src}\art\units'),True, True, True);
DelTree(ExpandConstant('{src}\art\ui\home_city'),True, True, True);
FileCopy(ExpandConstant('{src}\Original\data\protoy.xml'), ExpandConstant('{src}\data\protoy.xml'), False);
FileCopy(ExpandConstant('{src}\Original\data\protoy.xml.xmb'), ExpandConstant('{src}\data\protoy.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Original\data\stringtabley.xml'), ExpandConstant('{src}\data\stringtabley.xml'), False);
FileCopy(ExpandConstant('{src}\Original\data\stringtabley.xml.xmb'), ExpandConstant('{src}\data\stringtabley.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Original\data\techtreey.xml'), ExpandConstant('{src}\data\techtreey.xml'), False);
FileCopy(ExpandConstant('{src}\Original\data\techtreey.xml.xmb'), ExpandConstant('{src}\data\techtreey.xml.xmb'), False);
//WizardForm.Close;
end;
end;
procedure TreatyClick(hBtn:HWND);
var
Res:integer;
begin
sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
Exec(ExpandConstant('{src}\age3y.exe'),'','',SW_SHOW,ewNoWait,Res)
begin
DeleteFile(ExpandConstant('{src}\data\protoy.xml'));
DeleteFile(ExpandConstant('{src}\data\protoy.xml.XMB'));
DeleteFile(ExpandConstant('{src}\data\stringtabley.xml'));
DeleteFile(ExpandConstant('{src}\data\stringtabley.xml.XMB'));
DeleteFile(ExpandConstant('{src}\data\techtreey.xml'));
DeleteFile(ExpandConstant('{src}\data\techtreey.xml.XMB'));
FileCopy(ExpandConstant('{src}\Treaty\data\civs.xml'), ExpandConstant('{src}\data\civs.xml'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\civs.xml.xmb'), ExpandConstant('{src}\data\civs.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecitybritish.xml'), ExpandConstant('{src}\data\homecitybritish.xml'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecitybritish.xml.xmb'), ExpandConstant('{src}\data\homecitybritish.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecitychinese.xml'), ExpandConstant('{src}\data\homecitychinese.xml'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecitychinese.xml.xmb'), ExpandConstant('{src}\data\homecitychinese.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecitydutch.xml'), ExpandConstant('{src}\data\homecitydutch.xml'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\chomecitydutch.xml.xmb'), ExpandConstant('{src}\data\homecitydutch.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityfrench.xml'), ExpandConstant('{src}\data\homecityfrench.xml'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityfrench.xml.xmb'), ExpandConstant('{src}\data\homecityfrench.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecitygerman.xml'), ExpandConstant('{src}\data\homecitygerman.xml'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecitygerman.xml.xmb'), ExpandConstant('{src}\data\homecitygerman.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityindians.xml'), ExpandConstant('{src}\data\homecityindians.xml'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityindians.xml.xmb'), ExpandConstant('{src}\data\homecityindians.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityjapanese.xml'), ExpandConstant('{src}\data\homecityjapanese.xml'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityjapanese.xml.xmb'), ExpandConstant('{src}\data\homecityjapanese.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityottomans.xml'), ExpandConstant('{src}\data\homecityottomans.xml'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityottomans.xml.xmb'), ExpandConstant('{src}\data\homecityottomans.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityportuguese.xml'), ExpandConstant('{src}\data\homecityportuguese.xml'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityportuguese.xml.xmb'), ExpandConstant('{src}\data\homecityportuguese.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityrussians.xml'), ExpandConstant('{src}\data\homecityrussians.xml'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityrussians.xml.xmb'), ExpandConstant('{src}\data\homecityrussians.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityspanish.xml'), ExpandConstant('{src}\data\homecityspanish.xml'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityspanish.xml.xmb'), ExpandConstant('{src}\data\homecityspanish.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityxpaztec.xml'), ExpandConstant('{src}\data\homecityxpaztec.xml'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityxpaztec.xml.xmb'), ExpandConstant('{src}\data\homecityxpaztec.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityxpiroquois.xml'), ExpandConstant('{src}\data\homecityxpiroquois.xml'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityxpiroquois.xml.xmb'), ExpandConstant('{src}\data\homecityxpiroquois.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityxpsioux.xml'), ExpandConstant('{src}\data\homecityxpsioux.xml'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\homecityxpsioux.xml.xmb'), ExpandConstant('{src}\data\homecityxpsioux.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\protoy.xml'), ExpandConstant('{src}\data\protoy.xml'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\protoy.xml.xmb'), ExpandConstant('{src}\data\protoy.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\stringtabley.xml'), ExpandConstant('{src}\data\stringtabley.xml'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\stringtabley.xml.xmb'), ExpandConstant('{src}\data\stringtabley.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\techtreey.xml.xmb'), ExpandConstant('{src}\data\techtreey.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\techtreey.xml'), ExpandConstant('{src}\data\techtreey.xml'), False);
ForceDirectories(ExpandConstant('{src}\data\tactics'));
FileCopy(ExpandConstant('{src}\Treaty\data\tactics\arrowknight.tactics'), ExpandConstant('{src}\data\tactics\tarrowknight.tactics'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\tactics\arrowknight.tactics.xmb'), ExpandConstant('{src}\data\tactics\arrowknight.tactics.xmb'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\tactics\musketBayonet.tactics'), ExpandConstant('{src}\data\tactics\musketBayonet.tactics.xml'), False);
FileCopy(ExpandConstant('{src}\Treaty\data\tactics\musketBayonet.tactics.xmb'), ExpandConstant('{src}\data\tactics\musketBayonet.tactics.xmb'), False);
ForceDirectories(ExpandConstant('{src}\art\techs\hc_team_cavalry_line_of_sight'));
FileCopy(ExpandConstant('{src}\Treaty\art\techs\hc_team_cavalry_line_of_sight\hc_team_cavalry_line_of_sightnew.ddt'), ExpandConstant('{src}\art\techs\hc_team_cavalry_line_of_sight\hc_team_cavalry_line_of_sightnew.ddt'), False);
ForceDirectories(ExpandConstant('{src}\art\techs\home_city'));
FileCopy(ExpandConstant('{src}\Treaty\art\techs\home_city\hc_fatter_sheep.ddt'), ExpandConstant('{src}\art\techs\home_city\hc_fatter_sheep.ddt'), False);
FileCopy(ExpandConstant('{src}\Treaty\art\techs\home_city\hc_fencing_school.ddt'), ExpandConstant('{src}\art\techs\home_city\hc_fencing_school.ddt'), False);
FileCopy(ExpandConstant('{src}\Treaty\art\techs\home_city\hc_team_infantry_speednew.(0,0,4,1).tga'), ExpandConstant('{src}\art\techs\home_city\hc_team_infantry_speednew.(0,0,4,1).tga'), False);
FileCopy(ExpandConstant('{src}\Treaty\art\techs\home_city\hc_team_infantry_speednew.ddt'), ExpandConstant('{src}\art\techs\home_city\hc_team_infantry_speednew.ddt'), False);
FileCopy(ExpandConstant('{src}\Treaty\art\techs\home_city\hc_team_silk_road.ddt'), ExpandConstant('{src}\art\techs\home_city\hc_team_silk_road.ddt'), False);
ForceDirectories(ExpandConstant('{src}\art\ui\home_city'));
FileCopy(ExpandConstant('{src}\Treaty\art\ui\home_city\hc_team_chonindo.ddt'), ExpandConstant('{src}\art\techs\home_city\hc_team_chonindo.ddt'), False);
FileCopy(ExpandConstant('{src}\Treaty\art\ui\home_city\hc_team_infantry_speednew.ddt'), ExpandConstant('{src}\art\techs\home_city\hc_team_infantry_speednew.ddt'), False);
ForceDirectories(ExpandConstant('{src}\art\units\animals\bison'));
FileCopy(ExpandConstant('{src}\Treaty\art\units\animals\bison\bison_icon_infinite_64x64.ddt'), ExpandConstant('{src}\art\units\animals\bison\bison_icon_infinite_64x64.ddt'), False);
ForceDirectories(ExpandConstant('{src}\art\units\artillery\great_bombard'));
FileCopy(ExpandConstant('{src}\Treaty\art\units\artillery\great_bombard\great_bombard_infinite_icon_64x64.ddt'), ExpandConstant('{src}\art\units\artillery\great_bombard\great_bombard_infinite_icon_64x64.ddt'), False);
//WizardForm.Close;
end;
end;
procedure NillaClick(hBtn:HWND);
var
Res:integer;
begin
sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
Exec(ExpandConstant('{src}\age3.exe'),'','',SW_SHOW,ewNoWait,Res)
begin
DeleteFile(ExpandConstant('{src}\data\civs.xml'));
DeleteFile(ExpandConstant('{src}\data\civs.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecitybritish.xml'));
DeleteFile(ExpandConstant('{src}\data\homecitybritish.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecitychinese.xml'));
DeleteFile(ExpandConstant('{src}\data\homecitychinese.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecitydutch.xml'));
DeleteFile(ExpandConstant('{src}\data\homecitydutch.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityfrench.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityfrench.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecitygerman.xml'));
DeleteFile(ExpandConstant('{src}\data\homecitygerman.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityindians.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityindians.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityjapanese.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityjapanese.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityottomans.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityottomans.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityportuguese.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityportuguese.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityrussians.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityrussians.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityspanish.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityspanish.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityxpaztec.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityxpaztec.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityxpiroquois.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityxpiroquois.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\homecityxpsioux.xml'));
DeleteFile(ExpandConstant('{src}\data\homecityxpsioux.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\protoy.xml'));
DeleteFile(ExpandConstant('{src}\data\protoy.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\stringtabley.xml'));
DeleteFile(ExpandConstant('{src}\data\stringtabley.xml.xmb'));
DeleteFile(ExpandConstant('{src}\data\techtreey.xml'));
DeleteFile(ExpandConstant('{src}\data\techtreey.xml.xmb'));
DelTree(ExpandConstant('{src}\data\tactics'),True, True, True);
DelTree(ExpandConstant('{src}\art\techs'),True, True, True);
DelTree(ExpandConstant('{src}\art\units'),True, True, True);
DelTree(ExpandConstant('{src}\art\ui\home_city'),True, True, True);
FileCopy(ExpandConstant('{src}\Original\data\protoy.xml'), ExpandConstant('{src}\data\protoy.xml'), False);
FileCopy(ExpandConstant('{src}\Original\data\protoy.xml.xmb'), ExpandConstant('{src}\data\protoy.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Original\data\stringtabley.xml'), ExpandConstant('{src}\data\stringtabley.xml'), False);
FileCopy(ExpandConstant('{src}\Original\data\stringtabley.xml.xmb'), ExpandConstant('{src}\data\stringtabley.xml.xmb'), False);
FileCopy(ExpandConstant('{src}\Original\data\techtreey.xml'), ExpandConstant('{src}\data\techtreey.xml'), False);
FileCopy(ExpandConstant('{src}\Original\data\techtreey.xml.xmb'), ExpandConstant('{src}\data\techtreey.xml.xmb'), False);
//WizardForm.Close;
end;
end;
procedure CancelButtonClick (CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm := False;
end;
procedure ExitLauncher(hBtn:HWND);
begin
sndPlaySound(ExpandConstant('{tmp}\Click.wav'), $0001);
WizardForm.Close;
end;
procedure InitializeWizard;
begin
with WizardForm do begin
ClientWidth:= ScaleX(300);
ClientHeight:= ScaleY(440);
OuterNotebook.Hide;
InnerNotebook.Hide;
BorderStyle:= bsNone;
Position:= poScreenCenter;
Bevel.Hide;
end;
with WizardForm.CancelButton do
begin
Width := ScaleX(0);
Height := ScaleY(0);
end;
with WizardForm.NextButton do
begin
Width := ScaleX(0);
Height := ScaleY(0);
end;
begin
ExtractTemporaryFile('Menu.png');
ExtractTemporaryFile('Buttons.png');
ExtractTemporaryFile('CloseButton.png');
ExtractTemporaryFile('Checkbox.png');
ExtractTemporaryFile('Logo.png');
ExtractTemporaryFile('Button.png');
ExtractTemporaryFile('Formal436 BT.ttf');
ExtractTemporaryFile('ReadMe.txt');
ExtractTemporaryFile('Click.wav');
ExtractTemporaryFile('Enter.wav');
Form:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Menu.png'),ScaleX(0),ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
IsCustomFontInstalled:=AddFontResource(ExpandConstant('{tmp}')+'\Formal436 BT.ttf')>0;
if IsCustomFontInstalled then SendMessage(HWND_BROADCAST,$1D,0,0);
if FontExists('Formal436 BT') then FontName:='Formal436 BT' else FontName:='Arial';
Font1:=TFont.Create;
with Font1 do begin
Name:=FontName;
Size:=12;
end;
Font2:=TFont.Create;
with Font2 do begin
Name:=FontName;
Size:=12;
end;
Font3:=TFont.Create;
with Font3 do begin
Name:=FontName;
Style:=[fsBold];
Size:= 24;
end;
end;
Ups:=BtnCreate(WizardForm.Handle,ScaleX(8),ScaleY(3),ScaleX(291),ScaleY(187),ExpandConstant('{tmp}\Button.png'),10,False);
BtnSetEvent(Ups,BtnClickEventID,WrapBtnCallback(@UpsClick,1));
BtnSetEvent(Ups,BtnMouseEnterEventID,WrapBtnCallback(@BtnEnter,1));
BtnSetFontColor(Ups,$22A4CA,$0000FF,$000000,$B6B6B6);
BtnSetText(Ups,('ESOCommunity'));
BtnSetFont(Ups,Font3.Handle);
BtnSetCursor(Ups,GetSysCursorHandle(32649));
Original:=BtnCreate(WizardForm.Handle,ScaleX(13),ScaleY(203),ScaleX(278),ScaleY(37),ExpandConstant('{tmp}\Buttons.png'),0,False);
BtnSetEvent(Original,BtnClickEventID,WrapBtnCallback(@OriginalClick,1));
BtnSetEvent(Original,BtnMouseEnterEventID,WrapBtnCallback(@BtnEnter,1));
BtnSetFontColor(Original,$ffffff,$ffffff,$ffffff,$ffffff);
BtnSetText(Original,('Original Asian Dynastyes'));
BtnSetFont(Original,Font1.Handle);
BtnSetCursor(Original,GetSysCursorHandle(32649));
Treaty:=BtnCreate(WizardForm.Handle,ScaleX(13),ScaleY(250),ScaleX(278),ScaleY(37),ExpandConstant('{tmp}\Buttons.png'),0,False);
BtnSetEvent(Treaty,BtnClickEventID,WrapBtnCallback(@TreatyClick,1));
BtnSetEvent(Treaty,BtnMouseEnterEventID,WrapBtnCallback(@BtnEnter,1));
BtnSetFontColor(Treaty,$ffffff,$ffffff,$ffffff,$ffffff);
BtnSetText(Treaty,('Fan Path Asian Dynastyes'));
BtnSetFont(Treaty,Font1.Handle);
BtnSetCursor(Treaty,GetSysCursorHandle(32649));
Nilla:=BtnCreate(WizardForm.Handle,ScaleX(13),ScaleY(298),ScaleX(278),ScaleY(37),ExpandConstant('{tmp}\Buttons.png'),0,False);
BtnSetEvent(Nilla,BtnClickEventID,WrapBtnCallback(@NillaClick,1));
BtnSetEvent(Nilla,BtnMouseEnterEventID,WrapBtnCallback(@BtnEnter,1));
BtnSetFontColor(Nilla,$ffffff,$ffffff,$ffffff,$ffffff);
BtnSetText(Nilla,('Original Vanilla AOE3'));
BtnSetFont(Nilla,Font1.Handle);
BtnSetCursor(Nilla,GetSysCursorHandle(32649));
Launcher1:=BtnCreate(WizardForm.Handle,ScaleX(13),ScaleY(410),ScaleX(278),ScaleY(37),ExpandConstant('{tmp}\Buttons.png'),0,False);
BtnSetEvent(Launcher1,BtnClickEventID,WrapBtnCallback(@ExitLauncher,1));
BtnSetEvent(Launcher1,BtnMouseEnterEventID,WrapBtnCallback(@BtnEnter,1));
BtnSetFontColor(Launcher1,$ffffff,$ffffff,$ffffff,$ffffff);
BtnSetText(Launcher1,('Exit'));
BtnSetFont(Launcher1,Font1.Handle);
BtnSetCursor(Launcher1,GetSysCursorHandle(32649));
Readme:=BtnCreate(WizardForm.Handle,ScaleX(13),ScaleY(346),ScaleX(278),ScaleY(37),ExpandConstant('{tmp}\Buttons.png'),0,False);
BtnSetEvent(Readme,BtnClickEventID,WrapBtnCallback(@ReadmeClick,1));
BtnSetEvent(Readme,BtnMouseEnterEventID,WrapBtnCallback(@BtnEnter,1));
BtnSetFontColor(Readme,$ffffff,$ffffff,$ffffff,$ffffff);
BtnSetText(Readme,('List of changes'));
BtnSetFont(Readme,Font1.Handle);
BtnSetCursor(Readme,GetSysCursorHandle(32649));
ImgApplyChanges(WizardForm.Handle);
end;
procedure CurPageChanged(CurPageID: Integer);
begin
end;
function InitializeSetup:boolean;
begin
if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');
if not FileExists(ExpandConstant('{tmp}\CallbackCtrl.dll')) then ExtractTemporaryFile('CallbackCtrl.dll');
Result:=True;
begin
If RunTask('age3y.exe', false) then
begin
if MsgBox('The Asian Dynasties is already started. To close and start AOE3 Mod Launcher?', mbInformation, mb_YesNo) = idYes then
begin
KillTask('age3y.exe');
Result:= True;
end else
Exit;
end;
Result:=True;
If RunTask('age3x.exe', false) then
begin
if MsgBox('The War Chiefs is already started. To close and start AOE3 Mod Launcher?', mbInformation, mb_YesNo) = idYes then
begin
KillTask('age3x.exe');
Result:= True;
end else
Exit;
end;
Result:=True;
If RunTask('age3.exe', false) then
begin
if MsgBox('Age of Empires III is already started. To close and start AOE3 Mod Launcher?', mbInformation, mb_YesNo) = idYes then
begin
KillTask('age3.exe');
Result:= True;
end else
Exit;
end;
Result:=True;
end;
end;
procedure DeinitializeSetup;
begin
WizardForm.Free;
if IsCustomFontInstalled then
if RemoveFontResource(PAnsiChar(ExpandConstant('{tmp}')+'\{#Font}')) then SendMessage(HWND_BROADCAST,$1D,0,0);
begin
gdipShutDown;
end;
end;
[/SPOILER]