VS2008生成的Win7 Mobile Compact Framework 2.0安装失败
我最近将 WinMobile5 应用程序的 VS2005 解决方案升级到 VS2008。该解决方案还包含一个 CAB 构建器项目和一个 MSI 桌面安装程序项目。安装程序中的自定义 DLL 负责将应用程序以及支持 CAB(例如 Compact Framework 2.0、扫描仪库等)部署到实际设备。
我使用这篇文章作为 MSI 安装指南:
http://msdn.microsoft.com/en-us/library/aa446504.aspx
问题是,运行 Setup.exe / MSI 文件时,CF2 CAB 无法从 Win7 成功安装到 WM5 设备。但是,从 XP 安装可以正常工作。
摘要:
-Windows7 32位机 - VS2008 / WM6 SDK(包含WM5支持)
-符号 WM5 设备 - MC70
-Windows移动设备中心
-创建桌面 MSI 以通过自定义 DLL 安装 CF2 CAB 以及我的应用程序的 CAB
-在安装过程中(以管理员身份运行)我的应用程序的 CAB 安装成功,CF2 CAB 显示“安装失败”
-然而,从 VS2008 运行/调试应用程序将正确部署 CF2,因此它可以工作。
有趣的花絮:
我从设备中拉回了时髦的 CF2 CAB 以与源进行比较,源代码位于:
:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE\wce500\armv4i\NETCFv2.wm.armv4i.cab
C 令我惊讶的是,设备 CAB 有两个与源不同的十六进制字节。从头开始:
4D 53 43 46 00 00 00 00 68 48(从回调)其余相同
4D 53 43 46 00 00 00 00 50 22(来自源)其余部分相同
当我用“50 22”CAB替换“68 48”CAB并在设备上手动启动时,它安装得很好。所以我的问题是:为什么源出租车在到达目标设备后会略有改变?除此之外,这些文件是相同的。
我尝试过的其他事情:
从头开始创建一个针对 WM5/CF2 的小应用程序。添加CAB项目,添加Setup &部署项目。从 XP 运行安装程序,太棒了!从 Win7 运行安装程序,BOOM!
/Device root 不包含 CF2 安装日志。还没到那一步。
VOLATILE/Setup.log 不包含“错误”。
我还尝试过 UberCab 方法(将多个 CAB 捆绑到一个 CAB 中)。但是,在设备上解绑时:BOOM 失败。它以某种方式知道。
我已经无计可施了。 CF2 应该可以正常工作。
-汤姆
I recently upgraded a VS2005 solution for a WinMobile5 app to VS2008. The solution also contains a CAB builder project plus an MSI Desktop Installer project. A custom DLL from the installer takes care of deploying the app plus supporting CABs, like Compact Framework 2.0, scanner libraries, etc to the actual device.
I used this article as a guide for MSI installation:
http://msdn.microsoft.com/en-us/library/aa446504.aspx
Problem is, the CF2 CAB won't install successfully to a WM5 device from Win7 when running the Setup.exe / MSI file. However, installing from XP works fine.
Summary:
-Windows7 32-bit machine - VS2008 / WM6 SDK (includes WM5 support)
-Symbol WM5 Device - MC70
-Windows Mobile Device Center
-Created Desktop MSI to install CF2 CAB plus my app's CAB thru Custom DLL
-During install (running as admin) my app's CAB install successfully, the CF2 CAB says "Installation was unsuccessful"
-However running/debugging the app from VS2008 will deploy CF2 correctly, so it CAN work.
Interesting tidbit:
I pulled back the funky CF2 CAB from the device to compare with source, located here:
C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE\wce500\armv4i\NETCFv2.wm.armv4i.cab
To my surprise, the device CAB had two HEX bytes different than the source. From beginning:
4D 53 43 46 00 00 00 00 68 48 (from Pullback) rest is same
4D 53 43 46 00 00 00 00 50 22 (from Source) rest is same
When I replace the "68 48" CAB with the "50 22" CAB and launch manually on the device, it installs nicely. So my question, is: Why is the source cab slightly altered once it reaches the destination device? Other than that, the files are identical.
Other things I've tried:
From scratch creating a small App targeting WM5/CF2. Adding a CAB project, adding a Setup & Deploy project. Run Setup from XP, great! Run Setup from Win7, BOOM!
/Device root does not contain a CF2 Install Log. Doesn't get that far.
VOLATILE/Setup.log contains no "error".
I've also tried the UberCab approach (bundling multiple CABs into one CAB). However, when unbundling on the device: BOOM fail. It somehow knows.
I'm at my wit's end. The CF2 piece should just work.
-Tom
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回顾一下 CAB 安装程序 SDK 的源代码,我发现 CAB 的开头是一个固定大小的标头。第一个 DWORD 是 CAB 签名(0x4643534d 小端),如您所见。第二个 DWORD 是保留集,在您的情况下全为零。下一个 DWORD 是 CAB 的大小 - 您只显示较低的字,但差异接近 10k (0x4868 - 0x2250 = 0x2618)。这可能会导致 CAB 解压缩器失败,因为它正在查找文件末尾之后的数据。
现在我不知道为什么会改变。您已验证 MSI 中 CAB 的来源吗?您是否已在其他工具中打开 MSI 并拉出 CAB 以查看它是否在其中?基本上是源端的 CAB 错误(我认为很可能),还是移动时它被修改了?
Looking back at my source code for the CAB installer SDK, I see that the start of the CAB is a fixed-size header. The first DWORD is a CAB signature (0x4643534d little-endian) like you see. The second DWORD is a reserved set, which in your case is all zeros. The next DWORD is the size of the CAB - you're only showing the lower word, but the difference is nearly 10k (0x4868 - 0x2250 = 0x2618). That is likely causing the CAB decompressor to fail because it's looking for data past the end of the file.
Now why that's changing I don't know. You've verified the source for the CAB in the MSI? Have you openened the MSI in another tool and pulled out the CAB to see if it's right in there? Basically is the CAB wrong at the source side (most likely I think), or is it getting modified when moved?