.inf File

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$"
signature-name
Must be "$Windows NT$" or "$Windows 95$."
INF-creator
The company name of the application. For example:
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    
app-name
Name of the application. Other instances of %AppName% in the .inf file will be replaced with this string value.
default-install-dir
Default installation directory on the device. Other instances of %InstallDir% in the .inf file will be replaced with this string value.

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.

processor-type
Value returned by SYSTEMINFO.dwProcessorType. For example, the value for the SH3 CPU is 10003 and the MIPS CPU is 4000.
platform-family-name
List of platform family names known to be unsupported. If the name specified in [CEDevice.xxx] is different from that in [CEDevice], both platform family name values are unsupported for processor "xxx." That is, the list of specific unsupported platform family names is appended to the previous list of unsupported platform family names. Application Manager will not display the application for an unsupported platform. Also, the user will be warned during setup if the .cab file is copied to an unsupported device. For example:
[CEDevice]
UnsupportedPlatforms = pltfrm1      ; pltfrm1 is unsupported
[CEDevice.SH3]
UnsupportedPlatforms =              ; pltfrm1 is still unsupported
minor-version or major-version
Numeric value returned by OSVERSIONINFO.dwVersionMinor and OSVERSIONINFO.dwVersionMajor. The .cab file is valid for the currently connected device, if the version of the currently connected device is less than or equal to VersionMax and also greater than or equal to VersionMin.
build-number
Numeric value returned by OSVERSIONINFO.dwBuildNumber. The .cab file is valid for the currently connected device, if the version of the currently connected device is less than or equal to BuildMax and also greater than or equal to BuildMin.

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
shortcut-list-section
String that identifies one more section that defines shortcuts to a file; see the CEShortcuts description later in this section.
setup-DLL
Optimal string that specifies a Setup.dll. It is written by the ISV and contains customized functions for operations during installation and removal of the application.The file must be specified in the [SourceDisksFiles] section. For more information, see the associated description later in this section.
self-reg-DLL-filename
String that identifies files that self-register, exporting the COM functions DllRegisterServer and DllUnregisterServer. You must specify the files in the SourceDiskFiles section.

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).

Subdir
String that identifies the destination directory. String substitutions supported by Windows CE are described in the following table. These can only be used for the beginning of the path.
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.

Flags
Numeric value that specifies an action to be done while copying files. Values supported by Windows CE are described in the following table.
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]]
registry-root-strings
String that specifies the registry root location. Values supported by Windows CE are described in the following table.
Root string Description
HKCR Same as HKEY_CLASSES_ROOT
HKCU Same as HKEY_CURRENT_USER
HKLM Same as HKEY_LOCAL_MACHINE

value-name
Registry value name. If empty, the registry value name "(default)" is used.
flags
Numeric value that specifies information about the registry key. Values supported by Window CE are described in the following table.
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]]
shortcut-file-name
String that identifies the shortcut name. It does not require the .lnk extension.
shortcut-type-flag
Numeric value. Zero or empty represents a shortcut to a file; any non-zero numeric value represents a shortcut to a folder.
target-file/path
String value that specifies the destination location. For a file, use the target file name, for example, MyApp.exe, that must be defined in a file copy list. For a path, use a file-list-section name defined in [DestinationDirs], for example, DefaultDestDir, or the %InstallDir% string.
standard-destination-path
Optional string value. A standard %CEx% path or %InstallDir%. If no value is specified, the shortcut-list-section name of the current section or the "DefaultDestDir" from the [DestinationDirs] section is used.

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%