Uninstall assemblies for .NET 2.0
Uninstall assemblies for .NET 2.0
I'm installing some assemblies into the GAC and using the Install Assembly function. When uninstalling the product the assemblies in the GAC is not deleted.
-
MichaelNesmith
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
>They will be deleted as long as nothing else is using them
I am not sure this is true. I created an installer that adds a single dll to the GAC. I then tested it on a clean virtual machine, fresh XP install with only the .NET runtime installed, and the uninstaller did not remove the dll. I am not sure if this is a bug with MSI or InstallAware.
Marcus
I am not sure this is true. I created an installer that adds a single dll to the GAC. I then tested it on a clean virtual machine, fresh XP install with only the .NET runtime installed, and the uninstaller did not remove the dll. I am not sure if this is a bug with MSI or InstallAware.
Marcus
Actually the assembly is never removed, if you don't remove it by yourself..If you are sure that nothing else depends on it, you can use the .NET tools to remove it by command.
Panagiotis Kefalidis
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
Install[b]Aware[/b] Software Corporation
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
Install[b]Aware[/b] Software Corporation
Uninstalling assemblies placed in the GAC
Since the install placed the assemblies in the GAC, it should also uninstall the assemblies from the GAC. I can't expect a common user to use a .NET removal tool and uninstall the correct assemblies. How do I automate the install to uninstall these assemeblies?
Re: Uninstalling assemblies placed in the GAC
It is a .Net ISSUE, that something placed in the GAC it cannot be removed unless done by the removal tool of the framework.. You have to manualy call the tool for every assembly you want to remove.It's called InstallUtil.exe and it is located in the framework directory eg C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727. You call it like InstallUtil.exe /u assembly_name and it removes the assembly from the GAC if there is no dependency.cpursley wrote:Since the install placed the assemblies in the GAC, it should also uninstall the assemblies from the GAC. I can't expect a common user to use a .NET removal tool and uninstall the correct assemblies. How do I automate the install to uninstall these assemeblies?
Panagiotis Kefalidis
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
Install[b]Aware[/b] Software Corporation
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
Install[b]Aware[/b] Software Corporation
Why doesn't InstallAware automate this process?
Why doesn't InstallAware automate the process of assembly removal?
Re: Why doesn't InstallAware automate this process?
Because it is against the .Net GAC philoshopy?cpursley wrote:Why doesn't InstallAware automate the process of assembly removal?
If you force the uninstall of an assembly that already has a dependency on the same .dll (let's say you have the same version of a component by a 3rd party vendor) with another application, after uninstallation of your application and removal of the .dll, it will turn the other unusable.
Besides, Microsoft is very clear on that "Put in GAC whatever is going to "stay" on the target machine. Put in the same directory with your application, custom .dll's and stuff that are going to be removed on uninstallation".
Panagiotis Kefalidis
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
Install[b]Aware[/b] Software Corporation
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
Install[b]Aware[/b] Software Corporation
Wise handles the removal of assemblies from the GAC without problem. That is, an assembly is removed as soon as all applications that use it are uninstalled. I just tried several combinations of installing/uninstalling different applications that use one or more of a common set of assemblies, monitored which assemblies are left in the GAC after removing each application, and confirmed that each assembly was properly removed when no application was referencing it any more.
I am spoiled on this since I just switched from Wise. How can I do the same with InstallAware?
Thanks,
Alexander
I am spoiled on this since I just switched from Wise. How can I do the same with InstallAware?
Thanks,
Alexander
-
MichaelNesmith
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
You can write MSIcode or a DLL or a plug-in which will forcibly uninstall assemblies from the GAC. This is not recommended. I think we had built a DLL like that for a client before, I can try to dig it up for you if you like.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
-
MichaelNesmith
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Michael,
From "Removal of Assemblies from the Global Assembly Cache" http://msdn2.microsoft.com/en-us/library/aa371192.aspx:
The installer unpins the assembly when the last Windows Installer client is removed. If the Windows Installer is the last client of the assembly, the common language runtime provides the option to force a synchronous cleanup of the assembly.
This is exactly what I am looking for. From personal experience I know that Wise does it nicely. From reading the InstallShield reference I understand that it does it too; actually it even has a Permanent property that permits us to specify whether the assembly is to be removed or not once it's not referenced any more (http://support.installshield.com/kb/vie ... id=Q111094).
Your post from about a year ago indicates that IA does it too, but I can't find how to do it. Our IA-installed assemblies are never removed from the GAC. Can you please help me?
Alexander
From "Removal of Assemblies from the Global Assembly Cache" http://msdn2.microsoft.com/en-us/library/aa371192.aspx:
The installer unpins the assembly when the last Windows Installer client is removed. If the Windows Installer is the last client of the assembly, the common language runtime provides the option to force a synchronous cleanup of the assembly.
This is exactly what I am looking for. From personal experience I know that Wise does it nicely. From reading the InstallShield reference I understand that it does it too; actually it even has a Permanent property that permits us to specify whether the assembly is to be removed or not once it's not referenced any more (http://support.installshield.com/kb/vie ... id=Q111094).
Your post from about a year ago indicates that IA does it too, but I can't find how to do it. Our IA-installed assemblies are never removed from the GAC. Can you please help me?
Alexander

