View Full Version : MSDE Windows Installer

01-07-2005, 04:14 PM
Hi All,

As per the advice of InstallShield Support, I have opted to install MSDE as a prerequisite with my .NET application.

Quick overview
MSDE (as prereq)
My App

Things are going well, however as I have seen posted in this form by others already... I'm having trouble with the uninstall.

First I want to say that my application uninstalls just fine.
What's troubling me is the lingering instance of MSDE 2000 that's left behind.
When I try a reinstall...as you all know it bombs because the MSDE is already there.

I'm looking for a way (installscript or not) to force the removal of my MSDE instance when my app uninstalls. Preferably with examples as I’m a developer and not a deployment engineer :)

I have made a SQL Script that runs only on uninstall which is a simple DROP Database statement, that does delete the mdf & ldf.

Thanks a million whoever can help.


DeployIT SA
01-10-2005, 12:58 AM

You can uninstall the SQL Server instance but the better option will be change the condistion on the prerequisite to check for the insctance and not to execute if exist.

Christopher Painter
01-10-2005, 01:03 AM
Setup preqs launch installs seperatly so your MSI won't know that it's setup.exe installed MSDE. So when you uninstall your app it wont automatically uninstall MSDE.

However when you define your .PRQ file you should give it a condition that tells it whether MSDE is installed or not. That way when you run your app again it will skip over the MSDE install.

If you want your install to automatically uninstall MSDE ( not reccomended since it might have already been installed and there might be other databases using it ) then you will have to make a custom action in the UI sequence that calls msiexec to uninstall it. You can't put it in the execute sequence because there is a mutex that only allows 1 execute sequence at a time.

01-17-2005, 05:59 AM
I think the main problem ist that MSDE never ever deletes the *.mdf of the installed database, even if you deinstall MSDE with its own installation program or from system panel software.
The system thinks that MSDE is not installed anymore although files are left on the system. So a prerequisite won't solve the problem at all, it will install MSDE because it has been deinstalled befor, but will fail because the *.mdf is still on the disk....
I expierence the same problem with my project. I suppose their just one way....deleting the mdf file per hand....

Christopher Painter
01-17-2005, 10:08 AM
You could chain/sequence multiple prerequisite like:

1) If MSDE not installed and MDF present then run Preq CleanUpOldMSDE
2) If MSDE not installed then run Preq Install MSDE

Or you could just create your own MSDE Preq that has a bootstrap type frontend that does clean up before install.

01-19-2005, 03:11 AM
That would be a possibility, but i am not really into the whole prerequisite stuff. I spend quite a lot of time getting the MSDE Merge Module to work properly.
I solved the whole problem the following way:
At the beginning of installation I check if the instance of MSDE I need is installed via registry (RegDBKeyExist ("SOFTWARE\\Microsoft\\Microsoft SQL Server\\IFX_TM\\Setup")) and store it into a global property. If this key exists I can get the working path of MSDE Instance also via registry. This path is used when i deinstall the MSDE. After the Merge Modul Custom Action Uninstall Msde is finished I deleted the whole working directory of that instance to prevent problems when i reinstall our product.
This works quiet fine, but requires a little bit of Installscript Code.