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.