Windows Driver Kit: Device Installation
INF ProfileItems Directive
[DDInstall] ProfileItems=profile-items-section[,
profile-items-section]...
...
A ProfileItems directive is used in an INF DDInstall section to list one or more profile-items-sections that contain items or groups to be added to, or removed from, the Start menu.
This directive is only supported in Windows XP and later versions of Windows.
Comments
A given profile-items-section name must be unique to the INF file.
Each INF-writer-defined section name must be unique within the INF file and must follow the general rules for defining section names described in General Syntax Rules for INF Files.
Each named section referenced by a ProfileItems directive has the following form:
[profile-items-section]
Name=link-name[,name-attributes]
CmdLine=dirid,[subdir],filename
[SubDir=path]
[WorkingDir=wd-dirid,wd-subdir]
[IconPath=icon-dirid,[icon-subdir],icon-filename]
[IconIndex=index-value]
[HotKey=hotkey-value]
[Infotip=info-tip]
[DisplayResource="ResDllPath\ResDll",ResID] (Windows XP and later versions of Windows)
Each profile-items-section contains detailed information for creating or removing one Start menu item or group. To manipulate more than one menu item or group from an INF, create more than one profile-items-section and list the sections in the ProfileItems directive.
Any of the string parameters specified in the profile-items-section entries can be specified using a %strkey% token, as described in General Syntax Rules for INF Files.
ProfileItems-Referenced Section Entries and Values
- Name=link-name[,name-attributes]
- The link-name specifies the name of the link for the menu item or group, without the .lnk extension. This value can be a string or a %strkey% token that is defined in a Strings section of the INF file. If DisplayResource is not specified, link-name is also the display string.
The optional name-attributes value specifies one or more flags that affect the operation on the menu item. This value is expressed as an ORed bitmask of system-defined flag values. Possible flags include the following:
- 0x00000001 (FLG_PROFITEM_CURRENTUSER)
- Directs Setup to create or delete a Start menu item in the current user's profile. If this flag is not specified, Setup processes the item for all users.
- 0x00000002 (FLG_PROFITEM_DELETE)
- Directs Setup to delete the menu item. If this flag is not specified, the item is created.
- 0x00000004 (FLG_PROFITEM_GROUP)
- Directs Setup to create or delete a Start menu group under Start\Programs. If this flag is not specified, Setup creates or deletes a menu item, not a menu group.
If no flag is specified, Setup creates a menu item for all users.
- CmdLine=dirid,[subdir],filename
- The dirid specifies a value that identifies the directory in which the command program resides. For example, a dirid of 11 indicates the system directory. The possible dirid values are listed in the description of the dirid value in the DestinationDirs section.
If a subdir string is present, the command program is in a subdirectory of the directory referenced by dirid. The subdir specifies the subdirectory. If no subdir is specified, the program resides in the directory referenced by dirid.
The filename specifies the name of the program associated with the menu item.
- SubDir=path
- This optional entry specifies a subdirectory (submenu) under Start\Programs in which the menu item resides. If this entry is omitted, the path defaults to Start\Programs.
For example, if the profile-items-section has the entry "Subdir=Accessories\Games", then the menu item is being created or deleted in the Start\Programs\Accessories\Games submenu.
If FLG_PROFITEM_GROUP is specified for name-attributes, SubDir is ignored.
- WorkingDir=wd-dirid[,wd-subdir]
- This optional entry specifies a working directory for the command program. If this entry is omitted, the working directory defaults to the directory in which the command program resides.
The wd-dirid value identifies the working directory. For lists of possible dirid values, see Using Dirids.
The wd-subdir string, if present, specifies a subdirectory of wd-dirid to be the working directory. Use this parameter to specify a directory that doesn't have a system-defined dirid. If this parameter is omitted, the wd-dirid value alone specifies the working directory.
- IconPath=icon-dirid,[icon-subdir],icon-filename
- This optional entry specifies the location of a file that contains an icon for the menu item.
The icon-dirid string identifies the directory for the DLL that contains the icon. For lists of possible dirid values, see Using Dirids.
The icon-subdir value, if present, indicates that the DLL is in a subdirectory of icon-dirid. The icon-subdir value specifies the subdirectory.
The icon-filename value specifies the DLL that contains the icon.
If this entry is omitted, Setup looks for an icon in the file specified in the CmdLine entry.
- IconIndex=index-value
- This optional entry specifies which icon in a DLL to use for the menu item. For information about indexing the icons in a DLL, see the Microsoft Windows SDK documentation.
If an IconPath entry is specified, the index-value indexes into that DLL. Otherwise, this value indexes into the file specified in the CmdLine entry.
- HotKey=hotkey-value
- This optional entry specifies a keyboard accelerator for the menu item. See the Windows SDK documentation for more information about hot keys.
- Infotip=info-tip
- This optional entry specifies an informational tip for the menu item.
This value can be a string or a %strkey% token that is defined in a Strings section of the INF file.
For Windows XP and later versions of Windows, the Infotip value can also be specified as "@ResDllPath\ResDll,-ResID", where ResDllPath and ResDll specify the path and file name of a resource DLL, and -resID is a negative value representing a resource ID. Use this format to support Windows Multilanguage User Interface (MUI). An example is:
InfoTip = "@%11%\shell32.dll,-22531"
- DisplayResource="ResDllPath\ResDll",ResID
- (Windows XP and later.) This optional entry specifies a string resource that identifies a localizable string, to be used in the Start menu as the display name for shortcut or group. ResDllPath and ResDll specify the path and file name of a resource DLL, and resID is a positive value representing a resource ID. An example is:
DisplayResource="%11%\shell32.dll",22019
Use this entry to support Windows Multilanguage User Interface (MUI). If this entry is not used, the string specified by the Name entry is displayed.
Examples
The following INF file excerpt illustrates how to use
profile-items-sections to add Calculator to the Start Menu.
[CalcInstallItems]
Name = %Calc_DESC%
CmdLine = 11,, calc.exe
SubDir = %Access_GROUP%
WorkingDir = 11
InfoTip = %Calc_TIP%
:
:
[Strings]
AccessGroup = "Accessories"
Calc_DESC = "Calculator"
Calc_TIP = "Performs basic arithmetic tasks with an on-screen calculator"
The following INF file excerpt illustrates how to install the same software using the DisplayResource entry to create localized menu items.
[CalcInstallItems]
Name = %Calc_DESC%
CmdLine = 11,, calc.exe
SubDir = %Access_GROUP%
WorkingDir = 11
InfoTip = "@%11%\shell32.dll,-22531"
DisplayResource="%11%\shell32.dll",22019
:
:
[Strings]
Access_GROUP = "Accessories"
Calc_DESC = "Calculator"
See Also
DDInstall