MSDE Removal or UNinstall Programmatically

Anyone know the standard or best way to remove an MSDE instance programmatically.

My setup app installs MSDErelA ok, and if sql is already on the box it adds an instance.

I really want to return the box to its original state whether it had sql (or other msdes) on there or not.
LVL 8
plqAsked:
Who is Participating?
 
ispalenyCommented:
Search in registry branch
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
GUID nodes for values
DisplayName like "Microsoft SQL Server Desktop Engine*"
SqlInstanceName = "YourInstanceName"

In such a node you can get UninstallString
MsiExec.exe /X{E09B48B5-E141-427A-AB0C-D3605127224A}
(guid changes)

Run the found command line from your uninstall program.
0
 
DanRollinsCommented:
It appears that running
   Setup /x path_to_dir_with_the_MSI_file

Where Setup.Exe is the exe that was unpacked into the unpacking directory.

You may need to add the parameter:
      InstanceName=your_instance_name

This google groups search indicates that a number of people have had problems with uninstalling MSDE.  There appears to be something related to Ms trying to avoid gaming the "throttling" issue by iunstalling multiple named instances.
 
    http://groups-beta.google.com/groups?q=MSDE+uninstall

-- Dan
0
 
plqAuthor Commented:
Thanks, yes I saw that in the reg but got frightened off by the guid. I'll have to loop through each reg key until I find a sqlinstancename that matches

Just thought ms would have provided an easier way !
0
 
plqAuthor Commented:
ps that was in response to ispaleny... will research some of dans thread in the morning. thanks
0
 
plqAuthor Commented:
msiexec seems adequate, although it does prompt for "Are you sure" which isnt ideal

thanks for helping
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.