VB Script - RegRead

BossHogg

n00b
Joined
Jun 20, 2012
Messages
2
Have script that searches the registry for a particular registry entry (32bit system), but need it to check to see if the 64bit system is also installed before going to the next step.

i.e.

On Error Resume Next

sVC10Installed = oShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\x86")

On Error Goto 0

b = true

If (sVC10Installed = "1") Then

b= false

End If

- Need to add this -> HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node
 
So the below needs to incorporate HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\VC\VCRedist\x86\Installed

'--------------------------------------------------------------------------
' Check for vc10 runtime
'--------------------------------------------------------------------------
On Error Resume Next
sVC10Installed = oShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86\Installed")
On Error Goto 0

bDoVC10 = true

If (sVC10Installed = "1") Then
bDoVC10 = false
End If

If bDoVC10 Then
'-----------------------------------------------------------------------
' Check for vc10 install
'-----------------------------------------------------------------------
bSuccess = false
sFile = strScriptPath + sVC10Install
If oFileSys.FileExists(sFile) Then
'---------------------------------------------------------------------
' Install vc10
'---------------------------------------------------------------------
sCmd = """" + sFile + """" + " /norestart"
iErr = oShell.Run(sCmd, 1, True)

If iErr = 0 Or iErr = 1641 Or iErr = 3010 Then
bSuccess = true
End If
End If

If Not bSuccess Then
bInstall = FALSE
sMsg = "WinMax requires the VC10 Runtime."
MsgBox sMsg, vbExclamation+VbOkOnly, sTitle
End If
End If
 
Back
Top