InstallAware Multi Platfrom /Linux - how to preserve files from being overwritten

Got a problem you cannot solve? Try here.
Lem2983
Posts: 13
Joined: Mon Feb 05, 2024 3:58 pm

InstallAware Multi Platfrom /Linux - how to preserve files from being overwritten

Postby Lem2983 » Mon Feb 05, 2024 4:39 pm

Hello,
This is my first post on the forum regarding InstallAware Multi Platfrom (IAMP), I dont have prior experience with InstallAware for Windows, IAMP is used to build a Linux installer.

At the moment I am trying to figure out how to preserve modified (created by the installer or by the user) files, such as licenses/certain config files, between updates. That is a different question why those files are end up in the same directory where binaries are installed, this is just one of several possible scenarios provided by our installer to solve a very particular problem.

As I understand since each build of the installer has its own unique Revision Code/UUID/GUID then in order to prevent leaving orphan files it recommended before update (i.e. installing a new build (even if the files in the installer did not change)) to uninstall the previous copy of the installer, at least the IAMP Wizard generates the script doing that.

The most intuitive approach would be to call "Create Folder"/"Copy Local Files" to simply copy the files needed to be preserved to a temp directory, remove old files ("Apply Uninstall") install new files and copy the aforementioned files back.
But as far as I understand in this case we use native engine, therefore after "Apply Uninstall", files copied to a temp directory are deleted too. In case of Windows I could set native engine to false and it seems the copied files would be preserved, but this Linux installer.

To sum up all stated above: what is the recommended way to prevent certain files from being overwritten by the installer but at the same time make sure that they will be removed by the uninstaller?

Thanks!

JohnGaver
Posts: 129
Joined: Mon Feb 05, 2024 6:15 pm

Re: InstallAware Multi Platfrom /Linux - how to preserve files from being overwritten

Postby JohnGaver » Mon Feb 05, 2024 6:34 pm

Lem2983 wrote:Hello,
This is my first post on the forum regarding InstallAware Multi Platfrom (IAMP), I dont have prior experience with InstallAware for Windows, IAMP is used to build a Linux installer.


Welcome!

Lem2983 wrote:At the moment I am trying to figure out how to preserve modified (created by the installer or by the user) files, such as licenses/certain config files, between updates.


Here's the list of pre-defined setup variables:

https://www.installaware.com/mh52/desktop/predefinedvariables.htm

Please see, in particular, NATIVE_OVERWRITE and NATIVE_OVERWRITE_OLDER. If anything doesn't work as documented, be sure to let us know!

Lem2983 wrote:That is a different question why those files are end up in the same directory where binaries are installed, this is just one of several possible scenarios provided by our installer to solve a very particular problem.


You choose where your files go in your Install Files commands. If you're not happy with particular destinations, change them.

Lem2983 wrote:As I understand since each build of the installer has its own unique Revision Code/UUID/GUID then in order to prevent leaving orphan files it recommended before update (i.e. installing a new build (even if the files in the installer did not change)) to uninstall the previous copy of the installer, at least the IAMP Wizard generates the script doing that.


That is correct. You may mark files permanent so they never get removed (an Install Files command parameter), or author patches of sorts by not uninstalling your old versions (not calling Apply Uninstall (really the Apply Changes command) in certain scenarios, or backup/restore those files during in-place upgrades - or anything in between, really. Nothing is hardcoded so you have the power to decide.

Lem2983 wrote:The most intuitive approach would be to call "Create Folder"/"Copy Local Files" to simply copy the files needed to be preserved to a temp directory, remove old files ("Apply Uninstall") install new files and copy the aforementioned files back.


Ah there you go, indeed that's one approach!

Lem2983 wrote:But as far as I understand in this case we use native engine, therefore after "Apply Uninstall", files copied to a temp directory are deleted too. In case of Windows I could set native engine to false and it seems the copied files would be preserved, but this Linux installer.


Great question! You could try setting NATIVE_LOGGING to FALSE before moving stuff around.

Again, the list of pre-defined variables (and let's not forget pre-defined compiler variables here: https://www.installaware.com/mh52/deskt ... iables.htm) are worth their weight in gold!

Lem2983 wrote:To sum up all stated above: what is the recommended way to prevent certain files from being overwritten by the installer but at the same time make sure that they will be removed by the uninstaller?


For all I know, your needs may even be addressed by simple file versioning, and the first variables I mentioned above. But worst case, you've already figured out a viable approach; and could easily implement it by simply disabling Native Engine logging.

Lem2983 wrote:Thanks!


You're welcome :D

Thanks for the opportunity to contribute my inaugural post to this forum :)
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm


Return to “Technical Support”

Who is online

Users browsing this forum: Google [Bot] and 34 guests