cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jyujyu
Level 2

Registry Permissions? CA Vbscript error 80070002

Hi, just to let you know, I'm relatively new to InstallShield and vbscript. I'm developing an install client for our company's software. Anyway, I have a vbscript custom action that looks into the registry for an existing key. And how I continue the install and other scripts down the line depends on the existence/non-existence of this key (and others)

Basically, I narrowed the problem to this bit of code:

Assume that key = "HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\"

Function KeyExists(key)

Dim objShell

On Error Resume Next
Set objShell = CreateObject("WScript.Shell")
objShell.RegRead(key)
Set objShell = Nothing
If Err = 0 Then
KeyExists = True

Else
MsgBox "Err#: " & Err.Number & " " & Err.Description
Err.Clear
KeyExists = False

End If

End Function


Now, this function hasn't given me problems before on 2 Win7 boxes(x86 & x64), and an XP box. If the key doesn't exist, that's fine, I keep going. (I added the Else part for debugging.)

My problem is that on this other Windows XP machine I'm testing the key DOES exist, and RegRead errors out. If I comment out the "On Error Resume Next" line, I get Error Code 80070002, "Unable to open registry key "HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\", Source WshShell.RegRead.

I usually try to experiment with things myself for a while and figure it out, but I can't for the life of me figure out why this is happening.
To summarize what I know:

1) The test box is running Windows XP (x86)
2) I have checked and double checked that I have Admin read/write permissions to the registry.
3) I can access and edit the aforementioned registry keys through regedit with no problem
4) The key exists and contains data values.
5) I have tried inputting the key with and without the trailing backslash
6) I have disabled all Auto-Protect items in the Symantec AntiVirus 10 that is installed on this computer, as well as killed all its running processes using ProcessExplorer
7) My scripts have worked as planned on other computers.

I figure this is less of an InstallShield problem and more of a problem on the box I'm testing, but I wanted to see if anyone here could help me out. Thanks for taking the time to read through my problem.
Labels (1)
0 Kudos
(1) Reply
lostboyz
Level 4

I'm also facing the same problem. Any Help F1!!!

I doubt this problem with the VBScript.
0 Kudos