1
votes

Im trying to use a VBScript in an WIX/MSI installer, called as such from command line: cscript .vbs

This has been called in a cmd file from an old installer, but is it possible to do it in a single custom action in Wix? I have tried to pass the args with ExeCommand but this then changes the CA type to 66 and tries to execute the . Is this even possible? If so, how does one go about it? I'm resisting the need to "install" the vbs file, run it, then remove it (or leave it in the program files directory).

1
WiX has support for just calling vbscript custom actions, and they can be in the Binary table so they don't need installing. Typically people pass parameters via properties, but to answer that you'd need to show some WiX to see if your CA is immediate, deferred etc. stackoverflow.com/questions/9429858/… VBScript CAs are frowned on though.PhilDW
thing is, i dont want to rewrite all the legacy code/custom actions, its also stuff that interfaces with IIS 5/6, setting permissions and mappings for HTTPHandlers. I know VBScript is awful, but im just trying to figure out the best way to cope at the moment. when we move to support only IIS 7 in the distant future, theres the server management objects that can be brought into c# and i can be done with vbs! (hopefully)Chris Watts
Im using adsutil.vbs if that helps? thought it was an internal vbs script but turns out its a windows one.. trying to pass args to that script and run without copying onto the system.Chris Watts
You'll need to install it then because you have no choice except to run it with a cscript command line, and that requires it to be on the system. It won't wotk hosted as a custom action in Windows Installer because it uses the WScript object, which is supplied by WSH, not Windows Installer. Don't the WiX IIS extensions help?PhilDW
if you make that an answer ill accept it, it answers the question. Ill have a look at the IIS extensions, because im not writing a proper website installer, only installing handlers for this small section of the project, i hadnt considered the extensions may be useful.. stupid i knowChris Watts

1 Answers

1
votes

You'll need to install it because in your scenario you have no choice except to run it with a cscript command line, and that requires it to be on the system. It won't work hosted as a custom action in Windows Installer because it uses the WScript object, which is supplied by WSH, not Windows Installer. Don't the WiX IIS extensions help?

The other alternative is to modify that script to your requirement so it can be run as a custom action without it being installed - that will depend on how familiar you are with vbscript, and avoid using the WScript object there.