We control certain aspects of the installer building process with variables passed through the --setvars option. To get command lines less verbose, we'd like the builder to use default values if variable values are not 'forced' by the --setvars. We tried several rules (is True, lenght, is Equal...) to detect if a variable is set or not, but without success. My question is: Is it possible to detect (in a pre-build action) if a certain variable is actually set (i.e. was passed from the --setvars) and when it's not set, to set it to some default value?

asked 21 Jun '12, 19:30

Ray's gravatar image

accept rate: 0%

Currently there is no action to check this, however, you can check whether the variable contains text Unknown variable. For example:

<setInstallerVariable> <name>someVariable</name> <value>defaultValue</value> <ruleList> <compareText> <logic>contains</logic> <text>Unknown variable</text> <value>${someVariable}</value> </compareText> </ruleList> </setInstallerVariable>


answered 22 Jun '12, 07:22

wojciechka's gravatar image

wojciechka ♦♦
accept rate: 26%

The test in the example above should be the other way round to work:

        <value>Unknown variable</value>


answered 09 Nov '13, 00:24

daisyp's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 21 Jun '12, 19:30

Seen: 4,947 times

Last updated: 09 Nov '13, 00:24