CAB Wizard can create multiple .cab files with a single setup .inf file and multiple application binaries. This is useful for creating multiple .cab files, each one for a specific processor type. To indicate information for a specific processor, append an extension describing the processor, known as a processor tag, to these section names: CEDevice, DefaultInstall, SourceDisksNames, and SourceDisksFiles. For example:
[DefaultInstall] ;shared by all platforms, processed first
[DefaultInstall.sh3] ;specific to the SH3 chip
[DefaultInstall.mips] ;specific to the MIPS chip
Information in sections without an extension is valid, unless it is specifically overridden by information in a section with an extension. The exception to this is the UnsupportedPlatforms key in the CEDevice section, described later.
Version
[Version]
Signature = "signature-name"
Provider = "INF-creator"
CESignature = "$Windows CE$"
Provider = "Microsoft"
CEStrings
This is a section specific to Windows CE that specifies string substitutions for the application name and the default install directory.
[CEStrings]
AppName = app-name
InstallDir = default-install-dir
For example, to have AppName mean "Game Pack," and to have InstallDir mean %CE1%\%AppName%, use this code:
[CEStrings]
AppName="Game Pack"
InstallDir=%CE1%\%AppName%
Strings
[Strings]
string-key = value
[string-key = value]
CEDevice
[CEDevice]
[ProcessorType =[processor-type]]
[UnsupportedPlatforms = platform-family-name[,platform-family-name]]
[VersionMin = [major-version.minor-version]]
[VersionMax = [major-version.minor-version]]
[BuildMin = [build-number]]
[BuildMax = [build-number]]
All keys are optional. If a key is non-existent, no checking is performed. If a key exists but there is no data, then no checking is performed. The exception is UnsupportedPlatforms; if this key exists but there is no data, the previous value is not overridden.
[CEDevice]
UnsupportedPlatforms = pltfrm1 ; pltfrm1 is unsupported
[CEDevice.SH3]
UnsupportedPlatforms = ; pltfrm1 is still unsupported
The following code example shows three CEDevice sections, one that gives basic information for any \cpu and two that are specific to the SH3 and the MIPS processor chips.
[CEDevice] ; a "template" for all platforms
UnsupportedPlatforms = pltfrm1 ; does not support pltfrm1
; the following specifies version 1.0 devices only
VersionMin = 1.0
VersionMax = 1.0
[CEDevice.SH3] ; inherits all [CEDevice] settings
; this will create a CAB file specific for "SH3" devices
ProcessorType = 10003 ; the SH3 CAB file is only valid for the SH3 processors
UnsupportedPlatforms = ; pltfrm1 is still unsupported
; the following overrides the version settings so that no version checking is performed
VersionMin =
VersionMax =
[CEDevice.MIPS] ; inherits all [CEDevice] settings
; this will create a CAB file specific for "MIPS" devices
ProcessorType = 4000 ; the "MIPS" CAB file is only valid for the MIPS processor
UnsupportedPlatforms =pltfrm2 ; pltfrm1 and pltfrm2 are unsupported for the "MIPS" CAB file
Note To create the two CPU-specific .cab files for the setup .inf file in the previous example, CAB Wizard must be run with the parameter /cpu sh3 mips.
DefaultInstall
[DefaultInstall]
Copyfiles=copyfile-list-section[,copyfile-list-section]
AddReg=add-registry-section[,add-registry-section]
[CEShortcuts=shortcut-list-section[,shortcut-list-section]] ; new key
[CESetupDLL=setup-DLL] ; new key
[CESelfRegister=self-reg-DLL-filename[,self-reg-DLL-filename] ; new key
During installation, if installation on the device fails to call the file's exported DllRegisterServer function, then the file's exported DllUnregisterServer function will not be called during uninstallation.
SourceDisksNames
[SourceDisksNames]
disk-ordinal= ,disk-label,,path
[disk-ordinal= ,disk-label,,path]
SourceDisksFiles
[SourceDisksFiles]
filename=disk_number[,subdir]
[filename=disk_number[,subdir]]
DestinationDirs
[DestinationDirs]
file-list-section = 0,subdir
[file-list-section = 0,subdir]
[DefaultDestDir=0,subdir]
Note Windows CE does not support directory identifiers (DirID).
String | Replacement value |
---|---|
%CE1% | \Program Files |
%CE2% | \Windows |
%CE3% | \Windows\Desktop |
%CE4% | \Windows\Startup |
%CE5% | \My Documents |
%CE6% | \Program Files\Accessories |
%CE7% | \Program Files\Communication |
%CE8% | \Program Files\Games |
%CE9% | \Program Files\Pocket Outlook |
%CE10% | \Program Files\Office |
%CE11% | \Windows\Programs |
%CE12% | \Windows\Programs\Accessories |
%CE13% | \Windows\Programs\Communications |
%CE14% | \Windows\Programs\Games |
%CE15% | \Windows\Fonts |
%CE16% | \Windows\Recent |
%CE17% | \Windows\Favorites |
For example:
[DestinationDirs]
Files.Common = 0,%CE1%\My Subdir ;\Program Files\My Subdir
Files.Shared = 0,%CE2% ;\Windows
CopyFiles
[copyfile-list-section]
destination-file-name,[source-file-name],[,flags]
[destination-file-name,[source-file-name],[,flags]]
Source-file-name is optional if it is the same as destination-file-name.
Flag | Value | Description |
---|---|---|
COPYFLG_WARN_IF_SKIP | 0x00000001 | Warn user if attempt is made to skip a file after an error has occurred. |
COPYFLG_NOSKIP | 0x00000002 | Do not allow user to skip copying a file. |
COPYFLG_NO_OVERWRITE | 0x00000010 | Do not overwrite an existing file in the destination directory. |
COPYFLG_REPLACEONLY | 0x00000400 | Copy source file to the destination directory only if the file is already in the destination directory. |
CE_COPYFLG_NO_DATE_DIALOG | 0x20000000 | Do not copy if target is newer. |
CE_COPYFLG_NODATECHECK | 0x40000000 | Ignore date while overwriting the target file. |
CE_COPYFLG_SHARED | 0x80000000 | Reference when a shared DLL is counted. |
AddReg
[add-registry-section]
registry-root-string , subkey,[value-name], flags, value[,value]
[registry-root-string, subkey,[value-name], flags, value[,value]]
Root string | Description |
---|---|
HKCR | Same as HKEY_CLASSES_ROOT |
HKCU | Same as HKEY_CURRENT_USER |
HKLM | Same as HKEY_LOCAL_MACHINE |
Flag | Value | Description |
---|---|---|
FLG_ADDREG_NOCLOBBER | 0x00000002 | If the registry key exists, do not overwrite it. This flag can be used in combination with any of the flags later in this table. |
FLG_ADDREG_TYPE_SZ | 0x00000000 | Registry data type REG_SZ. |
FLG_ADDREG_TYPE_MULTI_SZ | 0x00010000 | Registry data type REG_MULTI_SZ. The value field that follows can be a list of strings separated by commas. |
FLG_ADDREG_TYPE_BINARY | 0x00000001 | Registry data type REG_BINARY. The value field that follows must be a list of numeric values separated by commas, one byte per field, and must not use the 0x hex prefix. |
FLG_ADDREG_TYPE_DWORD | 0x00010001 | Data type REG_DWORD. Only the noncompatible format in the Win32 Setup .inf documentation is supported. |
The following code example shows how the AddReg section is used.
[RegSection]
; the following uses (FLG_ADDREG_TYPE_MULTI_SZ | FLG_ADDREG_NOCLOBBER) to create a multi-string with the "noclobber" flag
HKLM,Software\Microsoft\Games,Title,0x00010002, "Game","Pack"
; the following uses FLG_ADDREG_TPE_BINARY to create an 8-byte binary registry value
HKLM,Software\Microsoft\Games,Data,0x00000001,2,F,B,3,0,A,6,D
; the following uses (FLG_ADDREG_TYPE_DWORD | FLG_ADDREG_NOCLOBBER) to create a dword with the "no clobber" flag
HKLM,Software\Microsoft\Games,HighScore,0x00010003,456
CEShortcuts
This is a Windows CE-specific section.
[shortcut-list-section]
shortcut-file-name,shortcut-type-flag,target-file/path[,standard-destination-path]
[shortcut-file-name,shortcut-type-flag,target-file/path[,standard-destination-path]]
The following code example shows how the CEShortcuts section is used.
[DestinationDirs]
file_list = 0%CE2%
Links = 0%CE3%
DefaultDestDir = 0%InstallDir%
[file_list]
"my final app.exe",app.exe,,0
[Links]
; shortcut name is "file 1"
; this is a shortcut to a file; the target is "my final app.exe"
; shortcut is created in the folder used in "[DestinationDirs] Links" section, which is currently %CE3%
"file 1",0,"my final app.exe"
;shortcut name is "file2"
;this is a shortcut to a file; the target is "my final app.exe"
;shortcut is created in the %InstallDir% folder
"file 2",0,"my final app.exe",%InstallDir%
;shortcut name is "path 1"
;this is a shortcut to a folder
;the shortcut target is the folder used in "[DestinationDirs] DefaultDestDir" section, which is currently %InstallDir%
;shortcut is created in the folder used in "[DestinationDirs] Links" section which is currently %CE3%
"path 1",1,DefaultDestDir
;shortcut name is "path 2"
;this is a shortcut to a folder
;the target is the folder used in "[DestinationDirs] Links" section which is currently %CE3%
;shortcut is created in the %InstallDir% folder
"path 2",1,Links,%InstallDir%