Jump to content
Sign in to follow this  
ricktendo

[Tutorial] INF Part-5 "ProfileItems"

Recommended Posts

ProfileItems

ProfileItems=profile-items-section[,profile-items-section-2]...

This directive references one or more INF-writer-defined sections that describe

items to be added to, or removed from, the Start menu.

[profile-items-section]

Name=link-name[,flags]

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)

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 wddirid 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 on indexing the icons in a DLL, see the Platform 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 Platform SDK documentation for more information on 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, the Infotip value can also be specified as "@ResDllPath\ResDll,-ResID", where ResDllPath and ResDll specify the path and filename 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 = "@%\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 filename of a resource DLL, and resID is a positive value representing a resource ID.

An example is:

DisplayResource="%\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.

ProfileItems Flags

0x00000001 Create menu item in Current User flag

0x00000002 Delete menu item flag

0x00000004 Create Start menu group under All Users\Start\Programs

0x00000005 Create Start menu group under Current User\Start\Programs

0x00000006 Delete Start menu group under All Users\Start\Programs

0x00000007 Delete Start menu group under Current User\Start\Programs

More Exotic ProfileItems (Non Standard)

Part-4

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...