1 comment

  • Avatar

    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.


        <setInstallerVariable name="programroot" value="z:\repository">
                  <platformTest type="windows" />
        <setInstallerVariable name="programroot" value="/opt/repository">
                  <platformTest type="unix" />
          <description>Program Files</description>
              <distributionDirectory origin="${programroot}/bin"></distributionDirectory>

Please sign in to leave a comment.