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

Ray
11222
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>

link

answered 22 Jun '12, 07:22

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

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

    <compareText>
        <logic>contains</logic>
        <text>${someVariable}</text>
        <value>Unknown variable</value>
    </compareText>

link

answered 09 Nov '13, 00:24

daisyp's gravatar image

daisyp
5446
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

By RSS:

Answers

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

Tags:

×41
×10
×7
×6
×5
×3
×2

Asked: 21 Jun '12, 19:30

Seen: 4,852 times

Last updated: 09 Nov '13, 00:24