makecab cabwiz 制作PPC中文程序名的安装包;makecab中利用参数设置不压缩,设置带文件夹进行压缩

来源:互联网 发布:php 字符串截取替换 编辑:程序博客网 时间:2024/06/11 21:10

在VS2005中没有办法制作中文程序名的CAB安装包,因为cabwiz for vs2005不支持此功能,解决此问题可以通过网上一些文章所说先制作英文CAB安装包,然后解压,修改_setup.xml文件中的字符,再用makecab重新打包的方法。也可以借助第三方软件,如wince cab manager。

 

但是这种方法不适于制作PPC2003系统的CAB安装包,在PPC2003上用makecab打包以后,即便设置为无压缩的cab,也仍然不能正确安装。解决方法是,先用VS2005生成带有英文名的CAB,然后,找到cabwiz for vs2003,也就是VS2003目录中的cabwiz.exe,将生成好的英文CAB,以及INF文件,拷贝到cabwiz同目录下,修改INF文件中的相关位置的英文,改为中文,然后用UE将INF文件保存为ANSI格式,然后执行cabwiz.exe xx.inf就会生成想要的PPC2003中的带中文名的安装包了。

 

另外,makecab 的命令行参数其实有很多,但是在网上找不到特别详细的解释,只好捕风捉影到一些有用的参数,用于使用makecab来制作无压缩的CAB安装包,以及使用makecab来制作包含子目录的CAB安装包。命令行设置如下:

无压缩CAB:makecab /d compress=off /f x.ddf;

包含子目录的CAB:这需要修改x.ddf文件中的内容,举例如下:

.OPTION EXPLICIT      
 
.Set CabinetNameTemplate=mycab.CAB
 
.Set Cabinet=on
.Set Compress=on
 
"file1.pdf"
"folder1/file2.doc"
"folder2/This is a third file.doc"

 

或:

 

.OPTION EXPLICIT      
 
.Set CabinetNameTemplate=mycab.CAB
 
.Set Cabinet=on
.Set Compress=on
 
"file1.pdf"
 
.Set DestinationDir=folder1
"folder1/file2.doc"
 
.Set DestinationDir=folder2
"folder2/This is a third file.doc"

 

 

 

 

更多关于makecab的命令行参数设置:

 

 

 

//////////////////////////http://dataerror.blogspot.com/2005/10/makecab-part-3-compress-multiple-files.html

MakeCab : Part 3 - Compress multiple files in multiple folders

By default, MakeCab does not preserve folder path when it compress the files.

Try the following directive file and check the CAB file. You will notice the path information is not in the CAB file. Replace the file list with your actual files.


.OPTION EXPLICIT        .Set CabinetNameTemplate=mycab.CAB  .Set Cabinet=on.Set Compress=on "file1.pdf""folder1/file2.doc""folder2/This is a third file.doc"

To preserve the path information, you have to use the DestinationDir directive. Modify the directive file to look like this:


.OPTION EXPLICIT        .Set CabinetNameTemplate=mycab.CAB  .Set Cabinet=on.Set Compress=on "file1.pdf" .Set DestinationDir=folder1"folder1/file2.doc" .Set DestinationDir=folder2"folder2/This is a third file.doc"

Run the MakeCab against the directive file and open the CAB file. You should see the path information is preserved.


/////////////////http://qzone.qq.com/blog/76059229-1213762675

Kēの宝贝_家 http://76059229.qzone.qq.com不能说的秘密装扮空间 加为好友
 日志 > 技术文章
转载到我空间复制本文网址小字体分享 上一篇 | 下一篇 | 返回日志列表
使用 MakeCAB.exe创建CAB文件
阅读(20) 评论(0) 发表时间:2008年06月18日 12:17
本文地址:http://qzone.qq.com/blog/76059229-1213762675

 
 
MakeCAB.exe 是 Windows 2000 或更高版本中随附的工具。要使用 MakeCAB.exe 来创建 .cab 文件,请执行以下步骤:

为 makecab.exe 创建一个定向文件,然后以 .ddf 扩展名保存该文件。下面的示例定向文件(名为 sample.ddf)为一个简单的 Web 部件库项目创建了一个 .cab 文件:

