6

Our install4j-based app has a 3rd party library jar called (eg) foobar-1.0.jar

In an updated version, we have replaced the jar with foobar-1.1.jar

The install4j updater adds the new jar, but doesn't remove the old one. So now both are on the classpath. This is making our app crash.

How can I tell the updater to remove a file that no longer should be there?

Steve McLeod
  • 51,737
  • 47
  • 128
  • 184

3 Answers3

4

You can add an "Uninstall previous installation" action to your "Installation" screen.

If there are some files that you do not want to delete during such an update, go to the "Files" step, edit an entry, switch to the "Installation options" step of the wizard and set the "Uninstall policy" to one of the "... but not for update" options.

Ingo Kegel
  • 46,523
  • 10
  • 71
  • 102
  • Strange thing is, this also removes the desktop shortcut as part of the uninstall and doesn't re-add it in the installation. – Steve McLeod Oct 02 '14 at 12:23
  • The desktop shortcut is added by the "Add a desktop link" action. Please check the .install4j/installation.log file to see if that action failed for some reason. A possible failure mode is that the action is before the "Install files" action. In that case the shortcut is only created for the first update installation (when the "Uninstall previous" is not present) – Ingo Kegel Oct 02 '14 at 14:57
1

Install4j Installer Screens and Actions

Here is a screenshot of where and how to add the uninstaller.

bhlowe
  • 418
  • 4
  • 8
0

We have a similar problem to Steve McLeod (comment Oct 2 2014). In our case the desktop icon is replaced, however a link to the deinstaller in the program group is not there after an update.

t_paine
  • 11
  • 2