Tuesday, September 18, 2012 8:36 PMI have developed an application with Visual Basic.NET using Visual Studio.NET 2003. I am able to deploy my application using the setup and deployments feature that is included. However, when I unistall my application, all of the references it uses - for example AXMSCommLib (which is a DLL are missing). So far I have worked around this by doing a system restore to recover those references. Does anyone know what I should be doing differently to avoid this? I have searched extensively for answers and haven't found a solution yet.
Friday, September 21, 2012 8:22 AMModerator
I am sorry, but I do not fully remember the old Visual Studio.Net 2003. But I understood that you build an MSI and installed the MSI. When uninstalling it, shared components are gone.
I do not have a solution for you regarding the Setup project because I no longer remember the possibilities. (Maybe you want to upgrade to a recent version? And maybe you want to check out WiX to build MSI packages?)
In general you should always make sure that you handle shared components correctly.
One solution MSI offer are shared counters. A counter is increased on installation and decreased on deinstallation. Only if the counter shows that no application is using the component, it will be removed. Unfortunately, not everyone is using this mechanism so it will fail from time to time.
So instead our solution is to not uninstall shared components at all. If our setup misses a component, the component is installed. But we do not uninstall it. If the user no longer wants the component, the user has to uninstall that component on his own.
If you created a VB.Net application, you could decide to not install shared components globaly. Instead you could keep stuff local to your application. That way you can safely remove it again. But depending on the dependency it might be tricky to use the local ressource. So it might not be a good idea in all cases. And also be aware that you might miss hotfixes in such a case.
Also quite nice: There are some Application Virtualisation solutions that can encapsulate everything you need. The results can be quite amazing and they are more or less like the possibility before.
My suggestion would always be:
- If there is a full installer for that component: Just install that independend of your product (so it will not be uninstalled)
- Try to keep stuff local to your application if you intend to uninstall it with your application
- Do not remove global stuff because you could break other applications.
To build such MSI files and have full control I would suggest to use a tool that gives you full control. WiX (Windows installer XML) is such a solution.
With kind regards,