;*** Sample Source Code MakeCAB Directive file example
;
.OPTION EXPLICIT ; Generate errors
.Set CabinetNameTemplate=SampleCab.cab
.set DiskDirectoryTemplate=CDROM ; All cabinets go in a single directory
.Set CompressionType=MSZIP;** All files are compressed in cabinet files
.Set UniqueFiles="OFF"
.Set Cabinet=on
.Set DiskDirectory1=SAMPLECAB.CAB
manifest.xml
WebPart1.dwp
WebPartLibrary1.dll
;*** <the end>

将您希望包含在 .cab 文件中的所有文件复制到创建 .ddf 文件的目录中。在本例中,这些文件是 Manifest.xml 文件、WebPart1.dwp 文件和 WebPartLibrary1.dll 文件。

打开一个命令提示符,转到包含 .ddf 文件以及您希望包含在 .cab 文件中的文件的目录,然后运行以下命令:

Makecab.exe /F sample.ddf


MakeCAB.exe 创建一个名为 SAMPLECAB.CAB 的目录,然后在该目录中创建一个名为 SampleCab.cab 的 .cab 文件,其中包含 Sample.ddf 定向文件中列出的三个文件。

有关 MakeCAB.exe 的详细信息,请下载 Microsoft Cabinet Software Development Kit。

用本地化资源创建 CAB 文件
Visual Studio   不支持创建包含内部目录的 .cab 文件。但是,本地化的 Web 部件可能需要一个包含内部目录的 .cab 文件。因此,您必须使用一个   MakeCAB.exe 之类的工具或其他第三方 CAB 实用工具来部署本地化的 Web 部件。

下面的示例描述如何为一个名为 SampleWebPartLibrary 的英语 Web 部件项目(该项目同时还提供德语本地化资源)创建 .cab 文件。本例中的 .cab 文件名为 Sample.cab,它必须包含下列文件:

SampleWebPartLibrary.dll

Help.htm

Image1.gif

WebPart1.dwp

de-DE/Help.htm

de-DE/Image1.gif

de-DE/WebPart1.dwp


要为该示例 Web 部件项目创建 .cab 文件,请执行以下步骤:

1.
创建适当的 Manifest.xml 文件。下面的示例显示 Sample.cab 文件的 Manifest.xml 文件:

<?xml version="1.0" encoding="utf-8" ?>

<WebPartManifest
   xmlns="http://schemas.microsoft.com/WebPart/v2/Manifest">
    <Assemblies>
       <Assembly FileName="SampleWebPartLibrary.dll">
          <ClassResources>
             <ClassResource FileName="image1.gif"/>
             <ClassResource FileName="help.htm"/>
             <ClassResource FileName="de-DE/image1.gif"/>
             <ClassResource FileName="de-DE/help.htm"/>
          </ClassResources>
          <SafeControls>
             <SafeControl Namespace="SampleWebPartLibrary"
               TypeName="*"/>
          </SafeControls>
       </Assembly>
    </Assemblies>     
    <DwpFiles>
       <DwpFile FileName="WebPart1.dwp"/>
       <DwpFile FileName="de-DE/WebPart1.dwp"/>
    </DwpFiles>
</WebPartManifest>


2.
创建适当的 Makecab.exe 定向文件。下面的示例显示 Sample.cab 文件的定向文件:

;*** Sample Source Code MakeCAB Directive file example
;
.OPTION EXPLICIT ; Generate errors
.Set CabinetNameTemplate=Sample.cab   
.set DiskDirectoryTemplate=CDROM ; All cabinets go in a single
   directory
.Set CompressionType=MSZIP ;** All files are compressed in cabinet
   files
.Set UniqueFiles="OFF"
.Set Cabinet=on
.Set DiskDirectory1=SAMPLE.CAB
manifest.xml
WebPart1.dwp
SampleWebPartLibrary.dll
Image1.gif
help.htm
Set DestinationDir=de-DE
de-DE/WebPart1.dwp
de-DE/image1.gif
de-DE/help.htm
;*** <the end>


3.
将您希望包含在 .cab 文件中的所有文件复制到创建 .ddf 文件的目录中,并将所有的本地化资源复制到相应的子目录中。下面的示例显示 Sample.cab 文件的目录结构:

/Directory with directive file
               Sample.ddf
               Manifest.xml
               SampleWebPartLibrary.dll
               WebPart1.dwp
               Image1.gif
               Help.htm
               /de-DE
                         WebPart1.dwp
                         Image1.gif
                         Help.htm


4.
打开一个命令提示符,转到包含 .ddf 文件以及您希望包含在 .cab 文件中的文件的目录,然后运行以下命令,以便在 Sample.cab 文件中创建一个子目录,并为部署准备 Sample.cab 文件:

Makecab.exe /F sample.ddf
 

 


空间的其他文章:
[技术文章]:摩托罗拉E398 刷机完全教程(2008年02月17日 19:54)
[蕶喥聅擝]:刘翔休息室内难忍大哭!央视没敢播放,刘翔不哭,加油(2008年08月19日 15:52)
[个人日记]:刘翔是我心中永远的冠军!(2008年08月19日 15:44)
[地图]:一张很实用的地图(2008年07月18日 13:04)
[技术文章]:SP主题XML基础参数经验篇(2008年06月20日 20:51)
[技术文章]:ASP+模板生成静态HTML(2008年06月20日 20:26)
[技术文章]:在java程序中执行dos命令或运行其他程序(2008年06月18日 12:47)
[技术文章]:(原)VB制作CAB包过程(2008年06月18日 12:09)
[技术文章]:Web发布cab文件打包的ActiveX控件总结(2008年06月18日 11:39)
上一篇 | 下一篇 | 返回日志列表
共 0篇评论,第 1页/共 0页
 发表评论 第一页 上一页 下一页 最后页

共 0篇评论,第 1页/共 0页
第一页 上一页 下一页 最后页
发表评论
日志新版升级特性介绍    请选择道具  请选择道具 隐身草 彩虹炫 天使之爱
点击这里发表评论
提交取消 copyright ? 1998 - 2009 Tencent Inc. all rights reserved 腾讯公司 版权所有
loading......[登 录]|此空间的日 志|▼|播放音乐精简模式|| ▼搜索▼推荐|▼帮助▼| 赢精美钻戒,将感动送给最爱的人。

 


//////////////http://cache.baidu.com/c?m=9f65cb4a8c8507ed4fece76310508a24420597634b86914323c3933fcf331d5c017be3b925251203d0cf616403b24f5ee9f73374311420c0c18ed714c9fecf6879877867294bd71242c419de971b63d620e10bb4f05ba7edb173&p=c965cb16d9c616ff57ee886656&user=baidu

////////////////http://topic.csdn.net/t/20050518/10/4015744.html

How   to   deploy   a   .Net   assmebly   for   COM   use   through   CAB   on   Web   Page  
   
  To   create   a   .Net   assembly   which   will   be   used   by   COM   clients:  
   
  1.   Create   a   VB.Net   Class   Library   named   “ClassLibraryVBActiveX”.   Use   the   following   code   for   the   project:  
   
  Imports   System.Runtime.InteropServices  
  <GuidAttribute("BC2E2273-E3D8-4AEA-8A4F-799574803D89"),   ProgIdAttribute("ClassLibraryVBActiveX.Class1")>   _  
  Public   Class   Class1  
          Public   Function   Hello()   As   String  
                  Return   "Hello   World!"  
          End   Function  
  End   Class  
   
  Please   keep   a   note   of   the   GUID.   We   will   use   it   later.  
   
  2.   Right   click   the   class   library   project   in   the   Solution   Explorer   and   select   “Properties”.   This   will   open   the   Property   Pages   of   the   class   library   project.   Under   the   category   “Configuration   Properties”   |   “Build”,   check   the   check   box   “Register   for   COM   Interop”.  
   
  3.   Build   the   class   library   project.  
   
  To   create   a   Setup   project   for   the   class   library:  
   
  4.   Right-click   the   solution   in   the   Solution   Explorer   and   select   “Add”   |   “New   Project”.   Select   “Setup   Project”   and   name   it   as   “ActiveXInstaller”.  
   
  5.   Add   the   “Primary   output”   of   the   class   library   to   the   Setup   project.  
   
  6.   Build   the   Setup   project.   We   should   see   that   “ClassLibraryVBActiveX.dll”   and   “ClassLibraryVBActiveX.tlb”   have   been   built   into   the   Setup   project.  
   
  To   build   the   CAB   file   for   the   Setup   project:  
   
  7.   Extract   the   ZIP   attached   and   save   the   files   to   a   temporary   folder.  
   
    <Attachment   is  
