My application's installation directory has a number of directories that accumulate additional files through normal use of the application. For example, ${installdir}/configuration is one such.

I've tried all the options I could think of to delete these directories during uninstallation, but only a deleteFiles action in postUninstallerActionList seems to do the trick. And of course, that fails to delete the installation directory.

Here are the other things I've tried:

<preUninstallerActionList>
  <AddDirectoriesToUninstaller>
    <addContents>1</addContents>
    <files>${installdir}/configuration</files>
  </AddDirectoriesToUninstaller>
</preUninstallerActionList>

This had no effect - perhaps because files in the directory were already on the uninstall list?

<preUninstallerActionList>
  <AddFilesToUninstaller files="${installdir}/configuration"/>
</preUninstallerActionList>

Also no effect. I figured maybe this would work if I first "removed" the directory from the uninstaller, but the following also did nothing:

<preUninstallerActionList>
  <RemoveFilesToUninstaller files="${installdir}/configuration"/>
  <AddFilesToUninstaller files="${installdir}/configuration"/>
</preUninstallerActionList>

I also tried the above with configuration/* instead of configuration in the remove entry.

Would appreciate an indication of how to do this properly. In the meantime I'll go with the only working option I could find (post-uninstaller delete); while it fails to delete the installation directory, at least that directory is left empty.

Thanks

asked 13 Feb, 13:56

andylowry's gravatar image

andylowry
1
accept rate: 0%


The <addDirectoriesToUninstaller> action can only delete files registered at build time. It is however possible to use <addFilesToUninstaller> for that purpose. If this action is used with directories, the uninstaller will delete them regardless of the changes in its contents:

  <postInstallationActionList>
  ...
    <addFilesToUninstaller>
      <files>${installdir}/configuration/</files>
    </addFilesToUninstaller>
  ... 
  </postInstallationActionList>

Also please note that the added directories must exists at the time the action is executed or it will be skipped. The <postInstallationActionList>for example is executed after the installation but before the creation of the uninstaller.

You can find more information on these subjects in the following sections of our manual:

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

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

link

answered 15 Feb, 10:48

Michiel's gravatar image

Michiel ♦
33614
accept rate: 16%

Thanks Michiel. As I mentioned in my original post, I tried the addFilesToUninstaller action The differences I could find between what I tried and what you posted were:

  1. I had it in the preInstallerActionList, which I now understand would not work.
  2. I did not have a closing "/" on my file path
  3. I used the "files" attribute of the addFilesToUninstaller element, rather than an embedded "files" element (as shown in documentation section 12.4)

I changed all these things to match your example, and there is still no impact - the directory is not removed by the uninstaller.

Any ideas?

(15 Feb, 11:58) andylowry

To be 100% clear: this directory is created by the installer, and it is populated with an initial set of files. Launching the application immediately causes some files to be added, based on the user's environment. Additional actions performed in the application may further change the directory content.

If I decline to launch the application after installation, then uninstallation completely removes everything. Otherwise, all files and directories that were initially installed are removed - except directories to which files were added. But newly added files and directoriesremain.

(15 Feb, 11:59) andylowry

Would it be possible for you send your project xml to support@bitrock.com? Also could you run the installer with the debugtrace option and send us the debug.txt:

For windows: C> installer.exe --debugtrace debug.txt

For OS X: /Path/to/installer.app/Contents/MacOs/installbuilder.sh --debugtrace debug.txt

For Linux: /Path/to/installer.run --debugtrace debug.txt

We will then check the resulting file for the cause of the issue.

(15 Feb, 12:22) Michiel ♦

Thanks Michiel. I've just sent both files.

(15 Feb, 16:28) andylowry
Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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

Tags:

×82

Asked: 13 Feb, 13:56

Seen: 47 times

Last updated: 15 Feb, 16:28