Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

2717 Error with Embedded VBScript in MSI

51 views
Skip to first unread message

Manas

unread,
May 6, 2009, 11:20:12 PM5/6/09
to
I have an embedded VBScript which runs fine externally but when running the
MSI I get Error 2717..It is a very simple script that first imports a key
then deletes it and then exports it back using reg.exe. reg.exe is a native
windows application. The script runs fine externally. I am relatively new to
VBScript as well as MSI world so would appreciate some inputs....Thanks!

The VBScript is as follow:

Option Explicit
Dim objShell

WScript.Echo("beginning " & Now)
Set objShell = CreateObject("WScript.Shell")

'check for reg file and delete if exists
objShell.Exec "%comspec% /k IF EXIST %TEMP%\temp.reg del %TEMP%\temp.reg"
WScript.Echo("deleted file temp.reg in %TEMP% if exists")

objShell.Exec "%comspec% /k reg.exe EXPORT
HKLM\Software\xxxxxx\xxxxxx\xxxxxx %TEMP%\temp.reg "
WScript.Echo("exported HKLM\Software\xxxxxx\xxxxxx\xxxxxx to
%TEMP%\temp.reg")

objShell.Exec "%comspec% /k reg.exe DELETE
HKLM\Software\xxxxxx\xxxxxx\xxxxxx /f"
WScript.Echo("deleted key HKLM\Software\xxxxxx\xxxxxx\xxxxxx")

WScript.Echo("sleeping for 10 seconds........")
WScript.Sleep(10000)
objShell.Exec "%comspec% /k reg.exe IMPORT %TEMP%\temp.reg"
WScript.Echo("imported %TEMP%\temp.reg to
HKLM\Software\xxxxxx\xxxxxx\xxxxxx")

WScript.Echo("sleeping for 10 seconds........")
WScript.Sleep(10000)
objShell.Exec "%comspec% /k IF EXIST %TEMP%\temp.reg del %TEMP%\temp.reg"

WScript.Echo("completed " & Now)

Manas

unread,
May 7, 2009, 4:29:47 AM5/7/09
to
fixed it...condition was wrong...secondly if anyone is interested none of
the WScript.Echo, .Sleep commands work in CAs as they are run via the vbs
interpreter and not the entire sripting host, and so some variables or
functions are not available in those custom actions. I had to change the
script and use pings (to 127.0.0.1) as sleeps....

"Manas" <non...@noname.com> wrote in message
news:%23Q798Ks...@TK2MSFTNGP04.phx.gbl...

0 new messages