I'm building an package with two main component trees of three subcomponents in each tree. Each component is a group consisting of the main files and another subcomponent for the source code. I'm developing the installer package on an Ubuntu 10.04LTS host.

I can not re-distribute the source code in one subcomponents. So, I build a UI using parameters that collect users information and download the tarball via httppost.

I expand the tarball and compile the source code from the <readytoinstallactionlist>. Then in the <postinstallationactionlist>, I <adddirectoriestouninstaller> with <addcontents> = 1 for the entire folder tree including the source, resulting binaries and tarball. This tarball does not include any .svn or .git information.

I want users to be able to uninstall each component individually. The uninstaller reports success when I uninstall only this component, but it leaves the files on the host. When I remove the entire package, the files that should have been are removed before are removed. All of the other components/subcomponents uninstall properly/incrementally.

What am I missing? How can I get these files to register properly and remove at the right time with the uninstaller?

Thanks, Tom

asked 26 Apr '12, 11:31

tahoar's gravatar image

accept rate: 42%

Currently, it is only possible to add files manually to the uninstaller belonging to the project, so they are just deleted when the full application is deleted. We will improve the actions to support registering the files to a particular component but in the meantime, if you can safely delete all the contents, you could place a <deleteFile> action in the <preUninstallationActionList> of the component:

      <!-- 'somedir' is the directory containing the files not registered --> 
      <deleteFile path="${installdir}/foo/somedir"/>

answered 26 Apr '12, 11:44

juanjo's gravatar image

juanjo ♦♦
accept rate: 23%

Thanks Juanjo. It looks like my system is functioning within design limits. I used the <preuninstallationactionlist> and went a step further. During install, I save a log of all files I install and then parse the file in the <preuninstallationactionlist> step. Thanks.

(26 Apr '12, 13:02) tahoar

In order to properly unpack and remove files, you can use InstallBuilder's downloadable components feature, which allows you to generate all or some of the components as external files that get downloaded by InstallBuilder automatically.

All that is needed is to set <downloadable> = 1 for component(s) that should be downloaded and make a build with downloadable components enabled.

In order to build the project with downloadable components enabled, the --downloadable-components flag should be passed to the CLI.

$ path/to/bin/builder build project.xml linux --downloadable-components

When using the GUI, the downloadable components checkbox should be enabled in the Build section before building the project.

It is documented in more details in the Downloadable components section of InstallBuilder User Guide.

With your current solution, the <addDirectoriesToUninstaller> action currently adds the files to uninstaller for project, not individual components. What you can do is add <deleteFile> action to <preUninstallationActionList> for <component> that unpacks the files. The path should be one or more files/directories that the tarball has created.


answered 26 Apr '12, 11:39

wojciechka's gravatar image

wojciechka ♦♦
accept rate: 26%

I looked at downloadable components, but this download requires the user to forward license agreement and other information via an httpPost. I don't see in the downloadable component documentation that this is supported. Am I missing something?

(26 Apr '12, 12:07) tahoar

In order to pass additional parameters, you can either specify a variable in <componentsurl> - i.e. componentsUrl="http://example.com/downloadcomponents/${somedata}". This way each component will have its data passed. An alternative is to set URL for each component to something like url="http://example.com/downloadcomponents/component-1.0.pak?${querydata}".

You can either use <urlencode> action to encode the data. You can also do a httpPost and create a session-like solution - i.e. have httpPost generate a session that is valid for some time and use it for download URLs to validate download.

(27 Apr '12, 02:54) wojciechka ♦♦
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](http://url.com/ "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: 26 Apr '12, 11:31

Seen: 1,585 times

Last updated: 27 Apr '12, 02:54