MakeCAB是微軟提供的制作CAB的文件,詳細(xì)的MakeCAB介紹請(qǐng)參考微軟MSDN。
正好這幾天做的一個(gè)WEB ActiveX SIP Phone需要打包成.CAB文件,于是稍微研究了一下MakeCAB的用法。
直接運(yùn)行MakeCAB,系統(tǒng)給出命令用法如下:
C:Documents and SettingsSunDesktopwebsipp>makecab
Microsoft (R) Cabinet Maker - Version 5.1.2600.2180
Copyright (c) Microsoft Corporation. All rights reserved..
MAKECAB [/V[n]] [/D var=value ...] [/L dir] source [destination]
MAKECAB [/V[n]] [/D var=value ...] /F directive_file [...]
source File to compress.
destination File name to give compressed file. If omitted, the
last character of the source file name is replaced
with an underscore (_) and used as the destination.
/F directives A file with MakeCAB directives (may be repeated).
/D var=value Defines variable with specified value.
/L dir Location to place destination (default is current directory).
/V[n] Verbosity level (1..3).
如果目錄里面有多個(gè)文件,那么就需要編寫(xiě)一個(gè)文件列表文件,用來(lái)告訴MakeCAB,有多少文件需要打包。
簡(jiǎn)單的編寫(xiě)了一個(gè)list.txt文件,里面僅僅包含2行。一個(gè)是libactivex.inf,一個(gè)libactivex.dll
然后執(zhí)行:
makecab /F list.txt /D compressiontype=lzx /D compressionmemory=21 /V
系統(tǒng)將顯示壓縮過(guò)程和壓縮結(jié)果,如下:
Microsoft (R) Cabinet Maker - Version 5.1.2600.2180
Copyright (c) Microsoft Corporation. All rights reserved..
287,395 bytes in 2 files
Total files: 2
Bytes before: 287,395
Bytes after: 162,170
After/Before: 56.43% compression
Time: 0.74 seconds ( 0 hr 0 min 0.74 sec)
Throughput: 378.76 Kb/second
壓縮之后,目錄下將生成一個(gè)目錄,將目錄里面的文件改名成libactivex.cab(可以是你需要的文件名)就OK了。
然后就可以放到WEB服務(wù)器的目錄下,IE打開(kāi)的時(shí)候就會(huì)提示下載了。
- PC官方版
- 安卓官方手機(jī)版
- IOS官方手機(jī)版