Debugging VBScripts in InstallShield is a pain in the neck. Old school debugging, i.e. writing to log files, is best, since, you won't be able to capture error messages, etc.
Also reading and writing to the registry from InstallShield can be done via winmgmts but it's a pain. Here's an example that demonstrates this. Since our app uses 32 bit registry keys and we didn't know if it was being processed by 32 bit or 64 bit Windows, we had to check both locations for the 32 bit registry key (i.e. the Wow6432Node).
Here's some code we used to read the registry:
Option Explicit
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Dim SoftVersion
SoftVersion = RegReadString("HKLM\SOFTWARE\Co\Software\Version")
If SoftVersion = "" Then
SoftVersion = RegReadString("HKLM\SOFTWARE\Wow6432Node\Co\Software\Version")
End If
Function RegReadString(path)
' RegRead = CreateObject("WScript.Shell").RegRead(path)
Dim objReg, hkroot, pos, posNext, keyPath, valueName, value
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
hkroot = HKEY_CURRENT_USER
If Left(path, 5) = "HKCU\" Then
hkroot = HKEY_CURRENT_USER
path = Mid(path, 6)
ElseIf Left(path, 5) = "HKLM\" Then
hkroot = HKEY_LOCAL_MACHINE
path = Mid(path, 6)
End If
pos = InStr(path, "\")
posNext = InStr(pos + 1, path, "\")
While posNext > 0
pos = posNext
posNext = InStr(pos + 1, path, "\")
Wend
keyPath = Left(path, pos - 1)
valueName = Mid(path, pos + 1)
objReg.GetStringValue hkroot, keyPath, valueName, value
If IsNull(value) Then
RegReadString = ""
Else
RegReadString = value
End If
End Function
Sub RegWriteString(path, value)
Dim objReg, hkroot, pos, posNext, keyPath, valueName
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
hkroot = HKEY_CURRENT_USER
If Left(path, 5) = "HKCU\" Then
hkroot = HKEY_CURRENT_USER
path = Mid(path, 6)
ElseIf Left(path, 5) = "HKLM\" Then
hkroot = HKEY_LOCAL_MACHINE
path = Mid(path, 6)
End If
pos = InStr(path, "\")
posNext = InStr(pos + 1, path, "\")
While posNext > 0
pos = posNext
posNext = InStr(pos + 1, path, "\")
Wend
keyPath = Left(path, pos - 1)
valueName = Mid(path, pos + 1)
objReg.SetStringValue hkroot, keyPath, valueName, value
End Sub
```