Variables overwritable state.

Got a problem you cannot solve? Try here.
Post Reply
Frank
Posts: 59
Joined: Tue Oct 27, 2009 9:16 am
Location: Netherland

Variables overwritable state.

Post by Frank »

I'm puzzled by variables and I need someone to explain it to me.
Because "practice makes perfect", I've tried to figure it out myself. This is what I think is going on.

There are 2 types of variables.
1. Pre-defined (like REMOVE, MAINTENANCE, NEEDSUPGRADE etc.)
2. User defined (like MYVAR1, HELLOWORLD, FAILURE etc.)

There are 2 ways of running an installer:
1. Silent (no user interaction)
2. 'Loud' :) (with user interaction)

If you run silent, you can overwrite pre-defined and user defined variables by adding them to your CMDLINE.
Inside your script, the calls to 'Set Variable' don't have any effect, they will NOT change the value passed via the CMDLINE.

If you run 'loud', you can overwrite pre-defined variables. You can't overwrite user defined variables.
Inside your script, the calls to 'Set Variable' don't have an effect on the pre-defined variables, they will NOT change the value passed via the CMDLINE.
Inside your script, the calls to 'Set Variable' will set the value for the user defined variable, they WILL change the value passed via the CMDLINE.

If you specify no CMDLINE, then the script 'says' it all.

I'd like someone of InstallAware to have quick look and tell me if I'm right :)
I had a hard time figuring this one out by the help file itself, some clarification in the manual will go a long way.
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Variables overwritable state.

Post by mills »

When running in silent mode, set variable does not affecting any variable that is assigned a value through the command line, retaining the initial value set through command line throughout the script.
My tests (logged output):

>"My Setup.exe"

-Start logging...
#before test is first set...
test = $test$
MYAH_TIMEOUT = 10

#The test
test = I am a test variable.
MYAH_TIMEOUT = 10

#After attempting to set change again...
test = Did test change?
MYAH_TIMEOUT = 1234
-Stop logging...

>"My Setup.exe" test=foo MYAH_TIMEOUT=999

-Start logging...
#before test is first set...
test = foo
MYAH_TIMEOUT = 999

#The test
test = I am a test variable.
MYAH_TIMEOUT = 999

#After attempting to set change again...
test = Did test change?
MYAH_TIMEOUT = 1234
-Stop logging...

>"My Setup.exe" /s test=foo MYAH_TIMEOUT=999

-Start logging...
#before test is first set...
test = foo
MYAH_TIMEOUT = 999

#The test
test = foo
MYAH_TIMEOUT = 999

#After attempting to set change again...
test = foo
MYAH_TIMEOUT = 999
-Stop logging...
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
Frank
Posts: 59
Joined: Tue Oct 27, 2009 9:16 am
Location: Netherland

Re: Variables overwritable state.

Post by Frank »

Thank you for that response, it took me a couple of times to read, before I understood, but I'm getting the point :)
I can now also assume that, with respect to this topic, there is no difference between the behaviour of pre-defined and user variables?
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Variables overwritable state.

Post by mills »

Yes, I could not identify any difference in behavior between the pre-defined and user defined variables.
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
Frank
Posts: 59
Joined: Tue Oct 27, 2009 9:16 am
Location: Netherland

Re: Variables overwritable state.

Post by Frank »

Well that's the end for this thread then. Thank you for your answer. I'll jot this down in my little black book (actually it's not black, but hey!) :)
Post Reply