install4j: Unattended auto-update and relaunch at end - install4j

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

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

How to access the install4j custom application screens for a macOS app after 'first run'?

Install4j 9's DMG media file allows an installation wizard to be launched when the application shipped in the DMG is run for the first time, but there doesn't seem to be any way to access the custom install screens after that first run (for instance, to re-perform or undo some of the actions performed).
Is it possible to 'reset' the first run flag, or somehow pass an argument that will allow someone to access the custom install screens after the application has been run for the first time ?
You can start a custom installer application with the API. To get a code snippet to do that, select the custom installer application in the Installer->Screens & Actions step, activate the "Launcher integration tab" and click on "Start integration wizard". The code snippet will look like this:
ApplicationLauncher.launchApplicationInProcess("594", null, null,
ApplicationLauncher.WindowMode.FRAME, null);

Stop selenium test execution from eclipse

My scenarios starts to fail, and I have so many scenarios. I need to terminate test execution (I dont want to wait). How I can do that from ECLIPSE?
I am avare of the fact that there is a some button to stop test execution from eclipse. But i do not know how to add it, is it default or I can get it as extension from eclipse market place.
It should be the same as stopping any app in Eclipse. The stop button can be found above the console to the right (Picture below).
However keep in mind that this will then not close the browser driver and you will need to do that manually. Easiest way for me was using the command "taskkill -IM chromedriver.exe -f", chromedriver can only be killed when the force (-f) flag is used. Alternatively you could add some more functionallity to your app to allow you to break within the app that will stop the execution and close the driver.
Stop button

How can the auto updater wait for an event from the launcher executable?

I am using an updater application (without version check) in unattended mode, but I need the updater to wait for an event from the launcher executable before continuing to execute the installer.
The event will typically be a user confirmation that the downloaded installer can be executed. I would prefer that the launcher executable prompt the user to update, once it knows that the downloaded installer is ready.
Is there another way to solve the problem?
There is no such communication mechanism as of install4j 6.1.
I would recommend to change your updater application so that it does not execute the installer but just writes it to a particular directory. After it has finished you can check if an executable exists in the directory and ask if it should be executed. If the user confirms the update, you then invoke another custom installer application that only contains the "Run executable" action from the original updater template.

Install4j "Browse" Button hanging the installer

I'm using install4j 6.0.3, everything works exactly like it should, however if the user tries to change the installation location by using the "Browse" button, the installer locks up completely, and you need to use task manager to kill the process.
This happens on Windows 7 & Windows 8(.1)
Does anyone have any idea of how to fix this issue?
Ok, this is extremely weird, as I was debugging according to Ingo, I checked the option "Allow new folder creation" on, made a build, then checked it off again and made another build.
That build now works for the affected users, I guess there was a latent weird option in the config file or something.

How to avoid application start after cancel auto update on startup?

Today I need help to deactivate the auto startup of the main application after I abort the update process. The update is triggert automatically during startup so I used the "silent version check" template. But I can't find any option to deactivate the automatic startup.
It is necessary to update the version if there is any newer then the installed one before starting the main application.
I am using version 5.1.5.
Thanks in advance
Hardie
If your requirements are more complex, you cannot use the automatic launcher integration. On the launcher integration tab of the updater, click on "Start integration wizard". The wizard will give you a code snippet that you can invoke in the main method of your application in order to start the updater.
Surround that code snippet with
if (UpdateChecker.getUpdateDescriptor(UPDATE_URL,
ApplicationDisplayMode.GUI).getPossibleUpdateEntry() != null) {
// code snippet from the integration wizard to launch the updater
}
so that the updater is only invoked if an update is available. Then, if you do not receive a call to prepareShutdown, you can display a warning and close the application.