View Single Post
  #1  
Old 29-11-2013, 18:00
Smurf Stomper's Avatar
Smurf Stomper Smurf Stomper is offline
Registered User
 
Join Date: Feb 2007
Location: EU
Posts: 118
Thanks: 0
Thanked 10 Times in 8 Posts
Smurf Stomper is on a distinguished road
Inno Setup - check GPU DirectX version?

I would like to add a check to my scripts that will determine if the currently installed GPU is DX 11 capable - which would then allow additional parameters in the script to be executed. For example, my current Far Cry 3 script has the following line:

Code:
[Icons]
Name: {userdesktop}\Far Cry 3; Filename: {app}\bin\FarCry3.exe; Parameters: -offline; WorkingDir: {app}\bin
I would change it to something like this:

Code:
[Icons]
Name: {userdesktop}\Far Cry 3; Filename: {app}\bin\FarCry3.exe; Parameters: -offline; WorkingDir: {app}\bin
Name: {userdesktop}\Far Cry 3; Filename: {app}\bin\FarCry3_D3D11.exe; Parameters: -offline; WorkingDir: {app}\bin
Adding the second line creates the option for a shortcut to the DX11-specific exe to be shortcutted on the desktop. What I need help with is setting some parameter in the two lines that only causes the appropriate one to be executed as the setup installs, based on the system's directX gpu capability.

For example, when a setup has x64 specific files, I can designate the following check (using my Rage script as an example):

Code:
[Icons]
Name: {userdesktop}\Rage; Filename: {app}\Rage.exe; WorkingDir: {app}\; Tasks: desktopshortcut; Check: not isWin64
Name: {userdesktop}\Rage (64-bit); Filename: {app}\Rage64.exe; WorkingDir: {app}\; Tasks: desktopshortcut; Check: isWin64
the "isWin64" check is built in to inno setup, so I don't have to put a specific function in the CODE section. Unfortunately, no GPU directX check is built in that I'm aware of.

Anyone have a custom 'check' function already coded up that they'll share?
Reply With Quote
Sponsored Links