Uninstalling VS Setup project prerequisites
We currently use a VS 2010 (upgraded from 2008) setup project to install our application, and utilize the SQL Server 2008 install prerequisite.
Well wouldn't you know, management has got it in their head that everything (including prerequisites, but not .net) that's installed by the application must now be uninstalled by the uninstaller.
So I'm trying to modify the installer to uninstall SQL Server Express 2008.
I first thought that I could modify the package.xml dependency for sql server to trigger the right install conditions so I could pass in the uninstall arguments, but I'm at a loss as to what those conditions would be.
Then I thought about using a custom install action and System.Diagnostics.Process to programmatically invoke the sql express installer with uninstall command flags, but I'm not sure if I can guarantee that the installer will make that executable accessible for uninstallation.
Um, uninstalling sql server express is bad. What if another application was later added that relies on this? Your uninstaller would break that application.
Management is right, though: you should uninstall everything you installed in the first place.
So what is the solution then? As they say, "damned if you do, damned if you don't".
Fortunately, if this is for a desktop application the answer is simple: don't use Sql Server Express Edition. Express Edition is really a server class engine. Sql Server Compact Edition is much more suited to this scenario, and will solve your deployment issues.
If this is for a server application, it's a little trickier. Any well-behaving installer will create it's own instance of Sql Server Express. You then need to make sure you uninstall only your instance (and also make sure your install is well-behaving). This doesn't really solve the problem, but at least it lets you say it's their bug and not your if something breaks after your uninstaller runs. Unfortunately, you still have to build this part manually.