Delete updater media file after update - install4j

We plan to use the "Update downloader with silent version check". In this aspect we would like to delete the downloaded mediafile which contains the update after the update has been successful.
The "Download File" action has a checkbox for "Delete downloaded file on exit". However, we assume that this is deleted when the User interrupts the updation. After a successful install, the .exe file is not deleted.
Is there any built in provision with install4j that supports this (or) writing an own Delete files action would be the way to go forward?

You cannot delete the installer in the update downloader, because the update downloader will start the new installer and then exit. At the time when the update downloader exits, the installer is running and its executable cannot be deleted.
In the installer itself, you cannot delete the installer executable either. At the earliest, you can delete the installer executable in your own launcher when it is started the first time. You would have to program this kind of cleanup yourself.

Related

Is there any option to delete the downloaded installer after auto update completion?

Is there any option to delete the downloaded files after auto update functionality completion ?
As of 6.1.4, that is not an option in install4j. You would have to save them to a special directory and delete that at application startup.

Can we install launcher selectively based on check at installation time

I have multiple launcher in an application and I want to install it selectively based on a flag provided at installation time, like in GUI mode install one and in unattended mode install another. Can we achieve in Install4j?
You can put the launchers into different file sets and select the file sets programmatically at runtime.
You create file sets on the "Files->Define Distribution Tree" step.
In the launcher wizard, on the "Executable info" step you can select the file set for the launcher.
At runtime, call
context.getFileSetById("123").setSelected(false)
to prevent the installation of the file set with ID "123".

install4j uninstall previous installation

I am creating an update for an application built in install4j and I want to overwrite the files in the installation directory but keeping the configutation files. I manually edited some of them to never be overwriten but I cannot keep the files created by user input when installing it for the first time.
Is it possible to set a condition in the "Uninstall previous installation" so that it keeps the user's input? The user's input does not exist in the distribution tree. This means that I cannot manually edit it so that it is never uninstalled.
Why would you want to move the file? The response file you either load if it is an update or leave install4j to delete it.
The file is usually loaded on updates to use some variable the user set in the initial install, like a username, so you won't have to ask him again.

Install4j: can installation executable be removed after install?

My Install4j configuration has no problem updating my executable and replacing the old instance.
However, my windows user profile is building up with each instance of the downloaded executable file:
install_1.0.0.exe
install_1.0.1.exe
install_1.0.2.exe
If I update to version 1.0.3, then I will see install_exe_1.0.3.exe stored here as well.
Is it possible for Install4j to delete this file upon update completion?
FWIW, this also occurs with Install4j updates. I have the following files in my user profile:
install4j_windows_5_1_10_with_jre.exe
install4j_windows_5_1_11_with_jre.exe
install4j_windows_5_1_12_with_jre.exe
install4j_windows_5_1_13_with_jre.exe
As of install4j 5.x, there is no clean-up mechanism for downloaded update installers, but you could build one yourself.
The place to add logic for deleting old installers would be in the updater. Each time a new installer is downloaded, you would have to save the download path to a persistent storage, such as the Java preferences store. When the updater is started, you could then load those saved paths and delete them.

Unattended update: how to pass throught user settings to new installer?

I have to implement the following scenario:
Application is installed with user specific values like installation directory, server url, user home and more
User should start a stand-alone updater
updater should automatically check for update, download file and start the new installer in silent mode
After installation there should be a status message whether update was successful or not
Therefore I took the updater of the Hello sample app and removed the user input forms. Now the check is succesful and the file will be downloaded. But how to pass through the user input values to the new installer? Should I use the response file and set this one as an argument for the silent installation?
Thanks in adnvance
Hardie
The new installer will read the existing response file from old installation if you add a "Load a response file" action to the "Installation location" screen. The default project template already has this action in place.