Passing commandline variables to Custom Action/Script - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

ssearles
Posts: 65
Joined: Tue Oct 30, 2007 12:54 pm

Passing commandline variables to Custom Action/Script

Does anyone have an example of script code that would be able to take a variable defined in a command-line and pass it to a Custom Action/script for processing?

Example:

msiexec /i WizBangInstaller.msi MY_VARIABLE_NAME_HERE="blah"

Then in the Custom Action, the value "blah" is evaluated and the script does something specific (kinda like a Case conditional or something).


Thanks in advance,
ssearles
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Passing commandline variables to Custom Action/Script

Hello ssearles,

you have the syntax for setting a property already, given in your example.

In a script you can access that property like this (JScript):

var theValue = Session.Property("MY_VARIABLE_NAME_HERE");



With best regards

Clemens Anhuth

Return to “Common Problems”