How to retain file when upgrading? - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

alco
Posts: 80
Joined: Thu Nov 18, 2010 5:02 pm

How to retain file when upgrading?

How do I retain a file in the installation folder from an old installer if the new installer doesn't have that file?

I have one dll that came from previous installer and when I run new installer (as an upgrade) I want that file retained and not deleted during uninstallation of previous installer, because that dll file is not in the new installer.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: How to retain file when upgrading?

Hi,

To achieve the functionality, please follow this article from our user guide .

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
alco
Posts: 80
Joined: Thu Nov 18, 2010 5:02 pm

Re: How to retain file when upgrading?

Thanks. I'm trying this out now, but I encountered another problem. I'll do another post, since it's unrelated to this one.

EDIT: No need to post a new one. I found a workaround here.
alco
Posts: 80
Joined: Thu Nov 18, 2010 5:02 pm

Re: How to retain file when upgrading?

I tried the article mentioned, w/ minor modification, but I didn't get the expected result.

In the article, it says the RestoreLocationList is optional (step4), so I removed it since I'm not going to specify a new restore location for the folders backed up.

I built the installer, run an old installer, added new files in the backup folder, then ran the new installer. When I browsed the installation folder, the backup folder did not have the files I added.

Did I miss anything in the article?

EDIT: I did miss something.. :) Backup folders each had quotes in BackupList. Removing them made it work. And yes, RestoreLocationList is optional indeed.
alco
Posts: 80
Joined: Thu Nov 18, 2010 5:02 pm

Re: How to retain file when upgrading?

Files are restored indeed, but, I just found out that newer files in the new installer gets overwritten by outdated files in the backup folder. How do skip files in the backup if newer files are found in the installation folder?

EDIT: Temporary workaround, move restore custom actions to CreateFolders. If there are newer files in backup folder, however, I think they'd be overwritten by the ones in new installer, correct?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: How to retain file when upgrading?

Hello,

You can try to add searches from the Search Page for the file versions already installed on the target machine in the old installation. Using the searches' names, you can condition appending the BackupList property with the files' paths you want preserved during the upgrade.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
alco
Posts: 80
Joined: Thu Nov 18, 2010 5:02 pm

Re: How to retain file when upgrading?

That is going to impose additional maintenance on the AIP project since I would need to make sure that new DLLs get added to the search page. It would be more simple if fso, used in restore script, can smartly overwrite files, as my backup list only contains 2 folders, one containing dlls, another containing .resources files.

But, isn't the MSI already smart enough to detect if it is trying to overwrite a newer file from the backup?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: How to retain file when upgrading?

Hi,
But, isn't the MSI already smart enough to detect if it is trying to overwrite a newer file from the backup?
Actually, the MSI simply calls custom actions that do the overwrite( e.g. the case of the "Install new version first and then uninstall old version" option ). However, if you need this with your current settings you can try implementing it in Advanced Installer as I suggested above. Another approach would be as you mentioned in your last post, to obtain the functionality by adding your own custom script to the restore script.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
alco
Posts: 80
Joined: Thu Nov 18, 2010 5:02 pm

Re: How to retain file when upgrading?

I thought the temporary workaround worked, but, it didn't. It seems the restore custom action placed in CreateFolders occurs after newer files are written to the install directory, causing newer files to be overwritten from backup.

Where can I place the restore custom action so that it is written to the install directory AFTER previous version is uninstalled and BEFORE newer files are written?

EDIT: Will just try to do a second backup to [tFolder] on Install sequence. Hopefully, it will overwrite backup folder w/ newer files so restore custom action will always have latest version.

EDIT2: It worked, somewhat... newer files on backup does not get retained...

Return to “Common Problems”