Do not remove one specific file if found in installation folder - Advanced Installer Community
Fulgan
Posts: 101
Joined: Mon Feb 27, 2012 10:42 am

Do not remove one specific file if found in installation folder

Hello,

For historical reason, there might be one file present in the target folder for my application installation. That file has been moved to a different folder in new installs but, for older ones (created with a different install engine), it will have been present during the first "install" (which was actually an update) of the application.

I need to make sure that file will NOT be uninstalled by the cleanup routine (not even in case of a full uninstall).

How can I achieve that?

Thank you
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Do not remove one specific file if found in installation folder

Hello,

To achieve what you need you could go to "Files and Folders" page and enable the "Do not overwrite existing file" option for the related file corresponding to the original file path.

Let us know if this helped, otherwise please give us some more details about the scenarios not being covered by your setup package.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Fulgan
Posts: 101
Joined: Mon Feb 27, 2012 10:42 am

Re: Do not remove one specific file if found in installation folder

Hello,

Thank you for the reply.

Won't that have the unexpected effect during install of not.. err.. overwriting existing files ?

That is not what I'm trying to do: The file in question is a single file (not all of them) and might or might not be present when the application is installed (it might even be moved there later by the user).

All I need to do is make sure that the uninstall procedure will not delete it if present. I don't need to deploy or update it.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Do not remove one specific file if found in installation folder

Hello,

I apologize for my delayed reply.

Also, I think my previous answer was not so clear because I didn't give you detailed instructions. Here is what you should try:

1. go to "Files and Folders" page and add a version of the file you want to preserve (it must have the same file name and resolve at install time to the same file path as the targeted file you want to preserve)
2. right click on the added file and go to "Properties"
3. go to the "Operations" tab and enable the "Do not overwrite existing file" option with the "Condition" field set to 1; this means that the file on disk will be always preserved when present
4. build your setup project and test it

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”