November 24, 2005

Any MSDE Gurus Out There?

Its almost 2 in the morning, and I am at my witts end. I have been trying to find the answer to this and its driving me batty.

You see, I have a 4 MB installer that does a marvelous job of getting an application I wrote onto a host machine. With that said, its kind of a useless installer, because it uses MSDE and requires a specialized named instance to work. I have a prereq that requires MSDE to be installed, which isn't a problem since on most machines, its SBS with it already there. On XP machines, they can easily download and install it.

Back to my problem though. To add a named instance to MSDE, the documentation state you must recall the MSDE setup and pass it a few parameters. Here lies the first problem. My installer has NO IDEA where the setup executable for MSDE is, if its even on the system anymore. And chances are, neither will the user. So the solution is to distribute it so we can take care of it for the user. I found out you can actually strip the 66 MB MSDE installer down to a 1.8 MB MSI and a 25 MB cab file (SqlRun01.msi and SqlRun.cab). Even with compression though, its adding about 24 MB to my installer. What happened to my nice small app that's easy to download, and takes little bandwidth resources *sigh*

Now that I am distributing the files, my cmd line looks something like this:

SqlRun01.msi INSTANCENAME=MyInstanceName SAPWD="SomePass" REBOOT=ReallySuppress DISABLENETWORKPROTOCOLS=1 DISABLEAGENTSTARTUP=1 DISABLETHROTTLE=1

And it works. But I HATE IT. I have to now distribute a huge file to support this. There has to be another way to create a named instance in MSDE. Does anyone know of a way to do this programatically without having to ship the CAB file??? If you do, please email me or leave me a comment. I think its rather unacceptable to have to ship a setup installer of someone elses product that is already installed just to configure it. I must be missing something simple here. Guru knowledge very much welcomed.

Posted by SilverStr at November 24, 2005 01:53 AM | TrackBack
Comments

Sorry to say, but I think you're screwed. The install experience for MSDE is very bad (even if you use the merge modules and hack them to work, which means you have to release patches from then on to fix MS security holes) and it's even worse for SQL Express.

The only thing you might be able to do is tell your installer that MSDE is on the CD that the installer is installing from and that it's a relative path from there. Although it sounds like your target it to make this a download.

You might use Wise, in which case it can selectively download what's necessary....

Or choose not to use a named instance if there is already an SQL Server available and just install your database to that SQL Server and set application security.... (which is what we do)

Posted by: James Hancock at November 24, 2005 06:33 AM

If you're requiring a named instance, then you don't have much room to work with. "I think its rather unacceptable to have to ship a setup installer of someone elses product that is already installed just to configure it." Since you're requiring a specifically named instance, you aren't just 'configuring' MSDE - you're installing MSDE again in order to get the named instance. Each MSDE/SQL instance is a separate installation.

Posted by: Chad at November 24, 2005 11:52 PM

Thanks for the info guys.

As an update, I found a way around my problem. I wrote a small console application that recursively looks for all setup.exe on the system. When it finds one, it interogates the FileVersionInfo to determine if its the "SQL Server Setup" and that the version is the one I am expecting, or newer. If it is, then it writes the setting to a registry key which the installer can then use to call the setup program the way I expect it.

If the key doesn't exist, or the field is blank, then the installer downloads the full MSDE installer from a web source and runs the MSI to install. Ends up, this solves all my concerns.

Thanks for the feedback.

Posted by: Dana Epp at November 25, 2005 02:30 AM

The reason for the multiple MSIs is so that the different instances of SQL Server/MSDE on your machine - you can have up to 15 named instances plus a default instance - have different product GUIDs for the installer, so that Windows Installer considers them different products. Reusing an existing setup.exe is probably OK if all the MSIs accompany it, but if it's been stripped down to just one, you may well find that the setup fails because an instance using that product GUID is already present.

Posted by: Mike Dimmick at November 27, 2005 01:39 PM

I've had to deal with the coding end of MSDE installations, and they aren't pretty.

For starters, as Dana has found, you've got a 25MB CAB file, and a 1.6MB MSI file to distribute. However, this MSI file only works with a single instance of MSDE. If you want a different, instance, you need a different MSI file...

The product I was working on needed to support installing different instances of MSDE, but the company didn't want to ship all 16 MSI files. I ended up finding the differences between each MSI file (a couple of metadata GUIDs and 1 or 2 properties, from memory) and wrote a tool that would modify one MSI file to look like another. It worked well, but wasn't pretty from a technical viewpoint.

As Chad noted, each instance is a seperate install of SQL/MSDE. This means more memory usage, separate copies of binaries, etc. All up, it's easier to modify your product to use an existing SQL/MSDE instance than it is to install a new instance.

Also watch out for service pack updates for MSDE. They're particularly nasty. If you don't get the command-line options right, the update won't install.

Posted by: Jamie Anderson at November 28, 2005 12:51 PM