目录

Wince-Cab-Manager使用方法

目录

Wince Cab Manager使用方法

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

标题:

Wince Cab Manager

使用方法

日期:

2011.4.30

姓名:朱铭雷

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

上面一篇日记中,写到在使用

VS2005

的“智能设备

CAB

包制作工具”或者是直接使用“

cabwiz.exe

”命令行工具的时候不支持中文。但我们现在的项目需要在中文版

Windows CE 6.0

系统的“桌面”上新建一个中文的快捷方式,所以本篇日记记录另一种可以制作

Windows CE CAB

安装包的工具:

wince cab manager

http://hi.csdn.net/attachment/201104/30/0_13041757190GMK.gif

1

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

http://hi.csdn.net/attachment/201104/30/0_1304175735Mlj9.gif

2

微软基于

wince

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

http://hi.csdn.net/attachment/201104/30/0_130417574811Qx.gif

3

选择处理器类型,“

ALL/CEF

”表示任何类型的处理器都可以。下一步。

http://hi.csdn.net/attachment/201104/30/0_1304175759tJZB.gif

4

点击完成即可。

http://hi.csdn.net/attachment/201104/30/0_1304175779112W.gif

5

双击“

CAB

信息”,设置本

CAB

包的一些属性。

http://hi.csdn.net/attachment/201104/30/0_13041757946drr.gif

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

http://hi.csdn.net/attachment/201104/30/0_1304175809283n.gif

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

http://hi.csdn.net/attachment/201104/30/0_1304175826x7aM.gif

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

CAB

包。

http://hi.csdn.net/attachment/201104/30/0_13041758405LbB.gif

是否限制安装平台。

http://hi.csdn.net/attachment/201104/30/0_1304175856zw85.gif

设置

wince

系统的最低最高版本限制,我这里设置了最低

wince5.0

,最高

wince7.0

。也可以选择程序不支持哪些平台。设置好之后,比如我到

wince4.2

系统中去安装这个

CAB

包,会弹出不兼容的提示。

http://hi.csdn.net/attachment/201104/30/0_1304175869tT9t.gif

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

我一共添加了

4

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

输入快捷方式名称。

http://hi.csdn.net/attachment/201104/30/0_1304175882hc53.gif

选择为

GZPD.exe

创建快捷方式。

http://hi.csdn.net/attachment/201104/30/0_1304175896rW7e.gif

设置快捷方式放置的位置,这里都可以支持中文。还记得上篇日记中“

%CE2%

”和“

%CE11%

”代表什么意思吧。点击完成。

http://hi.csdn.net/attachment/201104/30/0_1304175908L1mG.gif

已经完成了大部分操作,这个时候可以点击“保存”,填写路径和

CAB

包名称,之后就生成了一个

CAB

安装包。注意

wince cab manager

工具没有一个叫做“生成”或类似名字的按钮,点击“保存”就会保存该

CAB

的信息并生成

CAB

包。我之前找了半天,都没找到点击哪里可以生成

CAB

包。

http://hi.csdn.net/attachment/201104/30/0_1304175923HRgg.gif

另外一个很重要的设置,就是添加注册表。我直接在

wince cab manager

工具中进行编辑。不过很遗憾我用的这个版本的

wince cab manager

中文破解版存在一定的问题。直接编辑

Reg

可能会导致程序死掉。

http://hi.csdn.net/attachment/201104/30/0_1304175936y5Q0.gif

所以我采用了另一种途径,首先自己编写或导出一个

GZPD.reg

注册表文件。内容:

[HKEY_CURRENT_USER/Software/GZPD]

“MajorVer”=dword:00000001

[HKEY_CURRENT_USER/Software/GZPD]

“MinorVer”=dword:00000001

然后在

wince cab manager

工具中导入

GZPD.reg

,显示导入成功。

http://hi.csdn.net/attachment/201104/30/0_130417597600tq.gif

所有的操作都完成了:

http://hi.csdn.net/attachment/201104/30/0_1304175990777s.gif

最后点击一下保存按钮,生成我们最终的

CAB

安装包,放到

wince

平台上进行安装测试。

http://hi.csdn.net/attachment/201104/30/0_1304176005ZoD3.gif

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

/Program Files/SureKam/GZPD

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

http://hi.csdn.net/attachment/201104/30/0_1304176017Sp8T.gif

注册表信息写入成功。

http://hi.csdn.net/attachment/201104/30/0_1304176111ZT4o.gif

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

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

文件的内容很容易看出问题所在。