Go Back   PackageDeploy Application Packaging Forums > Package Development > Application Packaging > Platformsdk MSI

Reply
 
LinkBack Thread Tools Display Modes
Old 06-03-2009, 06:02 AM   #1 (permalink)
Manas
Guest
 
Posts: n/a
Default 2717 Error with Embedded VBScript in MSI

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)

  Reply With Quote
Old 06-03-2009, 06:02 AM   #2 (permalink)
Manas
Guest
 
Posts: n/a
Default Re: 2717 Error with Embedded VBScript in MSI

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" <noname@noname.com> wrote in message
news:%23Q798KszJHA.1416@TK2MSFTNGP04.phx.gbl...
> 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)


  Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:21 PM.


vBulletin, Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
2007 - 2012 PackageDeploy.com