Page 1 of 1

'If Variable Not Defined' how does it work?

Posted: Wed Nov 03, 2010 6:41 am
by Frank
I'm trying to pass several properties to the installer.
Inside the script I'd like to check if the properties were actually set.

I've got code like this:

Code: Select all

If Variable WRITEREGISTRYKEYS not is Defined
    Comment: Do we need to write registry keys? Default is no
    Set Variable WRITEREGISTRYKEYS to FALSE
end
Now the 'compiler' complains: Variable not defined: WRITEREGISTRYKEYS.
Well duh! :o
What good is having a check for variable defintion if you can't use it. What am I missing here?

I can create a MSI with a set of default properties via the GPO, but if an the deployment via AD requires one of them to change, I need to be sure that the other defaults are kept (some how). The properties get lost if you don't specify them, so how to go about that?

Re: 'If Variable Not Defined' how does it work?

Posted: Wed Nov 03, 2010 3:12 pm
by mills
The code you post should work, as this works for me (at the start of a basic setup):

Code: Select all

if Variable test not is Defined 
  MessageBox: is Defined?, test is not defined!
  Set Variable test to 
end
if Variable test is Defined 
  MessageBox: test is defined, test is defined!$NEWLINE$Test = "$test$"
end
What version of InstallAware are you using?

Re: 'If Variable Not Defined' how does it work?

Posted: Thu Nov 04, 2010 1:19 am
by Frank
Hi Andy,

I'm running IA9 Studio Moya sp1.070409 (according to the version screen).
I'm defining the variables in the region 'Define Setup Globals'. Maybe that's an issue.

The only reason I want this is: The commandline properties are overwritten because an user doesn't start the MSI silently.
Now, from ploughing through the InstallAware forums (thank God for those :D) I found that I shouldn't be (ab)using MSI that way.

If the MSI is run silently then it'll either:
1. Take the properties as passed during creation via de GPO Wizard
2. Take any of those properties and overwrite it with whatever the user has specified on the commandline. It'll leave others untouched

If the user doesn't start the MSI silently, then theses properties are beter handled in the UI. At first it didn't make sense, but I started to realize how this is logical.
Why pass this through a commandline when the user is interacting with the installer. Why 'hide' these parameters. Like I said after sometime it started to make sense at which point this topic isn't relevant anymore.

Still, if you think that it should've worked and you'd like more info just let know.