Click here to Skip to main content
11,639,126 members (68,504 online)
Click here to Skip to main content

Packaging and Deploying Pocket PC Applications and SQL Server CE 2.0

, 12 Nov 2005 CPOL 67.5K 58
Rate this:
Please Sign up or sign in to vote.
This article is about making a package containing a Pocket PC application and a SQL Server CE. The package will be of type MSI. When you click it, it will first install SQL Server CE 2.0 and then it will install the Pocket PC application.

Introduction

This article is about making a package containing a Pocket PC application and SQL Server CE. The package will be of type MSI. When you click it, it will first install SQL Server CE 2.0 and then it will install the Pocket PC application.

When I first started to make this package, I got a lot of help from this article.

Therefore, before you read any further, go through all the steps in the article above, and then return to this article.

Overview

If you are reading this, I believe you have a solution containing three projects, like the picture below:

Sample screenshot

Now, you have to go through the following steps:

  1. Making a new .ini file with the installation information about SQL CE.
  2. Add SQL Server CE CAB files to your Setup project.
  3. Add your new .ini file (from step 1) to the Setup project.
  4. Add a new event handler to the CustomInstaller project.

Road Map

Step 1: Making a new .ini file with installation information about SQL CE

Make a copy of your existing .ini file in your main project. Rename the new file to whatever you want. I called it Sqlce.ini.

Replace all the code in Sqlce.ini with this code:

[CEAppManager]
Version = 1.0
Component = Ordbog

[Ordbog]
Description = SQL Server CE
CabFiles = sqlce.ppc3.arm.CAB,sqlce.ppc3.mips.CAB,sqlce.ppc3.sh3.CAB,
           sqlce.ppc3.x86.CAB,sqlce.wce4.armv4.CAB,sqlce.wce4.x86.CAB

Attention!!! Replace “Ordbog” with the name of your main project.

Step 2: Add SQL Server CE CAB files to your Setup project

Right click your Setup project and choose Add >> File. Select the following files one by one:

  • sqlce.ppc3.arm.CAB
  • sqlce.wce4.armv4.CAB
  • sqlce.ppc3.mips.CAB
  • sqlce.ppc3.sh3.CAB
  • sqlce.wce4.x86.CAB
  • sqlce.ppc3.x86.CAB

You can find these files here: Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows CE\wce300\[Processor type].

Step 3: Add your new .ini file (from step 1) to the Setup project

Right click your Setup project and choose Add >> File. Select the .ini file from step 1. Your solution should look something like this (picture below):

Sample screenshot

Step 4: Add a new event handler to the CustomInstaller project

In CustomInstaller.cs, add this new event handler next to the two other event handlers:

this.BeforeInstall += new InstallEventHandler(CustomInstaller_BeforeInstall);

Next, add this snippet:

private void CustomInstaller_BeforeInstall(object sender, 
                                      InstallEventArgs e)
{
  string arg = Path.Combine(Path.GetDirectoryName(
               Assembly.GetExecutingAssembly().Location),"Sqlce.ini");
  RunAppManager(arg);
}

Rebuild the CustomInstaller project.

Before the changes in the CustomInstaller take effect, you sometimes will have to remove the old reference in the Setup project to the CustomInstaller assembly and replace it again. You have to do the same in the Custom Actions in your Setup project.

Next, rebuild your Setup project and install your package to your Pocket PC.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

JacobEgholm
Web Developer
Denmark Denmark
No Biography provided

You may also be interested in...

Comments and Discussions

 
QuestionHow to deploy windows application project Pin
ahawari0919-Nov-07 17:50
memberahawari0919-Nov-07 17:50 
QuestionApplicable to VS2005? Pin
debrachelle18-Feb-07 9:28
memberdebrachelle18-Feb-07 9:28 
AnswerRe: Applicable to VS2005? Pin
JacobEgholm18-Feb-07 21:39
memberJacobEgholm18-Feb-07 21:39 
GeneralRe: Applicable to VS2005? Pin
debrachelle18-Feb-07 21:46
memberdebrachelle18-Feb-07 21:46 
GeneralRe: Applicable to VS2005? Pin
Satyam15july23-Jul-07 6:51
memberSatyam15july23-Jul-07 6:51 
GeneralPocketPC Installer Pin
UncleMike9876-Oct-06 4:06
memberUncleMike9876-Oct-06 4:06 
GeneralRe: PocketPC Installer [modified] Pin
JacobEgholm18-Feb-07 22:14
memberJacobEgholm18-Feb-07 22:14 
QuestionDo we need CustomInstaller in VS 2005? Pin
Malcolm Hall5-Jan-06 15:35
memberMalcolm Hall5-Jan-06 15:35 
GeneralOverlapping actions Pin
ToniTonino15-Nov-05 22:48
memberToniTonino15-Nov-05 22:48 
GeneralRe: Overlapping actions Pin
dapoussin21-Dec-05 3:16
memberdapoussin21-Dec-05 3:16 
This solution isn't good.

See this one instead[^]

Cheers
Laurent
GeneralRe: Overlapping actions Pin
ToniTonino21-Dec-05 5:02
memberToniTonino21-Dec-05 5:02 
GeneralRe: Overlapping actions Pin
Malcolm Hall10-Jan-06 11:33
memberMalcolm Hall10-Jan-06 11:33 
GeneralRe: Overlapping actions Pin
tbaseflug25-Apr-06 6:35
membertbaseflug25-Apr-06 6:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150728.1 | Last Updated 12 Nov 2005
Article Copyright 2005 by JacobEgholm
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid