Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi
Please guide to create CAB file for ActiveX components.
Posted
Updated 26-Aug-18 4:20am

First, as I have been rightly reminded, this is an old question and ActiveX isn't supported these days, however I hope my answer will still serve whoever need to create a .cab file and I know that even today, .cab files are used and required.

You need to use the MakeCab.exe which is part of any Windows system.

Cabinet Maker - Lossless Data Compression Tool

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). Refer to
                 Microsoft Cabinet SDK for information on directive_file.
  /D var=value   Defines variable with specified value.
  /L dir         Location to place destination (default is current directory).
  /V[n]          Verbosity level (1..3).


Using it is a bit tricky as you would expect to just add to the call the destination .cab name and the files / folder you wish to add. In fact, you need to create a file which is then given as the one and only parameter to the call to MakeCab.exe.
This file ends with .ddf.
You call:

C++
makecab /f script.ddf

A typical .ddf file will be like this:

;*** script.ddf example
;
.OPTION EXPLICIT     ; Generate errors
.Set CabinetFileCountThreshold=0
.Set FolderFileCountThreshold=0
.Set FolderSizeThreshold=0
.Set MaxCabinetSize=0
.Set MaxDiskFileCount=0
.Set MaxDiskSize=0
.Set CompressionType=MSZIP
.Set Cabinet=on
.Set Compress=on
;Specify file name for new cab file
.Set CabinetNameTemplate=script.cab
; Specify the subdirectory for the files.  
; Your cab file should not have files at the root level,
; and each driver package must be in a separate subfolder.
.Set DestinationDir=script
;Specify files to be included in cab file


Bellow, these lines, before you close and save this file, add each file you wish to be part of the .cab to be created.

Makecab will then create your installation "disk" (disk1) where you will find the .cab file.
 
Share this answer
 
v2
Comments
Dave Kreskowiak 26-Aug-18 10:42am    
First, this was asked over SEVEN YEARS AGO.

Second, ActiveX support in web browsers is dead.
Michael Haephrati 26-Aug-18 10:52am    
Dave, I usually don't check when a question has been raised because if it is not relevant, you should ask for it to be deleted. If the question is here, then there is a place to answer it even after 20 years. About ActiveX, you are right. However, my answer is (or could be) generic for people looking for ways to create a .cab file. Unfortunately, the need to create these old files (.cab) is still valid. Microsoft still requires it for setup.exe applications or drivers. So I was just trying to share my knowledge about the .cab files ignoring the outdated ActiveX mentioned in the question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900