install4j: Unattended auto-update and relaunch at end

Viewed 598

So I'm trying to build an auto-updater for my app. I've chosen the "Update downloader with silent version check". It's integrated with my launcher as well, like it can be seen in the first picture. I'd like if possible to remove the screen where the user is asked whether to launch the updater and just always execute it.

launcher integration

Screen to remove

My client would also like to have the auto-update process as unattended as possible. So it would need the following steps:

1) user starts launcher

2) auto-updater checks and finds new version

3) auto-updater downloads new version

4) auto-updater launches downloaded updater

5) auto-updater finishes and relaunches new version of the app

I've managed the first 4 steps but I can't manage to make it relaunch the app, or at least have an informative message saying that the user needs to relaunch it him/herself. I've added the Execute launcher action but it seems to either not launch or launch the previous version. Is there a tutorial or anything for this at it seems like my case is pretty standard? :(

Any help would be appreciated, as I've been struggling with this for a while.

Thanks

1 Answers

The background update functionality in install4j (since 7.0) is more suitable for your use case.

See

https://www.ej-technologies.com/products/install4j/whatsnew7.html

and search for "Background auto-update" to see screen shots.

To get started, add a "Background update downloader" application on the Installer->Screen & Actions step.

In the launcher wizard of a GUI launcher that should process scheduled update installers, go to the new "Auto-update integration" step and select the "Execute downloaded update installers at startup" check box. By default, the execution mode is set to "Unattended mode with progress dialog".

For services and command line launchers, the UpdateChecker API allows you to execute scheduled update installers programatically.

You can also execute the downloaded installer as soon as it's downloaded. The source file

samples/hello/gui/HelloGui.java

shows you how to interact with the background updater by using the API.

Related