cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

running a vbs before installation

Hello all.

I'm a beginner in MSI authoring and repackaging so bear with me. 😃

This is my scenario: I've written a piece of code in vbs and I'm calling wscript.exe to run it during the MSI installation. The problem however is that I do not know how to incorporate the vbs-file inside the MSI and call it before the files are installed.

The vbs runs a 3rd commandline remover for the application I've repackaged.

I have learned that creating a custom action and giving the vbs-filename as a paremeter to wscript.exe leads to wscript.exe searching the vbs in the MSI's current directory.

How can I stick the vbs inside the MSI and run it before the files are installed to the destination pc?

Many thanks in advance,

-m-
(1) Reply
You have several things to consider...

1) Debugging VBS in MSI is a royal pain in the rear. Consider other approaches first.

2) VBS files in MSI are not executed using WScript. They are executed using ActiveScript. Some code changes may need to occur or you'll have problems which you can't debug. ( See #1 )

3) You don't pass command line args to a VBS in MSI. You use the session object to reference properties. ( varString = Session.Property("PROPNAME") )

4) Custom actions that modify the system should be placed in the execute sequence within the rollback transaction. They should run with defferred execution and a corrosponding rollback action should exist to undo their changes. You may also need a commit action. InstallSite.org has a white paper that covers this pretty well.

5) Read my blog ( "Chris's Repackaging Rant" ) to know why I think its dangerous for a SysAdmin to use a wizard to repackage applications using MSI.

Good luck,
Chris