Fulgan
Posts: 101
Joined: Mon Feb 27, 2012 10:42 am

Copy a file is it does't exists, don't uninstall it

Fri Sep 22, 2017 10:58 am

Hello,

I need to make sure a file is not deleted by the uninstall operation. This file contains the "base license" of our product and, when the user activates it, it is replaced with a file containing their license.

Unfortunately, that file must be distributed with the software but it must NOT be deleted one installed.

I have not found a way to do that through the file properties or the cleanup dialog so I have attempted to:
Install the file with a different name
Add a "File Copy/move" operation instructing the installer to copy the newly installed file with the final name and placed a condition "(Not Installed)"

What I don't know:
- How to tell the installer not to overwrite the file if it exists.
- Make sure the original template is copied before the file operation runs.

If there is a better way to do that, I'm open to suggestions. The only thing I can't do (right now) is change how the application handles that license file (I can't copy it if it's not present when the application starts or read it from a different location).

I'm using AI version 14.2.1 (Professional)

Thank you

Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Copy a file is it does't exists, don't uninstall it

Fri Sep 22, 2017 12:23 pm

Hello,

To achieve this please go to "Files and Folders" page, double click on the file, go to "Operations" tab and select "Do not overwrite existing file" option.

In this way the file will not be removed on uninstall and also it will not be overwritten if exists on the machine.

Please let me know if you have any other questions and I will gladly assist.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Fulgan
Posts: 101
Joined: Mon Feb 27, 2012 10:42 am

Re: Copy a file is it does't exists, don't uninstall it

Fri Sep 22, 2017 2:12 pm

Thanks. Looks like it's working.


I was acting on a bug report and simply assumed "never overwrite" didn't impact the uninstall behavior.

Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Copy a file is it does't exists, don't uninstall it

Fri Sep 22, 2017 2:15 pm

Hello,

You are welcome! Just let me know if you have any other questions.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”