Comments

1 comment

  • Avatar
    Jake

    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>

Please sign in to leave a comment.