Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing argument to script in custom actions

Status
Not open for further replies.

ryDen

Programmer
Jun 6, 2002
71
AP
Hi,

I have created a setup project, and also a vbscript to execute the file after installation. My problem is, how do I pass the installed directory path to the vbscript, and also, how should I read the argument from the script?

At present, after adding the .vbs to the Commit node of the Custom Actions, I have entered "[TARGETDIR]<file>.exe" into the CustomActionData field, and in my script, use WScript.Argument to obtain the 2nd argument. The script runs correctly from a command line, however, when run from the setup file, an error message pops up indicating failure to run the script. I have tried to comment out the WScript.Argument and hard-code the executable path, and it works, so, the issue lies with that line.

In this case, how should I go about this as I do not want to hardcode the executable path in case the installed directory is changed. Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top