How can I prevent files extracted using unpackDirectory from being extracted again during the install phase?

Comments

1 comment

  • Avatar
    michiel

    It's possible to do this. First you add a rule to the folder you want to unpack and make sure it's always false. In this way the files will be packed but never unpacked by the installer.

    <folder>
          <description>Program Files</description>
          <destination>${installdir}</destination>
          <name>programfiles</name>
          <platforms>all</platforms>
          <distributionFileList>
            <distributionFile>
              <origin>files</origin>
            </distributionFile>
          </distributionFileList>
          <ruleList>
            <isTrue>
              <value>0</value>
            </isTrue>
          </ruleList>
        </folder>
    

    You can then unpack the file and if necessary use <copyfile> to copy the unpacked file to the installdir in the <postInstallationActionList>:

    <preInstallationActionList>
        <unpackDirectory>
          <component>default</component>
          <folder>programfiles</folder>
          <origin>files</origin>
          <destination>/tmp</destination>
        </unpackDirectory>
      </preInstallationActionList>
      <postInstallationActionList>
        <copyFile>
          <origin>/tmp/files</origin>
          <destination>${installdir}/files</destination>
        </copyFile>
      </postInstallationActionList>
    

    https://installbuilder.bitrock.com/docs/installbuilder-userguide.html#_unpacking_before_installation_time

    https://installbuilder.bitrock.com/docs/installbuilder-userguide.html#_copy_file

Please sign in to leave a comment.