Need Help with supplying CMDLINE variables

Got a problem you cannot solve? Try here.
Debstep
Posts: 33
Joined: Fri Jan 06, 2006 6:28 pm

Need Help with supplying CMDLINE variables

Postby Debstep » Tue Apr 18, 2006 4:26 pm

I do not seem to be able to get my script to read variables from the command line. I am trying to pass them this way
setup.exe VAR1=VAL1 VAR2=Value2 etc...

Any Ideas What I could have left out? These variables are not reset to the values passed in through the commandline when I run my uncompressed or compressed Setup.

Also, Can I pass these variables directly to the msi created in an uncompressed build? ( I cannot currently do this but is it possible by running a command line like mymsi.msi /i VARIABLE1=VAL_1 VAR2=Val2 /l=./Install.log

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

Postby MichaelNesmith » Tue Apr 18, 2006 6:03 pm

Command line variable values are not locked in unless they are set in a silent setup - they will be overriden by the setup script values otherwise. If you want to parse the command line, you can use the If command with the "Contains" value, or the Parse String command to read command line values.

Additionally, you cannot pass parameters to MSI files directly - you still need to pass them through the EXE file, which will configure the MSI file for you.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

Debstep
Posts: 33
Joined: Fri Jan 06, 2006 6:28 pm

Postby Debstep » Wed Apr 19, 2006 11:00 am

Thanks Michael....I'll experiment with this.
Is it possible to provide a text file containing the variables for an exe not being run in Silent mode?

Debstep
Posts: 33
Joined: Fri Jan 06, 2006 6:28 pm

Postby Debstep » Wed Apr 19, 2006 11:07 am

Also, If I am parsing the CMDLINE (when not running in Silent mode) , is there a standard Delimiter for the values ( what if a value contains a space) or are there any disallowed characters?

Debstep
Posts: 33
Joined: Fri Jan 06, 2006 6:28 pm

Postby Debstep » Wed Apr 19, 2006 11:25 am

...and how do you recommend debugging the command line when running the program in Debug mode?....

Debstep
Posts: 33
Joined: Fri Jan 06, 2006 6:28 pm

Postby Debstep » Wed Apr 19, 2006 1:33 pm

Here's my progress So far
I created a separate script for parsing the Commandline ( if not running in Silentmode)

I call this script AFTER the section of my code that initializes my default variables.

I had to set up a dummy string to represent the CMDLINE since I cannot get the value of the CMDKINE variable in the debugger :twisted:

I create a custom /p switch

I search my dummy CMDLINE for the presence of the /P

then parse the strings and variables out

I did have to include the values of the variables in " " ( made parsing a lot easier if there are multiple Variables and values.
an Elseif option sure would have been nice in this instance...

When Supplying the variables, I did have to enter \\\\ for \\ even though the value was enclosed in " "

Now I will have to see what happens to these options if I run in Silent mode

Debstep
Posts: 33
Joined: Fri Jan 06, 2006 6:28 pm

Postby Debstep » Fri Apr 21, 2006 9:42 am

silly me....can't use a /p that's for a patch change it to /b to intercept the commandline when running the user interface.


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 237 guests