Is it possible to enumerate the packed files?

Comments

1 comment

  • Avatar
    juanjo

    It is not possible to check packed files at runtime. Regarding cleaning old files, an possible solution would be to organize the files to upgrade into component and include there the cleaning:

    <component>
       <name>libA</name>
       <folderList>
          <folder>
             <name>libACleaning</name>
             <actionList>
                <deleteFile path="${installer}/libs/lib-A_v*.dll"/>
             </actionList>
         </folder>
         <folder>
             <name>libA</name>
             <destination>${installdir}/libs</destination>
             <distributionFileList>
                <distributionFile>
                   <origin>${myOrigin}/lib-A_v${myVersion}.dll</origin> 
                </distributionFile>
             </distributionFileList>
         </folder>
      </folderList>
    </component>
    

    Also, adding checking for a version in the <overridePolicy/> could be very complex as there is not a standard way. For example, for a Windows binary it may be possible to check the resources to check the version but it would not work in other platforms.

    Another approach you could follow is to write a file with the current installed version and also store the current packed version in a variable. Then at runtime, if the packed version is greater, delete all the files, and if not, deselect the component.

Please sign in to leave a comment.