1、编写inf文件
可以参考POCKET PC 2003的AppInst例子,以及Windows Mobile 5.0 SDK帮助文档Deploying Windows Mobile Applications > How to Package and Distribute Windows Mobile Applications
sample.inf
[Version]
Signature = "$Windows NT$" ; required as-is
Provider = "Microsoft" ; maximum of 30 characters, full app name will be "<Provider> <AppName>"
CESignature = "$Windows CE$" ; required as-is
[CEStrings]
AppName = "Mine Sweeper" ; maximum of 40 characters, full app name will be "<Provider> <AppName>"
InstallDir = %CE1%\%AppName% ; Program Files\Mine Sweeper
; Directory Identifier Pocket PC Directory
; %CE1% \Program Files
; %CE2% \Windows
; %CE4% \Windows\StartUp
; %CE5% \My Documents
; %CE8% \Program Files\Games
; %CE11% \Windows\Start Menu\Programs
; %CE14% \Windows\Start Menu\Programs\Games
; %CE15% \Windows\Fonts
; %CE17% \Windows\Start Menu
[SourceDisksNames] ; directory that holds the application's files
1 = , "Common Files",,Common ; disk_id = ,comment,,path (absolute or relative paths)
[SourceDisksFiles] ; list of files to be included in .cab
bigexpl.wav = 1
miniwin.wav = 1
winmine.exe = 1
[DefaultInstall] ; operations to be completed during install
CopyFiles = CopyToProgramFiles
AddReg = RegData
CEShortcuts = Shortcuts
[DestinationDirs] ; default destination directories for each operation section
CopyToProgramFiles = 0, %InstallDir%
Shortcuts = 0, %CE14% ; \Windows\Start Menu\Programs\Games
[CopyToProgramFiles] ; copy operation file list
"winmine.exe", winmine.exe
"miniwin.wav", miniwin.wav
"bigexpl.wav", bigexpl.wav
[RegData] ; registry key list
HKCU,Software\%AppName%,MajorVersion,0x00010001,1
HKCU,Software\%AppName%,MinorVersion,0x00010001,0
[Shortcuts] ; Shortcut created in destination dir, %CE14%
%AppName%,0,winmine.exe
2、用cabwiz命令生成cab文件
cabwiz sample.inf /compress
/compress命令只能用在Windows Mobile以后的版本