I am trying to use the application version that I pass in using --setvars and set to the project.version of the build script. The variable is known when creating the installer, because the filename contains the version I passed in with --setvars for the outdir. The issue is that when I go to run the installer on the user machine, the variable is unknown for some reason. Is there an explicit method for persisting this version information so that upon installation, I can reuse this variable?


Command Line:

"C:\Program Files (x86)\BitRock InstallBuilder Enterprise 8.0.2\bin"\builder-cli.exe build "C:\Build\Build_Mainline\Setup\SCS Communicator"\Communicator.xml windows --verbose --setvars app_version=${env(APP_VERSION)} BuildDir=C:\Build\Build_Mainline\


                    <programArguments>-F "${installdir}\StonewedgeCONNECT.exe" -V ${project.version}</programArguments>
 <outputDirectory>../../../Build_Local_Depot/Operations/Pre-Release_Software/Stonewedge Connect/CONNECT_${project.version}</outputDirectory>



But when I run it on the user system, I get the following error from the bitrock_installer.log:

 Executing ServiceConfigswitch.exe -F "C:\Program Files (x86)\Stonewedge Corporation\StonewedgeCONNECT\StonewedgeCONNECT.exe" -V ***unknown variable app_version***

Any help would be appreciated.

asked 14 Jun '12, 15:10

phoey's gravatar image

accept rate: 0%

Variables defined at build-time are not available at run-time. The usual solution for this is to define a hidden parameter:

    <stringParameter name="app_version" value="" ask="0"/>

But in your case, as you are just using the variable to configure a project setting, you could just configure it directly:

builder-cli.exe build Communicator.xml windows ... --setvars project.version=${env(APP_VERSION)} ...

answered 14 Jun '12, 16:45

juanjo's gravatar image

juanjo ♦♦
accept rate: 23%

Thank you for the reply.

I am still unable to get the version information (after using the --setvars) at install time. (Installer Version: 8.0.2 (2012-01-24))

I tried setting the version tag with and without the passed in value, but both results in an empty "project.version" variable when I go to run the postinstall step.


Executing ServiceConfigswitch.exe -F "C:\Program Files (x86)\Stonewedge Corporation\StonewedgeCONNECT\StonewedgeCONNECT.exe" -V

The version for the -V parameter is empty.

(14 Jun '12, 18:19) phoey

Sorry, I just realized you are passing the variable through command line as ${env(APP_VERSION)}. That is an InstallBuilder notation and won't work in the command line. If APP_VERSION is defined as an environment variable, the proper way of calling the builder would be:

builder-cli.exe build Communicator.xml windows ... --setvars project.version=%APP_VERSION% ...

(15 Jun '12, 03:14) juanjo ♦♦

Yes, that was it! Thank you very much for your help!

(15 Jun '12, 09:00) phoey
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: 14 Jun '12, 15:10

Seen: 1,900 times

Last updated: 15 Jun '12, 09:00