Wince Cab Manager使用方法

来源:互联网 发布:长虹55寸网络智能电视 编辑:程序博客网 时间:2024/05/17 23:40

=============================================================

标题:Wince Cab Manager使用方法

日期:2011.4.30

姓名:朱铭雷

=============================================================

上面一篇日记中,写到在使用VS2005的“智能设备CAB包制作工具”或者是直接使用“cabwiz.exe”命令行工具的时候不支持中文。但我们现在的项目需要在中文版Windows CE 6.0系统的“桌面”上新建一个中文的快捷方式,所以本篇日记记录另一种可以制作Windows CE CAB安装包的工具:wince cab manager

1 新建一个安装包向导,填上“公司名字”,“程序名字”,下一步。

 

2 微软基于wince的产品众多,这里可以选择支持哪些平台,然后下一步。

3 选择处理器类型,“ALL/CEF”表示任何类型的处理器都可以。下一步。

4 点击完成即可。

5 双击“CAB信息”,设置本CAB包的一些属性。

“公司名字”“程序名字”已经根据之前向导中填写的内容默认填写好了,选中“允许用户卸载此程序”。

设置“默认安装目录”和是否允许用户选择“安装目录”。勾上编译到执行程序。

这里可以再次设置处理器类型,以及是否压缩CAB包。

是否限制安装平台。

设置wince系统的最低最高版本限制,我这里设置了最低wince5.0,最高wince7.0。也可以选择程序不支持哪些平台。设置好之后,比如我到wince4.2系统中去安装这个CAB包,会弹出不兼容的提示。

设置好属性之后,开始添加文件,添加快捷方式。

我一共添加了4个文件,如何添加文件很简单不介绍,注意其默认安装目录即可。下面是添加快捷方式的步骤。

输入快捷方式名称。

选择为GZPD.exe创建快捷方式。

设置快捷方式放置的位置,这里都可以支持中文。还记得上篇日记中“%CE2%”和“%CE11%”代表什么意思吧。点击完成。

已经完成了大部分操作,这个时候可以点击“保存”,填写路径和CAB包名称,之后就生成了一个CAB安装包。注意wince cab manager工具没有一个叫做“生成”或类似名字的按钮,点击“保存”就会保存该CAB的信息并生成CAB包。我之前找了半天,都没找到点击哪里可以生成CAB包。

另外一个很重要的设置,就是添加注册表。我直接在wince cab manager工具中进行编辑。不过很遗憾我用的这个版本的wince cab manager中文破解版存在一定的问题。直接编辑Reg可能会导致程序死掉。

所以我采用了另一种途径,首先自己编写或导出一个GZPD.reg注册表文件。内容:

[HKEY_CURRENT_USER/Software/GZPD]

"MajorVer"=dword:00000001

 

[HKEY_CURRENT_USER/Software/GZPD]

"MinorVer"=dword:00000001

然后在wince cab manager工具中导入GZPD.reg,显示导入成功。

所有的操作都完成了:

最后点击一下保存按钮,生成我们最终的CAB安装包,放到wince平台上进行安装测试。

这一步出现了问题,默认安装路径,并不是我们之前设置的/Program Files/SureKam/GZPD

桌面上的中文快捷方式创建成功。

注册表信息写入成功。

不过开始菜单那的快捷方式好像没建出来。针对这两个问题再简单修改一下cab信息即可。

默认安装目录这有一个bug信息,在wince cab manager文档中可以找到:

All versions of the Windows CE operating system prior to version 3.0 suffer from a bug that prevents new directories from being created during installation unless they are directly beneath the directory the application is installed into. For example, if the application were installed into the "/Program Files/Hello World" directory, then:

  · A directory named "/Program Files/Hello World/Directory 1" could be created, since it is directly beneath the installation directory, but;

  · A directory named "/Windows/Hello World" could not be created, since it is not directly beneath the installation directory.

  Note that these problems only occur when the %CE% macros are used to specify the destination for the files and shortcuts included in the CAB file.  To work around this problem, WinCE CAB Manager provides an option to use hard-coded paths instead of the macros when setting the default installation folder, and for the destinations of the files and shortcuts included in the CAB file.

最后就是有一个技巧,由于前一篇日记已经对inf文件的编写很熟悉了。所以有什么问题时,可以在wince cab manager工具中导出inf,根据inf文件的内容很容易看出问题所在。