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

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.

Related

Delete updater media file after update

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.

Visual Studio Code (VSCode) - how to update the standalone (.zip) version?

There is no "check for updates" when using the standalone/no install version.
What is best way to update a standalone version without losing settings etc.?
According to my experience (VSCode in a standalone .zip file uncompressed in D:\ using Win7 OS) you just need to download and uncompress the archive containing the new version (v 1.41.1).
When you run Code.exe in the new folder, your settings file is used and everithing is OK. (then, when you are really really sure that it is everithing OK, you could delete the old version).
If you changed the default settings file location, take a look at https://code.visualstudio.com/docs/getstarted/settings#_settings-file-locations
From the official doc it says when downloaded through zip file, one has download the release manually for each update and place the unzip version inside the Program files (Windows).
According to the special portable page all the settings, plugins, etc. of the standalone version
are stored in the data-folder. So assuming you called your vscode-folder vscode:
download the new version
unpack to vscode2 folder adjacent to current vscode
move data folder from vscode to vscode2
delete old vscode-folder
rename vscode2 to vscode
done
P.S.: Current portable versions notify about new version, but clicking on it leads to download, so above list still applies.
Edit 2020/08/04: To make a "normal" install portable one just needs to create the data folder inside the installation/unpack directory of VSC.
To download the old archive, replace user|system with archive in the URL.
Before:
https://update.code.visualstudio.com/1.69.2/win32-x64-user/stable
After:
https://update.code.visualstudio.com/1.69.2/win32-x64-archive/stable

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.

Sugarcrm: remove file on uprades via manifest.php

How can I remove file on loading upgrade of some sugarcrm module?
I can write 'copy' in upgrade section of manifest.php to copy new file. But how can I remove old (useless) file upon install of a newer version of the same module?
You can use the scripts/post_install.php script and insert the logic there to remove the file.
Any file that is installed via a 'copy' command should be automatically removed/replaced upon uninstall. There are no further commands needed to make it work. Backups of any files/directories that are replaced (if there are any) are kept in the upload directory.