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

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.

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);

install4j: Unattended auto-update and relaunch at end

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.

pureapp: changes in software components and rerun it

I have a pureapp frame with one software component (system plugin)
in it. Every time i make changes in install.py, i have to "build
with binary" and "update to test environment" and deploy the frame
which ultimately create new instance and install other default
plugins and the one i created (takes more than 15-20 minutes).
Is there any way to make changes to my plugin only and re-run the frame
without redeploying the instance and other default plugins?
found the way....
my question was about IBM pure application (not added on the site yet)..
anyway trick is to add debug component and enable 'Resumable on script error' in the frame.
when execution fails, removing dump.json will resume the operation

ApplicationLauncher.Callback notification on finishing Install4j installation

I am using autoupdate feature of install4J by using ApplicationLauncher.launchApplicationInProcess() API from my Java code.
This API has a parameter ApplicationLauncher.Callback. I thought this call-back method will be called when complete Installation process will finish.
But I observed that, this call back is not getting called when actual installation process (name of this process is same as setup file name) is completed.
Is there any callback mechanism to detect the status of installation?
There are two separate processes here:
The updater, which is what you call with ApplicationLauncher.launchApplicationInProcess()
The new installer, which is started downloaded and started by the updater.
The callback is called before the updater executes the installer, then the updater terminates itself. This sequence of events is required to avoid problems with locked or deleted files.
If you need to do something at the end of the installation, you have to place that logic in the installer.

How to prevent "auto update with silent check" to start launcher on error?

We want to create an update application using the template for "Update with silent version check" to check the version before the launcher will be executed. So far everythings seems to work fine but when I get an error the update application will abort the process and rollback everything. After that the launcher will be executed. We need to abort the launcher execution if an error occured during the version check. Is it possible to configure this? The same goes for the scenario the user want to abort the update and click "exit" at the info dialog. The execution of the launcher should also be aborted. We tried it with version 5.1.15 and 6.0 with the same result that the launcher always is executed independend if an error occured or the user aborted the update.
Thanks in advance
If you want more control over the behavior of the launcher after the updater has failed, don't use the automatic launcher integration. On the "Launcher integrations" tab there is an integration wizard that will give you a code snippet that you can insert into your main method.
ApplicationLauncher.launchApplication takes a Callback whose exited method is called with the exit value of the updater.