Getting Installer to Receive Command-line Parameters

Got a problem you cannot solve? Try here.
Post Reply
dencolp
Posts: 5
Joined: Thu May 01, 2008 4:33 pm

Getting Installer to Receive Command-line Parameters

Post by dencolp »

Hi InstallAware Gurus,

Thank you in advance for your help.

Please consider the following basic procedure:

- Create a very basic installer called, say, mysetup.exe.
- Initialize a variable called MYVAL to an empty string.
- Write the value of $MYVAL$ to a text file.
- From the command-line (cmd.exe), run: mysetup.exe MYVAL=TRUE
- Curiously, after mysetup.exe runs, the text file does not contain "TRUE" as you would expect it to.
- Uninstall mysetup.exe
- From the command-line (cmd.exe), run: mysetup.exe /s MYVAL=TRUE
- Now the text file does contain "TRUE"

This proves that you need to add "/s" to ensure your command-line variables are received.

Is there a way to get the installer to receive your command-line variables if you are NOT running in silent mode.

Thanks,
Dencolp.
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Re: Getting Installer to Receive Command-line Parameters

Post by MichaelNesmith »

That is correct - command line variables lock out script commands such as Set Variable from changing variable values assigned from the command line only when setup is running silently.

Otherwise, you can use the $CMDLINE$ pre-defined variable, and the Parse String commands to inspect the setup command line.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Post Reply