使用我的 Windows Mobile 应用程序部署 SQL Server CE
我编写了一个 Windows Mobile Standard/智能手机应用程序(我的第一个),它使用 SQL Server Compact Edition 数据库作为后端。我在 Visual Studio 的模拟器中进行测试时没有遇到任何问题,因为它为我将 SQL Server CE 安装到了模拟器中。但是,当我创建部署项目时,生成的 CAB 文件可以正常安装在我的手机上,但无法运行,因为它找不到 SQL Server CE 库。
SQL Server CE 是否需要像 .NET CF 3.5 一样作为单独的 CAB 安装?如果是这样,我在哪里可以得到这个(我在微软的网站上没有找到类似的东西)?或者我可以在部署中包含 System.Data.SqlServerCe.dll 文件吗?
编辑:
我将上述 DLL 添加到部署中并且它可以工作,这回答了我最初的问题。但我有更多应用程序的想法,其中大多数也将使用 SQL Server CE。我宁愿拥有 SQL Server CE 库的单一源,而不是每次安装时都包含 DLL 的副本。我想我可以为 DLL 创建自己的安装文件夹,但我猜可能有一种更“官方”的方法来做到这一点。那么我回到我最初的第一个问题:是否有适用于 SQL Server CE 的 CAB?如果用户已经拥有文件,我不想安装它们,如果不需要,当然也不会安装重复的文件。
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 SQL Server CE 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 SQL Server CE library.
Does SQL Server CE 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 SQL Server CE. Rather than include a copy of the DLL with each install, I'd rather have a single source for the SQL Server CE 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 SQL Server CE? I don't want to install files if the user already has them, and certainly not install duplicates if I don't need to.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我猜我的手指比我的大脑移动得更快。以下是 Sql Server Compact 的移动版本安装: Microsoft SQL Server Compact 3.5 for Windows Mobile
编辑:
我想为任何遇到此问题并寻找与我相同信息的人添加更多信息。
首先,我发现有两种方法可以将 SqlCe 包含在移动应用程序中:使用安装 CAB,或者将七个 SqlCe DLL 包含在您的应用程序中。就我个人而言,我选择前者,以便 SqlCe 可以被其他应用程序使用。我的设备的所有文件(CAB 或 DLL)都位于
C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\armv4i
* 但我再次有ARM 处理器,其他的我一无所知。对我来说,第二个问题是我在每个项目中都包含的个人 DLL 库。我不想为每个应用程序安装重复项,因此我从部署项目中删除了 DLL,并仅为这些文件创建了一个新的部署。
我的最后一个问题是如何在不给用户带来过多负担的情况下安装所有内容。大多数用户不是开发人员,我不想期望他们安装三个单独的 CAB 文件(如果他们还没有 .NET CF 3.5,则安装四个文件)只是为了使用我的应用程序。我在 Multicab 中找到了答案,这是一个示例部署项目,可以链接 CAB 文件并仅安装必要的文件。虽然它是一个 C++ 项目(我个人使用 C# 工作),但 WinMo 6 SDK 中有一份白皮书,介绍了如何创建 uber-CAB 文件。白皮书和 multicab 项目可以在
C:\Program Files\Windows Mobile 6 SDK\Samples\Common\CPP\Win32\multicabinstall
* 中找到。希望这对某人有帮助。
*假设安装是在默认目录中执行的。
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.
您是否考虑过商业选择?
我在许多项目中使用了 Mobile Packager,并且取得了非常好的成功。
它不是开源或免费的。您必须为此付费,但您可以节省处理部署问题的几个小时。
一探究竟。 http://www.mobilepackager.com
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