01/15/2009 2379 views
I saw a previous posts where a user was having difficulty running a vbs script from within a Wise Studio built MSI and VBSscab stated the reason the user was having problems was because Wise Studio does not understand things like wscript. He recommended that they import their external script into the Binary table and possibly using the custom action "Call VB script from installation" to resolve this. Could anybody explain more specifically on how you actually do this? Below is the VBS script i'm trying to get to run during or after MSI install, any help is appreciated thank you. If anybody wants to know this script basically reads your current DevicePathValue Registry key saves the value then deletes the registry key and recreates it with the saved value plus an additional value %SYSTEMROOT%\inf\Reachback.

On error resume next
Set WshShell = WScript.CreateObject("Wscript.Shell")
DevicePathValue = WSHShell.RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\DevicePath")
OldPath = DevicePathValue
addpath = "%SYSTEMROOT%\inf\Reachback"
Newpath = Replace(lcase(OldPath),lcase(AddPath)+";","")
if instr(lcase(OldPath),lcase(addpath))=0 then OldPath=OldPath&";"&AddPath
WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\DevicePath", OldPath
0 Comments   [ + ] Show comments


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

All Answers

If it workes outside of the MSI then just use the line below instead.
Set WshShell = CreateObject("Wscript.Shell")
' remove "WScript."
Answered 01/15/2009 by: AngelD
Red Belt