Hi,

I've got a little problem with a script stored in a CA which should create some ActiveSetup regkeys.

For testing purposes I've set a MsgBox at the top of the script to ensure that Windows Installer is entering it and so
far it is working. The mistake must be somewhere in the first three lines because as soon as i click away my error
message i get MSI error 1720. My secound MsgBox after "Set StdOut = WScript.StdOut" isn't displayed.

Someone has an idea where the problem could be?

Greetings


const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\Microsoft\Active Setup\Installed Components\{0463bb93-634e-453c-a69b-09776a50d422}"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath

strKeyPath = "SOFTWARE\Microsoft\Active Setup\Installed Components\{0463bb93-634e-453c-a69b-09776a50d422}"
strValueName = "(Default)"
strValue = "blahblahblah"
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

strKeyPath = "SOFTWARE\Microsoft\Active Setup\Installed Components\{0463bb93-634e-453c-a69b-09776a50d422}"
strValueName = "StubPath"
strValue = "%windir%\system32\cmd.exe /c "asdfasdf"
oReg.SetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

strKeyPath = "SOFTWARE\Microsoft\Active Setup\Installed Components\{0463bb93-634e-453c-a69b-09776a50d422}"
strValueName = "Version"
strValue = "1,0,0,0"
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
This line looks wrong:
strValue = "%windir%\system32\cmd.exe /c "asdfasdf"
It should probably be:
strValue = "%windir%\system32\cmd.exe /c " & chr(34) & "asdfasdf" & chr(34)
Answered 01/13/2011 by: captain_planet
Second Degree Brown Belt

Please log in to comment
0
...and considering 'Set StdOut = WScript.StdOut' does nothing, remove it. [;)]
Answered 01/13/2011 by: captain_planet
Second Degree Brown Belt

Please log in to comment
0
Already found the problem by myself :)
The line Set StdOut = WScript.StdOut caused the error.

Thank you!
Answered 01/13/2011 by: Teitan
Senior Purple Belt

Please log in to comment
Answer this question or Comment on this question for clarity