DirectX authentication

d_a_r_k

Member
Joined
Oct 30, 2010
Messages
19
Programming Experience
Beginner
Hi folks I'm creating a WindowsForm application and I need a code to check target's machine installed version of DirectX.
If the reg key doesn't match with provided one >>> load the form and launch the DX installer "redist\directx_Jun2010_redist\DXSETUP.exe"
If the reg key matches with the provided one >>> launch other application "Setup.exe"

Any help would be appreceated

Provided version:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectX]
"Version"="4.09.00.0904"
 
Well I managed to create a code but now I get an error within a code


Imports Microsoft.Win32

Public Class gui_dx
Dim regkey As RegistryKey
Dim ver As Decimal

Private Sub gui_dx_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
regkey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\DirectX", True)
ver = regkey.GetValue("Version", 4.09.00.0904) 'this is where I get end of statement expected error
If ver < 4.09.00.0904 Then 'this is where I get end of statement expected error as well
Me.Hide()
Threading.Thread.Sleep(2000)
Shell(Application.StartupPath & "\DXSETUP.exe", vbNormalFocus)
Application.Exit()
Else
Threading.Thread.Sleep(1000)
My.Computer.Audio.Play(My.Resources.criterror, AudioPlayMode.Background)
End If
End Sub
 
Back
Top