Installing MSDE with your .NET application

I love using MSDE as my backend engine for my windows application as a developer i have 3 windows forms applications that use MSDE as their local database engine. Honestly I had a very hard time installing MSDE with them, so I decided to documents my findings for others.

First thing you want to do is make sure you have the latest version of MSDE installed on your development machine, you can download it from here http://www.microsoft.com/downloads/details.aspx?FamilyId=A0DAC778-60A6-4B11-8AA8-BF12261A303A&displaylang=en

Next open your Setup and Deployment project, right mouse click on the project and navigate to the folder you installed MSDE, if you took the default location you will find the MSM files in C:\sql2ksp3\MSDE\MSM folder add all of them, next you need to add all the language specific Merge Modules, I am using en_us so also add all the MSM files located in C:\sql2ksp3\MSDE\MSM\1033, you project now should contain the 17 MSM files you just added.

Build your project.

I wish you would be done now, but if you were there would be no need for this article. Unfortunately order of execution needs to be modified, you also need to specify an instance number. To do this I use ORCA to edit the MSI file. To do this you need to install windows Installer SDK samples, tools and documentation from http://www.microsoft.com/msdownload/platformsdk/sdkupdate/

You can find more information on how to use the orca database editor to edit windows installer files please refer to http://support.microsoft.com/kb/255905/EN-US/

Using Orca make the following modifications to the following tables

1.      InstallExecuteSeauence

a.       Streamsupportfiles entry has to execute before GetSQLStates, DetectUpgrade and SQLDisableNetAcessError

                                                                   i.      Increment the sequence number for GetSQLStates,DetectUpgrade and SQLDisableNetAccessError by 1 then change the streamSupportfiles sequence to what GetSQLStates sequence was for example in my MSI file (Your sequence numbers might be different depending on other Merge Modules in your installer.)

Action

Initial Seq

New Seq

GetSQLStates

103

104

DetectUpgrade

104

105

SQLDisableNetAcessError

105

106

SteamSupportFiles

403

103

 

 

 

                                                                 ii.      Also RemoveExistingProcuts should occur after InstallFinalize I found this great tip here http://tonesnotes.org/2003/01/10/redistributing-msde-framework

Change the sequence of RemoveExistingProducts to installFInalize +1 for example RemoveExistingProducts is 1525(I have also seen 1825) and InstallFinalize is (6600 I have also seen 6900) change it to 6601 or 6901 as long as it is exactly after install finalize. You’ll notice this will create double entry for 6601, but it should work fine.

Next in the InstallUISequence make the following modifications. Keep in mind your sequence numbers might vary. The important thing here is to move StreamSupportFiles before GetSQLStates.

Action

Initial Seq

New Seq

GetSQLStates

103

104

DetectUpgrade

104

105

SQLDisableNetAcessError

105

106

StreamSupportFiles

403

103

b.      Finally you need to add at least a sequence name for your MSDE

                                                                   i.      in the property table add the following rows

1.      SqlInstanceName = (nameof your instance)

2.      SqlSaPwd =(sapassword) if you are using SQLserversecurity

3.      SqlSecurityMode Sql (optional)

4.      SqlProgramDir = (path to installation Folder) optional

5.      Some other entries that you might want to set could be

a.       SqlUpgrade

b.      SqlCollation

c.       SqlCallBack

c.       Save the MSI file and you are done.

 

In the Next Article I will write how to install the initial database. Please feel free to send me comments to Shervin@computerways.com please be aware I use Spam Arrest and you will receive a challenge the first time you send me an Email

Shervin Shakibi

HTtp://www.computerways.com

 

Shervin Shakibi is the Chief Technical Officer for Computerways Inc., a Microsoft Gold Partner specializing in .NET development. In addition to being an author and Technical editor on many .NET books he has been a popular speaker at events such as Microsoft Tech Ed, PDC and Developer Days. As the Co-founder of Florida .NET users groups (http://www.fladotnet.com ), he created and currently manages Non-profit Ways (http://www.nonprofitways.com). Non-profit ways gives Developers an opportunity to learn the tools and languages that support .NET, while developing solutions for non-profit organizations which could not afford cost of development.

 

 

 

Comments

# re: Installing MSDE with your .NET application
Gravatar Shervin, Baby! Long time to speak. Keep the installer and ORCA stuff coming. I need to learn how to use it like a champ by Sunday afternoon!
Left by Scott Bellware on 4/15/2005 6:17 PM
# re: Installing MSDE with your .NET application
Gravatar To hell with that. Use a real embedded RDBMS like firebird.

Flame away ;)
Left by Chris Martin on 4/16/2005 3:49 PM
# re: Installing MSDE with your .NET application
Gravatar Great article, I am anxiously awaiting part II where you attatch/install the initial database. I assume you have to start the service before adding the database?
Left by Andy Meyer on 4/20/2005 2:58 PM
# re: Installing MSDE with your .NET application
Gravatar Great Article, i found it very usefull. Waiting for the next.
Left by Sreedev on 6/28/2005 9:43 AM
# re: Installing MSDE with your .NET application
Gravatar Has anyone experienced following the instructions so kindly provided by Shervin and received the dreaded "Strong SA Password is required" error message? The entire process went flawlessly until I went to install... Isn't that always the case! Anyway, if anyone has any pearls of wisdom for me it would be much appreciated. BTW:The properties I added are as follows:

SqlInstanceName = SomeName
SqlSaPwd = password
SqlSecurityMode = sql

I also tried all cap variations of the above and setting the blanksapwd=1 override.

Thanks in advance
Left by Kevin on 9/19/2005 3:40 PM
# re: Installing MSDE with your .NET application
Gravatar I also tried all cap variations of the above and setting the blanksapwd=1 override.

Try SqlBlankSaPwd=1

It worked for me
Left by Robert on 2/8/2006 3:20 PM
# re: Installing MSDE with your .NET application
Gravatar Instead of Downloading the whole Platform sdk you can get it from here http://www.pek.com/projects/msi/orca.zip
Left by Andrew Jojo on 5/12/2006 2:59 AM
# re: Installing MSDE with your .NET application
Gravatar Interesting Article, i found it very usefull. Waiting for the next.

Thanks
Left by Kiran Kothawade on 12/17/2007 4:11 AM

Leave Your Comment

Title*
Name*
Email (never displayed)
 (will show your gravatar)
Url
Comment*

Preview Your Comment.