janderssen
Posts: 18
Joined: Tue Nov 20, 2007 7:19 am

optional uninstall file

Hi,

Just wondering how I can make a certain file that was installed, be optional on the uninstall process.

I would like to ask the user a question, and make a decision on whether to remove there database file, or not.

And also on the flip side, if the file already exists (ie upgrading) we dont want to overwrite the database file on the target machine.

And lastly, what if on install I wish to make overwriting an existing file optional as well? is this possible.

Cheers
Jason
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
Just wondering how I can make a certain file that was installed, be optional on the uninstall process.
During the uninstall process, all resources (files, registry entries etc.) that are registered in the MSI package will be removed.

Therefore, the solution is to make sure that the optional file is the only resource in it's component (you can do this in the "Organization" page) and mark this component with the "Do not register this component with Windows Installer" option.

During the Uninstall process you will set a property (for example by prompting the user) which will condition a custom action that will remove the file.

You can read more about custom actions here:
http://www.advancedinstaller.com/user-g ... -page.html
And also on the flip side, if the file already exists (ie upgrading) we dont want to overwrite the database file on the target machine.
For this you can use the "Never Overwrite" attribute for the component of the file in the "Organization" page. Note that this is done in the original MSI package. You can read more about this here:
http://www.advancedinstaller.com/user-g ... rties.html
And lastly, what if on install I wish to make overwriting an existing file optional as well? is this possible.
Yes, this can be done by using an independent feature for the optional file.
In the "Files and Folders" page you will set the "Ensure that this file overwrites any installed target file" option in the "Version" tab of the "Edit File" dialog.

Since the install level of a feature can be set according to your needs, the feature's installation (the one which contains only the optional file) can be conditioned.

There is a discussion on the forum about conditioning the installation of a feature, please take a look:
http://www.advancedinstaller.com/forums ... al+feature

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”