not   available>  
   
  We   have   the   following   5   files:  
   
 
makecab.exe   –   The   utility   for   building   CABs.   The   utility   can   typically   be   found   in   “System32”.  
   
  Installer.inf   –   The   Inf   file   for   the   CAB   file.   It   has   the   following   contents:  
   
  [Setup   Hooks]  
  hook1=hook1  
   
  [hook1]  
  run=   msiexec   /i   %EXTRACT_DIR%/ActiveXInstaller.msi   /qn  
   
  [Version]  
  ;   This   section   is   required   for   compatibility   on   both   Windows   95   and   Windows   NT.  
  Signature="$CHICAGO$"  
  AdvancedInf=2.0  
   
  Here   “run”   specifies   the   command   we   would   like   to   run   after   IE   extracts   the   CAB.   The   command   line   will   install   the   MSI   “ActiveXInstaller.msi”   under   silent   mode.   You   may   refer   to   the   following   links   for   more   details   about   the   format   of   INF:  
   
  About   INF   File   Architecture  
  http://msdn.microsoft.com/library/default.asp?url=/workshop/delivery/download/overview/infarchitecture.asp?frame=true  
   
  Cab.DDF   –   a   text   file   with   the   following   contents:  
   
  .OPTION   EXPLICIT  
  .Set   Cabinet=on  
  .Set  
Compress=on  
  .Set   MaxDiskSize=CDROM  
  .Set   ReservePerCabinetSize=6144  
  .Set   DiskDirectoryTemplate="."  
  .Set   CompressionType=MSZIP  
  .Set   CompressionLevel=7  
  .Set   CompressionMemory=21  
  .Set   CabinetNameTemplate="ActiveX.CAB"  
  "Installer.inf"  
  "ActiveXInstaller.msi"  
   
  This   file   is   a   directive   file   for   the   “MakeCAB.exe”   utility.   “ActiveX.CAB”   is   the   output   name   of   the   CAB.   The   last   two   lines   indicate   the   two   files   we   would   like   to   include   into   the   CAB.  
   
  Make.bat   –   a   batch   file   that   will   run   the   following   command   to   build   the   CAB:  
   
  MAKECAB.EXE   /f   "Cab.DDF"  
   
  TestPage.htm   –   a   template   HTML   that   will   install   the   CAB:  
   
  <HTML>  
  <BODY>  
  <OBJECT   ID="ClassLibraryVBActiveX"  
  CLASSID="CLSID:BC2E2273-E3D8-4AEA-8A4F-799574803D89"  
  CODEBASE="ActiveX.CAB#version=1,0,0,0">  
  </OBJECT>  
  </BODY>  
  </HTML>  
   
  Note   that   the   GUID   should   match   the   GUID   in   our   VB.Net   code.  
   
  8.   To   use   these   files,   please   copy   output   MSI   of   the   Setup   project   (e.g.   “ActiveXInstaller.msi”)   to   the   same   folder   as   the   files   above.   Then   double-click   “Make.bat”   to   build   the   CAB.  
   
  9.   Copy   the   CAB   as   well   as   “TestPage.htm”   to   a   web   folder   and   test   it.  
   
  Note   that   this   approach   also   provides   a   way   for   the   end   user   to   uninstall   the   assembly.   We   can   remove   it   by   “Add/Remove   Programs”   applet.

 

原创粉丝点击