botva2

DLL botva2 0.9.9.156

Нет прав для скачивания

Alloc

Новичок
Alloc, сам пользуюсь Inno Setup Compiler unicode там и пример писал вроде не кто не жаловался
все таки вылез баг которого я так боялся... а именно, если применить классический стиль окон в меню персонализации (windows 7) и запустить инсталлятор, то не будет видно ни логотипа, ни иконок... вот такая вот неприятность... возможно все наладится если скомпилировать в ansi... придется переустановить inno.. отпишусь о результате

да, собственно как и предполагал, на ansi компиляторе все в порядке... видимо ботва не предназначена для unicode компиляторов... печально(
 
Последнее редактирование:

Alloc

Новичок
прошу прощения, значит косяк у меня... не знаю пока с чем связан
Косяк нашел у себя:

Код:
Logo:=ImgLoad(LogoPanel.Handle,ExpandConstant('{tmp}\{#ISLogo}'),ScaleX(0), ScaleY(0),ScaleX(187),ScaleY(48),true,true);
для параметров IsBkg и Stretch я устанавливал параметры True по этой причине логотипа видно не было...
А как следует поступать с иконками на странице SelectDirPage и SelectProgramGroupPage? Оставить такие же значения? Это правильно?
 

Awalder

Новичок
Всем привет! Может кто в курсе, ботва2 почему то не запускается на системах с вин10. Обычный авторан, нормально работает на вин хп и 7. На 10ке (проверяли на 2х таких системах) просто висит в процессах, играет фоновая музыка и все. Самого окна интерфейса нет. Прочитал всё обсуждение в этой теме, на 7-8 странице что то обсуждали, но чего то единого у меня не сложилось. Может важна версия инно? Компилил в обычной. Заранее благодарен!
 

South

Знаток
Проверенный
Все оказалось банальнее, в этом:
Changes in default behavior:
  • As recommended by Microsoft's desktop applications guideline, DisableWelcomePage now defaults to yes.
По умолчанию компилятор отключал стартовую страницу на которой были расположены все элементы в примере и он из-за этого и бесполезно висел в процессах.
не в этом косяк с 10-й виндой?
 

Awalder

Новичок
не в этом косяк с 10-й виндой?
дело оказывается не в ботве, но решить всё равно не смог. Пока например к форме просто кнопки нарисовал без команд - работает и на вин10 (компилирую на вин хп или 7, а на 10 только иногда удаётся проверить). закончил скрипт полностью - на 7 и хп норм. , а на 10 виснет в трее, пичаль. теперь вот пытаюсь понять, на каком этапе 10ка перестаёт "принимать" код. Уже убрал звуки клавиш, ссылки на сайт...
#define GameName "Age of Empires III Modifications Launcher"
#define MyVersionInfoVersion "1.1.0.1"
#define MyAppName "Age of Empires III Modifications Launcher"
#define MyAppVersion "AOE3 Mod launcher 1.1"
#define Font "Formal436 BT.ttf"
#define FontName "Formal436 BT"
#define URLpath "http://eso-community.net/"
#define ReadMepath "{tmp}\ReadMe.txt"

[Setup]

AppName={#MyAppName}
AppVerName={#MyAppVersion}
VersionInfoVersion={#MyVersionInfoVersion}
CreateAppDir=false
DisableWelcomePage=no
DefaultDirName=1
DefaultGroupName=1
OutputBaseFilename=AOE3 Mod Launcher
DirExistsWarning=no
MinVersion=0,5.01
DiskSpanning=no
SetupIconFile=Files\cd.ico



[Files]
Source: Bitmap\*; DestDir: {tmp}; Flags: dontcopy;
Source: Files\*; DestDir: {tmp}; Flags: dontcopy;
Source: "ISTask.dll"; Flags: dontcopy solidbreak;

#include "Files\botva2.iss"

Код:
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]
 

Awalder

Новичок
не в этом косяк с 10-й виндой?
в итоге, нашёл почему не запускался на вин10, как и говорил - ботва совершенно не при чём, (вышеуказанный скрипт) - отключил кастомный шрифт... и всё идет. Жаль конечно, шрифт то из игры, сам лаунчер стилизован под ея. Может как то ещё можно, из под реестра что то прописать? У знакомого программиста на вин10 все права включены - этот инсталлятор запускается нормально. Сама программа будет работать в составе мода русификатора, пользоватетлей много - никто заморачиваться есстественно с правами не станет
 

South

Знаток
Проверенный
Awalder, попробуй в SendMessage вместо HWND_BROADCAST написать WizardForm.Handle

PS логика работы InitializeSetup неадекватна
 

South

Знаток
Проверенный
Awalder, попробуй так (это вроде твой скрипт из другой темы)
Код:
#define MyVersionInfoVersion "1.1.0.1"
#define MyAppName "Age of Empires III Modifications Launcher"
#define MyAppVersion "AOE3 Mod launcher 1.1"
#define Font "Formal436 BT.ttf"
#define FontName "Formal436 BT"
#define URLpath  "http://eso-community.net/"
#define ReadMepath  "{tmp}\ReadMe.txt"

[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVersion}
VersionInfoVersion={#MyVersionInfoVersion}
CreateAppDir=false
DisableWelcomePage=no
DefaultDirName=1
DefaultGroupName=1
OutputBaseFilename=AOE3 Mod Launcher
DirExistsWarning=no
MinVersion=0,5.01
DiskSpanning=no
SetupIconFile=Files\cd.ico

[Files]
Source: Bitmap\*; DestDir: {tmp}; Flags:  dontcopy;
Source: Files\*; DestDir: {tmp}; Flags:  dontcopy;
Source: "ISTask.dll"; Flags:  dontcopy solidbreak;

#include "Files\botva2.iss"

[_Code]
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';
function sndPlaySound(lpszSoundName: AnsiString; uFlags: cardinal):integer; external 'sndPlaySoundA@winmm.dll stdcall';
function AddFontResourceEx(FileName: PAnsiChar; fl: DWORD; pdv: DWORD): Integer; external 'AddFontResourceExA@gdi32.dll stdcall';
function RemoveFontResourceEx(FileName: PAnsiChar; fl: DWORD; pdv: DWORD): BOOL; external 'RemoveFontResourceExA@gdi32.dll stdcall';

var
  Form, Buttons, CloseButton, Checkbox, Logo, Button: Longint;
  Launcher1, Readme, Original, Treaty, Nilla, Ups :HWND;
  Font1, Font2, Font3: TFont;
  IsCustomFontInstalled: boolean;
  FontName: string;

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)
  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);
end;

procedure TreatyClick(hBtn:HWND);
var
  Res:integer;
begin
  sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
  Exec(ExpandConstant('{src}\age3y.exe'),'','',SW_SHOW,ewNoWait,Res)
  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);
end;

procedure NillaClick(hBtn:HWND);
var
  Res:integer;
begin
  sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
  Exec(ExpandConstant('{src}\age3.exe'),'','',SW_SHOW,ewNoWait,Res)
  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);
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;

  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 := AddFontResourceEx(PAnsiChar(ExpandConstant('{tmp}')+'\{#Font}'), $10, 0) > 0;
  if FontExists(ExpandConstant('{#FontName}')) then FontName := ExpandConstant('{#FontName}') else FontName := WizardForm.Font.Name;

  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;

  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(201),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(248),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(296),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(407),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(343),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;


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;

  If RunTask('age3y.exe', false) then
  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;
  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;

