|
|
#1 (permalink) |
|
Guest
Posts: n/a
|
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) |
|
|
|
#2 (permalink) |
|
Guest
Posts: n/a
|
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) |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|