Location of files to be packaged

asked 14 Sep '11, 07:56

Jake's gravatar image

Jake ♦♦
826222226235
accept rate: 98%


When choosing the files and directories to be packaged in the installer, sometimes it is necessary to specify different locations depending on the build machine or operating system. For example, you may store your program files in /opt/repository in Unix systems and z:\repository on Windows. The simplest way to address this issue is to use the saveRelativePaths option and specify the path to files relative to the location of the XML project file (What does the "save relative paths" option mean? ). Sometimes, however, you may need more fine-grained control. In this case you can edit the XML directly and embed variables in the 'origin' field of distributionFile and distributionDirectory sections. These variables can be set in a preBuildActionList or refer to environment variables.

Example

<preBuildActionList>       
    <setInstallerVariable name="programroot" value="z:\repository">
          <ruleList>
              <platformTest type="windows" />
          </ruleList>
    </setInstallerVariable>
    <setInstallerVariable name="programroot" value="/opt/repository">
          <ruleList>
              <platformTest type="unix" />
          </ruleList>
    </setInstallerVariable>
</preBuildActionList>
<componentList>
<component>
...
<folderList>
...
<folder>
      <description>Program Files</description>
      <destination>${installdir}</destination>
      <name>programfiles</name>
      <platforms>all</platforms>
      <distributionFileList>
          <distributionDirectory origin="${programroot}/bin"></distributionDirectory>
      </distributionFileList>
</folder>
</folderList>
</component>

link

answered 14 Sep '11, 07:59

Jake's gravatar image

Jake ♦♦
826222226235
accept rate: 98%

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:

×29
×6

Asked: 14 Sep '11, 07:56

Seen: 1,192 times

Last updated: 15 Sep '11, 10:39