procedure DeinitializeSetup;
begin
  WizardForm.Free;
  if IsCustomFontInstalled then
  RemoveFontResourceEx(PAnsiChar(ExpandConstant('{tmp}')+'\{#Font}'), $10, 0);
  gdipShutDown;
end;
 

Awalder

Новичок
Awalder, попробуй так (это вроде твой скрипт из другой темы)
Сразу вспомнился возглас кота Матроскина : Ура, заработало!
Спасибо большое!

//и т.д., не понятно, что хотел изобразить автор. какой д.б. конечный результат?
так собственно у меня так же как и в справке к инно сделано...
Но даже не в этом суть, в этом скрипте ланчера IStack выдаёт сообщение о запущенной игре , жмёшь "нет" - то игра остаётся открытой но ланчер запускается, хотя по идее не должен (и мой и ваш вариант одинаково)
Istask DontWork.JPG start Istask.JPG

А в обычном инсталляторе если "нет" то окно с ошибкой :123mistake.JPG
 
Последнее редактирование:

Awalder

Новичок
Awalder, попробуй так (это вроде твой скрипт из другой темы)
Код:
#define MyVersionInfoVersion "1.1.0.1"
#define MyAppName "Age of Empires III Modifications Launcher"
#define MyAppVersion "AOE3 Mod launcher 1.1"
#define Font "Formal436 BT.ttf"
#define FontName "Formal436 BT"
#define URLpath  "http://eso-community.net/"
#define ReadMepath  "{tmp}\ReadMe.txt"

