Updates/Upgrades: Leaving some files/folders untouched - 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!

canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Updates/Upgrades: Leaving some files/folders untouched

Hello everyone,

I am evaluating AI for our software and have a few questions which I haven't found the answer to in the manual or in the forum.

Our software contains a database, the database files reside in a folder inside the installation folder. These database files/folders must not be touched by an update/upgrade.

In order to leave those files alone this has been suggested on the forum, I think:

Create a "component", make the folder/files be part of this component, in the component attributes set "Permanent" and "Never overwrite".

But wouldn't using this approach lead to the files/folders of this component to be left over after a full deinstallation of the software? Can a custom action - triggered upon deinstallation - find out wether this is a deinstallation for update/upgrade purposes or not? If so the final removal of these files could be performed then.

Is this how this problem should be solved? Are there any other solutions?

Thanks in advance for any insight. :-)



With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Updates/Upgrades: Leaving some files/folders untouched

Hi Clemens,

Thank you for your interest in Advanced Installer.
But wouldn't using this approach lead to the files/folders of this component to be left over after a full deinstallation of the software?
Normally the uninstall will not remove the "Permanent" components. However, you can use a custom action to remove the remaining files after the uninstall is performed. Please note that the user guide contains the Remove a file or a folder during installation how-to which explains how to delete a file or a folder.

Since you need to remove the database conditionally (only during a complete uninstall), the recommended approach is to use a custom action which removes the entire database folder (this is explained in the how-to). This custom action can be scheduled under "InstallExecuteSequence" -> "Uninstall" and it can use the condition:

Code: Select all

(REMOVE="ALL" AND (NOT UPGRADINGPRODUCTCODE))
If you have other questions, don't hesitate to ask.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Updates/Upgrades: Leaving some files/folders untouched

...
cosmin wrote:Since you need to remove the database conditionally (only during a complete uninstall), the recommended approach is to use a custom action which removes the entire database folder (this is explained in the how-to). This custom action can be scheduled under "InstallExecuteSequence" -> "Uninstall" and it can use the condition:

Code: Select all

(REMOVE="ALL" AND (NOT UPGRADINGPRODUCTCODE))
If you have other questions, don't hesitate to ask.
Hello Cosmin,

thanks for your swift reply.

Will I also have to perform the same custom action upon rollback if it is not an upgrade install? Or is the rollback in case of the first installation smart enough to realize it should remove these fresh, untouched files in this case?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Updates/Upgrades: Leaving some files/folders untouched

Hi,
Will I also have to perform the same custom action upon rollback if it is not an upgrade install?
Since the component is registered with Windows Installer, it will be removed during a rollback. Therefore, you don't need a rollback custom action for your database files. Please note that the "Permanent" attribute affects only the uninstallation of the package.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Updates/Upgrades: Leaving some files/folders untouched

Hello Cosmin,

thanks for your answer, it makes sense that way.


Ciao

clemens

Return to “Common Problems”