其实做起来很简单,你需要一下几个问题 makecab.exe、Cabwiz.exe,还有一个inf文件,前两个在你安装的sdk里面都能找的到,smart phone 和PPC的都有,能不能通用我没实验过。这里最重要的是那个inf文件的编写。(下面会介绍),所有的文件都有了以后,在cmd里面执行 CabwizSP xx.inf,xx代表你为inf文件起的名字。就能生成一个cab安装文件,把这个文件copy到PPC里面去就可以安装了,不过要注意的是,你安装完成后这个cab包会被自动的删除掉的。
下面给个我写的inf文件的例子,很简单的,大家看看就明白了,实在不明白,大家看我在最后面给出的连接。
[Version]
Signature = "$Windows NT$"
Provider = "2.18"
CESignature = "$Windows CE$"
[CEStrings]
AppName = "CityMgr"
InstallDir = %CE1%/%AppName%
mappname = "城管通"
mupdatename = "城管通升级程序"
[SourceDisksNames]
1 = ,"city_path",,CityMgr
2 = ,"res_path",,CityMgr/resource
3 = ,"maps_path",,CityMgr/maps
[SourceDisksFiles]
citymgr.exe = 1
citymgrupdate.exe = 1
conf.dat = 1
help.htm = 1
number.txt = 1
path.txt = 1
welcome.bmp =1
background.gif = 2
default.jpg = 2
event.gif = 2
event_.gif = 2
login.gif = 2
gridset.txt = 3
map1.dat = 3
map1.ind = 3
map2.dat = 3
map2.ind = 3
map3.dat = 3
map3.ind = 3
map4.dat = 3
map4.ind = 3
shmap.mdf = 3
[DefaultInstall]
CopyFiles = CopyToCity,CopyToRes,CopyToMap
;这里的这个快捷方式的指定让我伤了大脑筋,不知道是我的领悟能力有限还是微软的帮助没表达清楚,呵呵
CEShortcuts = mMainApp,mUpdateApp
[mMainApp]
城管通,0,citymgr.exe,%CE11%
[mUpdateApp]
城管通升级程序,0,citymgrupdate.exe,%CE11%
[DestinationDirs]
CopyToRes = 0,%CE1%/%AppName%/RESOURCE
CopyToMap = 0,%CE1%/%AppName%/maps
CopyToCity = 0,%CE1%/%AppName%
;就是这里的路径,对应上面的快捷方式,刚开始还以为是快捷方式的存放路径,后来发现是需要设置快捷方式的文件的路径
mMainApp = 0,%CE1%/%AppName%
mUpdateApp = 0,%CE1%/%AppName%
[CopyToCity]
citymgr.exe,,,0
citymgrupdate.exe,,,0
conf.dat,,,0
help.htm,,,0
number.txt,,,0
path.txt,,,0
welcome.bmp,,,0
[CopyToRes]
background.gif,,,0
default.jpg,,,0
event.gif,,,0
event_.gif,,,0
login.gif,,,0
[CopyToMap]
gridset.txt,,,0
map1.dat,,,0
map1.ind,,,0
map2.dat,,,0
map2.ind,,,0
map3.dat,,,0
map3.ind,,,0
map4.dat,,,0
map4.ind,,,0
shmap.mdf,,,0
这里给出一个微软的详细帮助连接,不过估计看的也会比较晕!
http://msdn.microsoft.com/library/chs/default.asp?url=/library/CHS/dv_evtuv/html/etlrfsectionheaderreference.asp