[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVersion}
VersionInfoVersion={#MyVersionInfoVersion}
CreateAppDir=false
DisableWelcomePage=no
DefaultDirName=1
DefaultGroupName=1
OutputBaseFilename=AOE3 Mod Launcher
DirExistsWarning=no
MinVersion=0,5.01
DiskSpanning=no
SetupIconFile=Files\cd.ico

[Files]
Source: Bitmap\*; DestDir: {tmp}; Flags:  dontcopy;
Source: Files\*; DestDir: {tmp}; Flags:  dontcopy;
Source: "ISTask.dll"; Flags:  dontcopy solidbreak;

#include "Files\botva2.iss"

[_Code]
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';
function sndPlaySound(lpszSoundName: AnsiString; uFlags: cardinal):integer; external 'sndPlaySoundA@winmm.dll stdcall';
function AddFontResourceEx(FileName: PAnsiChar; fl: DWORD; pdv: DWORD): Integer; external 'AddFontResourceExA@gdi32.dll stdcall';
function RemoveFontResourceEx(FileName: PAnsiChar; fl: DWORD; pdv: DWORD): BOOL; external 'RemoveFontResourceExA@gdi32.dll stdcall';

var
  Form, Buttons, CloseButton, Checkbox, Logo, Button: Longint;
  Launcher1, Readme, Original, Treaty, Nilla, Ups :HWND;
  Font1, Font2, Font3: TFont;
  IsCustomFontInstalled: boolean;
  FontName: string;

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)
  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);
end;

procedure TreatyClick(hBtn:HWND);
var
  Res:integer;
begin
  sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
  Exec(ExpandConstant('{src}\age3y.exe'),'','',SW_SHOW,ewNoWait,Res)
  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);
end;

procedure NillaClick(hBtn:HWND);
var
  Res:integer;
begin
  sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
  Exec(ExpandConstant('{src}\age3.exe'),'','',SW_SHOW,ewNoWait,Res)
  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);
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;

  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 := AddFontResourceEx(PAnsiChar(ExpandConstant('{tmp}')+'\{#Font}'), $10, 0) > 0;
  if FontExists(ExpandConstant('{#FontName}')) then FontName := ExpandConstant('{#FontName}') else FontName := WizardForm.Font.Name;

  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;

  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(201),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(248),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(296),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(407),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(343),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;


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;

  If RunTask('age3y.exe', false) then
  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;
  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;

procedure DeinitializeSetup;
begin
  WizardForm.Free;
  if IsCustomFontInstalled then
  RemoveFontResourceEx(PAnsiChar(ExpandConstant('{tmp}')+'\{#Font}'), $10, 0);
  gdipShutDown;
end;
Подскажите , возможно ли сделать так, чтобы если любая из ехе запущена, то все кнопки , которые запускают игру становились бы неактивными ( нажатыми) ? Спасибо
 

Косой

Новичок
Ну раз ты используешь ISTask.dll, то как вариант, на If RunTask и вешай неактивность нужных кнопок. Например, как-то так (работоспособность не проверял, ибо с ISTask не работал, просто как пример):
If RunTask('age3x.exe', false) then
begin
BtnSetEnabled(нужная_кнопка, false);
end;
 

nik1967

Old Men
Проверенный
Код:
#define MyVersionInfoVersion "1.1.0.1"
#define MyAppName "Age of Empires III Modifications Launcher"
#define MyAppVersion "AOE3 Mod launcher 1.1"
#define URLpath  "http://eso-community.net/"
#define ReadMepath  "{tmp}\ReadMe.txt"

[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVersion}
VersionInfoVersion={#MyVersionInfoVersion}
CreateAppDir=false
DisableWelcomePage=no
DefaultDirName=1
DefaultGroupName=1
OutputBaseFilename=AOE3 Mod Launcher
DirExistsWarning=no
MinVersion=0,5.01
DiskSpanning=no
SetupIconFile=Files\cd.ico

[Files]
Source: Bitmap\*; DestDir: {tmp}; Flags:  dontcopy;
Source: Files\*; DestDir: {tmp}; Flags:  dontcopy;

#include "Files\botva2.iss"

[Code]
var
   Form,Buttons,CloseButton,Checkbox,Logo,Button: Longint;
   Launcher1,Readme,Original,Treaty,Nilla,Ups: HWND;
   ErrCode,Res: integer;

function ReleaseCapture: Longint; external 'ReleaseCapture@user32.dll stdcall';

procedure FrameMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  ReleaseCapture;
  SendMessage(WizardForm.Handle,$0112,$F012,0);
end;

procedure UpsClick(hBtn:HWND);
begin
   Shellexec('open','{#URLpath}','','',SW_SHOWNORMAL,ewnowait,ErrCode);
end;

procedure ReadmeClick(hBtn:HWND);
begin
   ShellExec('open',ExpandConstant('{#ReadMepath}'),'','',SW_SHOW,ewNoWait,ErrCode);
end;

procedure OriginalClick(hBtn:HWND);
begin
  Exec(ExpandConstant('{src}\age3y.exe'),'','',SW_SHOW,ewNoWait,Res);
   BtnSetEnabled(Original,false);
   BtnSetEnabled(Treaty,false);
   BtnSetEnabled(Nilla,false);

  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);
