Quote:
Originally Posted by Razor12911
Altef, there's also DX 10.1 and I think DX 11.2;
Oh and, What about 9.0c or does it fall under 9?
|
just little change code
Code:
;#define InnoSetup5_5_4
[Setup]
AppName=Get_SYS_INFO
AppVersion=0.1c
CreateAppDir=no
VersionInfoDescription=altef_4
OutputBaseFilename=Get_SYS_INFO
OutputDir=.
[Icons]
Name: {userdesktop}\Far Cry 3 DX9; Filename: {app}\bin\FarCry3.exe; Parameters: -offline; WorkingDir: {app}\bin; Check: DX9;
Name: {userdesktop}\Far Cry 3 DX11; Filename: {app}\bin\FarCry3_D3D11.exe; Parameters: -offline; WorkingDir: {app}\bin; Check: DX11;
[Code]
var GetDXV:string;
function DX9:boolean;
begin
Case GetDXV of
'9': Result:=True;
'9.0c': Result:=True;
'10': Result:=True;
'10.1': Result:=True;
'11': Result:=True;
'11.2': Result:=True;
else
Result:=False;
end;
end;
function DX10:boolean;
begin
Case GetDXV of
'9': Result:=False;
'9.0c': Result:=False;
'10': Result:=True;
'10.1': Result:=True;
'11': Result:=True;
'11.2': Result:=True;
else
Result:=False;
end;
end;
function DX11:boolean;
begin
Case GetDXV of
'9': Result:=False;
'9.0c': Result:=False;
'10': Result:=False;
'10.1': Result:=False;
'11': Result:=True;
'11.2': Result:=True;
else
Result:=False;
end;
end;
function GetDX:string;
var
dxv:string;
buf:ansistring;
begin
Result:='';
while Not FileExists(ExpandConstant('{tmp}')+'\dxdiag.txt') do Sleep(100);
LoadStringFromFile(ExpandConstant('{tmp}')+'\dxdiag.txt',buf);
delete(buf,1,Pos('DDI Version: ',buf));
dxv:=Copy(buf,13,Pos(' ',buf));
StringChange(dxv,#13,'');
Result:=dxv;
end;
function InitializeSetup(): Boolean;
var
res:integer;
begin
Exec(ExpandConstant('{win}\system32\dxdiag.exe'),'/whql:off /t '+ExpandConstant('{tmp}')+'\dxdiag.txt',ExpandConstant('{tmp}'),0,ewNoWait,res)
Result:=True;
end;
#ifdef InnoSetup5_5_4
procedure CurInstallProgressChanged(CurProgress, MaxProgress: Integer);
begin
if CurProgress = MaxProgress-1 then GetDXV:=GetDX;
end;
#else
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep=ssInstall then GetDXV:=GetDX;
end;
#endif