1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
[Code]
const
RegPath = 'Software\Electronic Arts\EA Games\';
var
InstallType: TInputOptionWizardPage;
function RegDir(Param: String):String;
var
InstallDir: String;
begin
// il existe deux coffrets du jeu, le normal et la version the first decade pack
if RegQueryStringValue(HKEY_LOCAL_MACHINE, RegPath+'Command and Conquer The First Decade', 'zh_folder', InstallDir)
then
begin
Result := InstallDir
end
if RegQueryStringValue(HKEY_LOCAL_MACHINE, RegPath+'Command and Conquer Generals Zero Hour', 'InstallPath', InstallDir)
then
begin
Result := InstallDir
end
end;
function InitializeSetup(): Boolean;
var
VersionValue: Cardinal;
begin
InstallType := CreateInputOptionPage(wpWelcome,'titre', 'description', True, False);
InstallType.Add('combiné');
InstallType.Add('stand alone');
InstallType.Values[1] := True; //default stand alone
if RegValueExists(HKEY_LOCAL_MACHINE, RegPath+'Command and Conquer Generals Zero Hour', 'InstallPath') = true OR RegValueExists(HKEY_LOCAL_MACHINE, RegPath+'Command and Conquer The First Decade', 'zh_folder') = true
then
begin
Result:=True;
end
else
begin
Msgbox(ExpandConstant('{cm:NoZH}'),mbError ,MB_Ok);
Result:=False;
end;
if RegQueryDWordValue(HKEY_LOCAL_MACHINE, RegPath+'Command and Conquer Generals Zero Hour', 'Version', VersionValue)
then
begin
if VersionValue = 65540
then
begin
Result:=True;
end
else
begin
Msgbox(ExpandConstant('{cm:NoPatch}'), mbInformation ,MB_Ok);
Result:=False;
end
end;
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
Result := True; //show all page
//page select dir and combiné checked, so skip selectdir
if (PageID = wpSelectDir) and (InstallType.Values[1] = True) then
Result := False;
end; |
Partager