end;

procedure TreatyClick(hBtn:HWND);
begin
  Exec(ExpandConstant('{src}\age3y.exe'),'','',SW_SHOW,ewNoWait,Res);
   BtnSetEnabled(Original,false);
   BtnSetEnabled(Treaty,false);
   BtnSetEnabled(Nilla,false);

  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);
end;

procedure NillaClick(hBtn:HWND);
begin
  Exec(ExpandConstant('{src}\age3.exe'),'','',SW_SHOW,ewNoWait,Res);
   BtnSetEnabled(Original,false);
   BtnSetEnabled(Treaty,false);
   BtnSetEnabled(Nilla,false);

  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);
end;

procedure CancelButtonClick (CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
  Confirm:= False;
end;

procedure ExitLauncher(hBtn:HWND);
begin
  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;

     with CancelButton do begin
       Width:= ScaleX(0);
       Height:= ScaleY(0);
     end;

     with NextButton do begin
       Width:= ScaleX(0);
       Height:= ScaleY(0);
     end;
   end;

  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');

  Form:= ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Menu.png'),ScaleX(0),ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);  

  Ups:= BtnCreate(WizardForm.Handle,ScaleX(8),ScaleY(3),ScaleX(291),ScaleY(187),ExpandConstant('{tmp}\Button.png'),10,False);
  BtnSetEvent(Ups,BtnClickEventID,WrapBtnCallback(@UpsClick,1));
  BtnSetFontColor(Ups,$22A4CA,$0000FF,$000000,$B6B6B6);
  BtnSetText(Ups,('ESOCommunity'));
  BtnSetCursor(Ups,GetSysCursorHandle(32649));

  Original:= BtnCreate(WizardForm.Handle,ScaleX(13),ScaleY(201),ScaleX(278),ScaleY(37),ExpandConstant('{tmp}\Buttons.png'),0,False);
  BtnSetEvent(Original,BtnClickEventID,WrapBtnCallback(@OriginalClick,1));
  BtnSetFontColor(Original,$ffffff,$ffffff,$ffffff,$ffffff);
  BtnSetText(Original,('Original Asian Dynastyes'));
  BtnSetCursor(Original,GetSysCursorHandle(32649));

  Treaty:= BtnCreate(WizardForm.Handle,ScaleX(13),ScaleY(248),ScaleX(278),ScaleY(37),ExpandConstant('{tmp}\Buttons.png'),0,False);
  BtnSetEvent(Treaty,BtnClickEventID,WrapBtnCallback(@TreatyClick,1));
  BtnSetFontColor(Treaty,$ffffff,$ffffff,$ffffff,$ffffff);
  BtnSetText(Treaty,('Fan Path Asian Dynastyes'));
  BtnSetCursor(Treaty,GetSysCursorHandle(32649));

  Nilla:= BtnCreate(WizardForm.Handle,ScaleX(13),ScaleY(296),ScaleX(278),ScaleY(37),ExpandConstant('{tmp}\Buttons.png'),0,False);
  BtnSetEvent(Nilla,BtnClickEventID,WrapBtnCallback(@NillaClick,1));
  BtnSetFontColor(Nilla,$ffffff,$ffffff,$ffffff,$ffffff);
  BtnSetText(Nilla,('Original Vanilla AOE3'));
  BtnSetCursor(Nilla,GetSysCursorHandle(32649));

  Launcher1:= BtnCreate(WizardForm.Handle,ScaleX(13),ScaleY(407),ScaleX(278),ScaleY(37),ExpandConstant('{tmp}\Buttons.png'),0,False);
  BtnSetEvent(Launcher1,BtnClickEventID,WrapBtnCallback(@ExitLauncher,1));
  BtnSetFontColor(Launcher1,$ffffff,$ffffff,$ffffff,$ffffff);
  BtnSetText(Launcher1,('Exit'));
  BtnSetCursor(Launcher1,GetSysCursorHandle(32649));  

  Readme:= BtnCreate(WizardForm.Handle,ScaleX(13),ScaleY(343),ScaleX(278),ScaleY(37),ExpandConstant('{tmp}\Buttons.png'),0,False);
  BtnSetEvent(Readme,BtnClickEventID,WrapBtnCallback(@ReadmeClick,1));
  BtnSetFontColor(Readme,$ffffff,$ffffff,$ffffff,$ffffff);
  BtnSetText(Readme,('List of changes'));
  BtnSetCursor(Readme,GetSysCursorHandle(32649));

   ImgApplyChanges(WizardForm.Handle);
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;
end;

procedure DeinitializeSetup;
begin
  gdipShutDown;
end;
и использовать Buttons.png
 

Вложения

zavul0n

Новичок
Ребят, подскажите.
Как поставить созданному через ботву чекбоксу значение Checked? Нашел в файле CheckListBox функцию CheckBoxSetChecked, но никак не могу разобраться как она работает. Вариант задать через создание кнопки значение Checked тоже не подойдет, т.к. в зависимости от выбора одного чекбокса, нужно поставить галку и на другом.
 

vint56

Ветеран
Проверенный
zavul0n,
#define DirectX
#include "Modules\botva2.iss"

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputBaseFilename=setup

[Languages]
Name: "rus"; MessagesFile: "compiler:Languages\Russian.isl"

[CustomMessages]
rus.DirectX=Обновить DirectX
rus.DirectXInstall=Идет обновление DirectX...

[Files]
Source: "InstallFiles\*"; DestDir: "{tmp}"; Flags: dontcopy

Код:
var
  DirectXCheck : HWND;
  DirectXLabel : TLabel;

function InitializeSetup:boolean;
begin
  if not FileExists(ExpandConstant('{tmp}\b2p.dll')) then ExtractTemporaryFile('b2p.dll');
  if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');
  if not FileExists(ExpandConstant('{tmp}\CallbackCtrl.dll')) then ExtractTemporaryFile('CallbackCtrl.dll');
Result:=True;
end;

function DirectX: Boolean;
begin
  Result:= BtnGetChecked(DirectXCheck);
end;

procedure DirectXClick(hBtn:HWND);
begin
  if BtnGetChecked(hBtn) then DirectXLabel.Font.Color:=clBlue else DirectXLabel.Font.Color:=clBlack;
end;

procedure DirectXLabelClick(Sender:TObject);
begin
  BtnSetChecked(DirectXCheck, not BtnGetChecked(DirectXCheck));
  DirectXClick(DirectXCheck);
end;

procedure InitializeWizard();
begin
  ExtractTemporaryFile('CheckBox.png');
#ifdef DirectX
//создаем чекбокс
  DirectXCheck:=BtnCreate(WizardForm.SelectDirPage.Handle, ScaleX(0),ScaleY(120),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\CheckBox.png'),0,True);
  BtnSetEvent(DirectXCheck,BtnClickEventID,WrapBtnCallback(@DirectXClick,1));
  BtnSetCursor(DirectXCheck,GetSysCursorHandle(32649));

// создаем надпись к нему
  DirectXLabel := TLabel.Create(WizardForm);
with DirectXLabel do begin
  AutoSize:=False;
  SetBounds(ScaleX(35), ScaleY(128), ScaleX(145), ScaleY(17));
  OnClick:= @DirectXLabelClick;
  Cursor:= CrHand;
  Caption := ExpandConstant('{cm:DirectX}');
  Parent := WizardForm.SelectDirPage;
  Font.Color:=clBlue;
 end;
#endif
end;

procedure CurPageChanged(CurPageID: Integer);
begin
Case CurPageID of
  wpSelectDir:
begin
  BtnSetChecked(DirectXCheck,True);
 end;
end;
end;

procedure CurStepChanged(CurStep: TSetupStep);
var
ErrorCode: Integer;
begin
case CurStep of
ssPostInstall: begin
 #ifdef DirectX
   if BtnGetChecked(DirectXCheck) then begin
     WizardForm.StatusLabel.Caption := ExpandConstant('{cm:DirectXInstall}');
     Exec(ExpandConstant('{src}\Redist\DirectX\DXSETUP.exe'), '/silent', ExpandConstant('{src}\Redist\DirectX'), SW_HIDE, ewWaitUntilTerminated, ErrorCode);
   end;
 #endif
end;
end;
end;

procedure DeinitializeSetup;
begin
gdipShutdown;
end;
[/SPOILER]
 

zavul0n

Новичок
vint56, всё бы ничего, но у меня чекбокс создан не через кнопку, а через clbAddChkBoxItem.
 
Сверху