Filtering files to be uninstalled - Advanced Installer Community
maro
Posts: 12
Joined: Wed Mar 31, 2010 8:36 am

Filtering files to be uninstalled

Hi,

Is there a way for me to filter files to be uninstalled using advanced installer? Right now when i uninstall my program, it uninstalls everything.

What if i have 4 files installed using my program_installer.msi (made out of advanced installer), and when i uninstall i only want the first 3 to be uninstalled... let's say i want to keep 4thfile.dll.

Is there any way to do this?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Filtering files to be uninstalled

Hello,

You can try one of the following:
- You can mark a component as permanent from the Organization page. This means it will never be uninstalled with your product.
- You can use a Move file operation during uninstall to rename that file to something else, Windows Installer won't know about it and thus will leave it there.
- You can try using backup-restore method to backup the file(s) before RemoveFiles standard action, then restore them afterwards to their original location.

As you can see, there's not much support for this because leaving residual data on a computer is not encouraged.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
maro
Posts: 12
Joined: Wed Mar 31, 2010 8:36 am

Re: Filtering files to be uninstalled

Hi,

Okay, thanks!

I have question regarding the first method. If we make it "permanent" and in the future, like 3 or 4 versions up, we build a new version of that component can we still overwrite it?

Best Regards,

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

Re: Filtering files to be uninstalled

Hi Maro,

Yes, files marked as permanent can be overwritten by newer versions.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bchetana
Posts: 95
Joined: Sat Dec 01, 2012 11:36 am

Re: Filtering files to be uninstalled

HI

I have a dout... in future if we want to delete the dll (which is marked as permanent) how can we do it???? Is der any custom action available to do the same ???
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Filtering files to be uninstalled

Hi,

In order to achieve this you can go in the Files and Folders page and use the File Operation -> File Removal toolbar button to set your file for removal.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bchetana
Posts: 95
Joined: Sat Dec 01, 2012 11:36 am

Re: Filtering files to be uninstalled

I tryed the same but no luck

Pleas see my settings from the attachment.... This dll is marked as permanent and installed in GAC during the previous versions of the same installer.
Attachments
DllMarked_Permanent.gif
DllMarked_Permanent.gif (37.71 KiB) Viewed 7801 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Filtering files to be uninstalled

Hi,

Please keep in mind that if a DLL is installed to GAC it will be moved from APPDIR to the assembly folder, so it will not exist in the application folder anymore.

Also, an assembly cannot be removed using a "File Removal" opertion, it should be uninstalled from GAC, but the installer will not uninstall it as long as the "Permanent" flag was set for it. A tool like "gacutil.exe" can uninstall it, but unfortunately the "gacutil.exe" tool is not redistributable.

You can try to create your own custom action that uninstalls the assembly from GAC when the new version of the product is installed.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bchetana
Posts: 95
Joined: Sat Dec 01, 2012 11:36 am

Re: Filtering files to be uninstalled

Thanks for clarification. .
Can u share the sample on the same... how to unregister the from gac
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Filtering files to be uninstalled

Hi,

You can see a C# example of how to add and remove assemblies from GAC without using "gacutil.exe" in the Programmatically adding and removing assemblies from the GAC article.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”