Installing MSDE Database with your .NET applications

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.

 

 

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Print | posted on Friday, April 15, 2005 11:59 AM

Comments on this post

# re: Installing MSDE Database with your .NET applications

Requesting Gravatar...
Great article for me.. Where can i find the next article of yours ?
Left by Kerem Tamkoc on Apr 06, 2006 12:10 PM

# re: Installing MSDE Database with your .NET applications

Requesting Gravatar...
I wish the font was a little bigger, haha. Just kidding. Thanks for the information, i found this through a search in yahoo.
Left by Premium Cigar on May 13, 2010 3:06 PM

# re: Installing MSDE Database with your .NET applications

Requesting Gravatar...
"'Friends' was a tiffany jewelry hit immediately," said Lisa Kudrow, links of london necklace who starred as
Left by Brand Lee on Jun 22, 2010 2:50 AM

# re: Installing MSDE Database with your .NET applications

Requesting Gravatar...
Be honest with yourself by paying attention to your actions. Actions speak louder than words, and they always tell the truth. What do your actions say about you? If you say you love your job, but your actions say otherwise, which do you think is more true — your words or your actions? On the other hand, if you say you’re not good at a certain job, but your actions say otherwise, that’s also important. What do you do with this insight? You can use it to make more beneficial choices in your life. By being honest with yourself based on your previous actions, your actions moving forward will be based on truth instead of just what you tell yourself.
Despite what your subconscious may be telling you, you can have love with no limits. The key is to unconditionally love yourself first.
Left by thomas sabo ringe on Aug 04, 2010 3:35 AM

# re: Installing MSDE Database with your .NET applications

Requesting Gravatar...
Wonderful! You never cease to amaze with the information you provide!
Left by vaporizer reviews on Nov 17, 2011 2:14 PM

Your comment:

 (will show your gravatar)