views:

955

answers:

2

I've written a Windows Mobile Standard/Smartphone app (my first) that uses a SQL Server Compact Edition database as the backend. I had no problem testing in the emulator in Visual Studio as it installed SqlCe to the emulator for me. When I created my deployment project, though, the resulting CAB file installed on my phone fine, but wouldn't run because it couldn't find the SqlCe library.

Does SqlCe need to be installed as a separate CAB like .NET CF 3.5? If so, where can I get this (I didn't find anything like this on MS's site)? Or can I just include the System.Data.SqlServerCe.dll file in my deployment?

Edit:

I added the above mentioned DLL to the deployment and it works, so that answers my initial question. But I have ideas for more applications, most of which will also use SqlCe. Rather than include a copy of the DLL with each install, I'd rather have a single source for the SqlCe library. I guess I could create my own install folder just for the DLL, but I'm guessing there's probably a more "official" way of doing this. So I'm back to my first intial question: is there a CAB for SqlCe? I don't want to install files if the user already has them, and certainly not install duplicates if I don't need to.

+2  A: 

I guess my fingers move faster than my brain. Here's the mobile edition install for Sql Server Compact: Microsoft SQL Server Compact 3.5 for Windows Mobile

Edit:

I wanted to add more information for anyone that comes across this looking for the same information I was.

First off, there are two ways I found to includes SqlCe with a mobile application: either use the installation CAB, or include the seven SqlCe DLLs with your application. Personally, I chose the former so that SqlCe can be used by other applications. All of the files (both the CAB or DLLs) for my device were located in C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\armv4i* but again I have an ARM processor and I don't know anything about the others.

The second issue for me was my own personal library of DLLs I include in every project. I don't want to install duplicates for every one of my applications, so I removed the DLLs from my deployment project and created a new deployment just for those files.

My final problem was how to make everything install without over-burdening the user. Most users are not developers and I don't want to have to expect them to install three separate CAB files (four if they don't already have .NET CF 3.5) just to use my application. I found the answer in Multicab, a sample deployment project that can chain CAB files and install only those that are necessary. While it's a C++ project (I personally work in C#) there's a whitepaper in the WinMo 6 SDK that walks through creating the uber-CAB file. The whitepaper and multicab project can be found at C:\Program Files\Windows Mobile 6 SDK\Samples\Common\CPP\Win32\multicabinstall*.

Hope this helps someone.

*Assuming installs were performed to default directories.

Michael Itzoe
A: 

Did you look at commercial options?

I have used Mobile Packager in many of my projects and I had a very good success with it.

It is not open source or free. You have to pay for it but you will save yourself from the several hours that you spend dealing with deployment issues.

Check it out. http://www.mobilepackager.com

I like this. I can't afford it now, but no problem to save up for a month or two. Thanks for the heads up.
Michael Itzoe