Hi; I currently have a variable (BuildDir)in my installer script that contains the base directory where all the files that are pulled into the installer are kept. This variable is hard coded in the script to a certain value. I am now starting to launch the installer build process from the command line and set that variable from the command line. It does not seem to accept the value i am passing in. here is the command line i am using:

"C:\\Program Files\\BitRock InstallBuilder Enterprise 8.0.2\\bin\\builder-cli.exe" build "C:\\build\\Setup\\SCS Communicator\\Communicator.xml" --verbose --setvars BuildDir="C:\\build" project.version=0.0.0.0021

When i run this it tells me that it can't find the first item it attempts to pull in. in fact it shows that it is trying to pull it in from the default directory that the installer script has.

here is the prebuildactionlist:

 <preBuildActionList>
    <setInstallerVariable>
        <name>QtDir</name>
        <persist>1</persist>
        <value>C:/Qt/4.8.0</value>
    </setInstallerVariable>
    <setInstallerVariable>
        <name>BuildDir</name>
        <persist>1</persist>
        <value>C:\\build2</value>
    </setInstallerVariable>
    <setInstallerVariable>
        <name>SchemaChangeNeeded</name>
        <persist>1</persist>
        <value>false</value>
    </setInstallerVariable>
    <createTimeStamp>
        <format>%m%d%Y</format>
        <variable>TimeStamp</variable>
    </createTimeStamp>
  </preBuildActionList>

asked 22 Feb '12, 16:08

shawn's gravatar image

shawn
5668
accept rate: 0%


Variables specified in --setvars are set before <preBuildActionList> actions are run, so your actions simply overwrite the values specified in command line.

You can simply add a check if BuildDir was previously specified - in this case it should be enough to add a rule to only set it if ${BuildDir} does not exist:

    <setInstallerVariable>
        <name>BuildDir</name>
        <persist>1</persist>
        <value>C:\\build2</value>
        <ruleList>
            <fileTest>
                <condition>not_exists</condition>
                <path>${BuildDir}</path>
            </fileTest>
        </ruleList>
    </setInstallerVariable>

This will only set BuildDir to default value if --setvars was not specified or did not specify an existing directory.

link

answered 28 Feb '12, 04:32

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

Would the samething be true when trying to set the installer version from the command line? What i see when i set the version from the command line is that the installer that is built is the correct version but when i look at the installer project xml shows the value that was already inside. IE: if the version listed in the project file is 15 and i set the version from command line to 18. When i check the project file it will still contain the version 15.

link

answered 10 Apr '12, 10:20

shawn's gravatar image

shawn
5668
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
×27
×23

Asked: 22 Feb '12, 16:08

Seen: 1,870 times

Last updated: 10 Apr '12, 10:20