Is there any way to access the list of files packed in the installer? I would like to iterate over this list. For each file, all I need is the name of the file and its target location.

Better still, can this be done for specific components and/or folders via their name attributes?

The reason I'd like to be able to do this is that in my update installer, a subset of the files have modified file names (because some filenames contain the version information). For these, I would like to be able to handle the removal of older versions without necessarily needing to know the exact names.

For example, if I'm installing


I'd like to clean up other instances of


If such enumeration of the packed files is not possible, is there an alternative approach I should consider? (I do not wish to have to run the uninstaller.)

Likewise, are there mechanisms for getting the name of any existing uninstaller and/or iterating over the files referenced in the uninstaller?

Alternatively, is there a mechanism for supplying a wildcarded name for replacing files?

For updates, there is an <overwritePolicy/> that can be used to control the replacement of files who's name remains the same.

It there a way to express something like this:


or better still, some sort of regex-based replacement rule:



asked 20 Jan '12, 05:33

Rhubbarb's gravatar image

accept rate: 0%

Another thought: the <overridePolicy/> (or <replacePolicy/>) options could include "onlyIfLaterVersion".

(20 Jan '12, 09:31) Rhubbarb

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:

            <deleteFile path="${installer}/libs/lib-A_v*.dll"/>

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.


answered 23 Jan '12, 09:59

juanjo's gravatar image

juanjo ♦♦
accept rate: 23%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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



Asked: 20 Jan '12, 05:33

Seen: 1,516 times

Last updated: 23 Jan '12, 09:59