[Tutorial] Exotic INF ProfileItems/Shortcuts Updated 7-30-07

Discuss & post Update Pack addons here.
Post Reply
User avatar
Posts: 3213
Joined: Mon May 22, 2006 12:27 am
Location: Honduras

[Tutorial] Exotic INF ProfileItems/Shortcuts Updated 7-30-07

Post by ricktendo64 » Sat Jul 21, 2007 3:34 am

Everybody knows how to use ProfileItems to add/del shortcuts for your programs. And everybody knows the basic flags (so I will skip this part)
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
Here is some exotic stuff you NEED and do NOT NEED to know about ProfileItems, including some new tips on how to add special types of shortcuts that do NOT go in the standard places like the All Programs group in your Start Menu.

QuickLaunch Shortcut Example

Code: Select all

ProfileItems = Sidebar.QuickLaunch.AddShortcut

Name       = %SIDEBAR%,8,26
CmdLine    = 16422,%SIDEBAR%,sidebar.exe
SubDir     = %QUICK%
WorkingDir = 16422,%SIDEBAR%
InfoTip    = "@%%ProgramFiles%%\%SIDEBAR%\sidebar.exe,-1012"
DisplayResource = "%%ProgramFiles%%\%SIDEBAR%\sidebar.exe",1000

SIDEBAR = "Windows Sidebar"
QUICK   = "Microsoft\Internet Explorer\Quick Launch"
SendTo Shortcut Example
This is a double wammy, in addition of showing you how to add a shortcut to SendTo folder it shows how its possible to use ProfileItmes to make shortcuts to CMD and other files that were not possible before.

Code: Select all

ProfileItems = Reg2Inf.SendTo.AddShortcut

Name       = Reg2Inf,8,9
CmdLine    = 11,,Reg2InfHandler.cmd
WorkingDir = 11
IconPath   = 11,,shell32.dll
IconIndex  = 71 ;<- Include this for DLL/EXE files with multipple icons
The secret of making links to files that cant normally be done using ProfileItems is IconPath and IconIndex, I point the CMD shortcut to the shell32.dll icon for CMD files but you can use any custom path to any icon. I prefer to point n7Epilson's Reg2Inf shortcut to regedit.exe like so

Code: Select all

IconPath = 10,,regedit.exe ;<-You dont need a IconIndex for this, IconPath uses the first executable/library icon by default.
How to add custom bookmark links for IE
You can also Delete Bookmarks... More info bellow

Code: Select all

ProfileItems = RyanVM.AddBookmark

Name       = RyanVM's MSFN Files Page,8,6
URL        = "http://www.ryanvm.net/msfn/"
IconPath   = 16422,%IE%,IEXPLORE.EXE
IconIndex  = 1

IE = "Internet Explorer"
Desktop & Folder Shortcut Example
Another double wammy, the following shows how to create a link to a Folder (%WinDir% or WINDOWS) in addition to creating it in %AllUsersProfile%\Desktop

Code: Select all

ProfileItems = Desktop.WinDir.AddShortcut

Name       = WINDOWS,8,25
CmdLine    = 10,, ;<- Will NOT work without subdir commas
WorkingDir = 0 ;<- Very Important you use Zero
IconPath   = 11,,shell32.dll
IconIndex  = 3 ;<- Folder icon number in shell32.dll

Here are some of the special flags (more to come) you can use for all sorts of cool things (I have more flags but I wont post them because they lead to the Fonts and other useless directories)
Not all of them work during Windows Setup
0x00000008,2 = %UserProfile%\Start Menu\Programs
0x00000008,5 = %UserProfile%\My Documents
0x00000008,6 = %UserProfile%\Favorites <- Perfect for adding custom IE Bookmarks
0x00000008,7 = %UserProfile%\Start Menu\Programs\Startup
0x00000008,8 = %UserProfile%\Recent
0x00000008,9 = %UserProfile%\SendTo
0x00000008,11 = %UserProfile%\Start Menu
0x00000008,13 = %UsersProfile%\My Documents\My Music
0x00000008,14 = %UsersProfile%\My Documents\My Videos
0x00000008,16 = %UsersProfile%\Desktop
0x00000008,19 = %UsersProfile%\NetHood
0x00000008,20 = %WinDir%\Fonts
0x00000008,21 = %UserProfile%\Templates
0x00000008,22 = %AllUsersProfile%\Start Menu
0x00000008,23 = %AllUsersProfile%\Start Menu\Programs
0x00000008,24 = %AllUsersProfile%\Start Menu\Programs\Startup
0x00000008,25 = %AllUsersProfile%\Desktop
0x00000008,26 = %UserProfile%\Application Data <- Perfect for QuickLauch
0x00000008,27 = %UserProfile%\PrintHood
0x00000008,28 = %UserProfile%\Local Settings\Application Data
0x00000008,31 = %AllUsersProfile%\Favorites <- More IE Bookmarks
0x00000008,32 = %UserProfile%\Local Settings\Temporary Internet Files
0x00000008,33 = %UserProfile%\Local Settings\Cookies
0x00000008,34 = %UserProfile%\Local Settings\History
0x00000008,35 = %AllUsersProfile%\Application Data
0x00000008,36 = %WinDir%
0x00000008,37 = %WinDir%\system32
0x00000008,38 = %ProgramFiles%
0x00000008,39 = %UserProfile%\My Documents\My Pictures
0x00000008,40 = %UserProfile%
0x00000008,41 = %WinDir%\system32
0x00000008,43 = %CommonProgramFiles%
0x00000008,45 = %AllUsersProfile%\Templates
0x00000008,46 = %AllUsersProfile%\Documents
0x00000008,47 = %AllUsersProfile%\Start Menu\Programs\Administrative Tools
0x00000008,48 = %UserProfile%\Start Menu\Programs\Administrative Tools
0x00000008,53 = %AllUsersProfile%\Documents\My Music
0x00000008,54 = %AllUsersProfile%\Documents\My Pictures
0x00000008,55 = %AllUsersProfile%\Documents\My Videos
0x00000008,56 = %ResourceDir%
0x00000008,57 = %ResourceDir%\0409
0x00000008,59 = %UserProfile%\Local Settings\Application Data\Microsoft\CD Burning
In order to DELETE any of the same links as above using ProfileItems in your INF Uninstall, use the 0x0000000A,XX flag followed by the special number. Use the same one you used to add the link in the first place (just edit "XX").

Example: The following deletes "Windows Update.LNK" from %AllUsersProfile%\Start Menu

Code: Select all

ProfileItems = MU.DelShortcut

Name=Windows Update,0x0000000A,22
Updated/Revised ProfileItems flags July 30 2007 :P
Last edited by ricktendo64 on Thu Aug 09, 2007 5:57 pm, edited 10 times in total.

User avatar
Posts: 3213
Joined: Mon May 22, 2006 12:27 am
Location: Honduras

Post by ricktendo64 » Sat Jul 21, 2007 1:10 pm

Updated... Added more special flags and added how to create links using ProfileItems to Folders/Directories

Mitsuko Aninikkou
Posts: 210
Joined: Tue Dec 13, 2005 12:52 pm
Location: The Netherlands (But running US WinXP, in case it comes up)

Post by Mitsuko Aninikkou » Sat Jul 21, 2007 5:49 pm

Cool guide, thanks for taking the time to give all those examples :) By the way 0xA or 10 should work just as well as 0x0000000A. I wouldn't mind a list of all the flags you know of, for ease of reference; if you're worried about cluttering up your post how about linking to a text file that contains all of them (I already have several text files like this on environment variables and inf environment variables, they're pretty useful)

User avatar
Posts: 3213
Joined: Mon May 22, 2006 12:27 am
Location: Honduras

Post by ricktendo64 » Mon Jul 30, 2007 12:11 pm

Updated and Revised ProfileItems file flags, see first post.

Off Topic: Check this out guys, do you see any pattern between my ProfileItems flags and Gosh's "Shell Special Folder"?
OSR Guides For Making INF Files.pdf wrote:16384 %userprofile%\Desktop
16386 %userprofile%\Start Menu\Programs
16389 %userprofile%\My Documents
16390 %userprofile%\Favorites
16391 %userprofile%\Start Menu\Programs\Startup
16392 %userprofile%\Recent
16393 %userprofile%\SendTo
16395 %userprofile%\Start Menu
16397 %userprofile%\My Documents\My Music
16398 %userprofile%\My Documents\My Videos
16400 %userprofile%\Desktop
16403 %userprofile%\NetHood
16404 C:\WINDOWS\Fonts
16405 %userprofile%\Templates
16406 %allusersprofile%\Start Menu
16407 %allusersprofile%\Start Menu\Programs
16408 %allusersprofile%\Start Menu\Programs\Startup
16409 %allusersprofile%\Desktop
16410 %userprofile%\Application Data
16411 %userprofile%\PrintHood
16412 %userprofile%\Local Settings\Application Data
16415 %allusersprofile%\Favorites
16416 %userprofile%\Local Settings\Temporary Internet Files
16417 %userprofile%\Cookies
16418 %userprofile%\Local Settings\History
16419 %allusersprofile%\Application Data
16420 System Root (C:\WINDOWS)
16421 C:\WINDOWS\System32
16422 Program Files
16423 %userprofile%\My Documents\My Pictures
16424 %userprofile%
16425 C:\WINDOWS\System32
16427 C:\Program Files\Common Files
16429 %allusersprofile%\Templates
16430 %allusersprofile%\Documents
16431 %allusersprofile%\Start Menu\Programs\Administrative Tools
16432 %userprofile%\Start Menu\Programs\Administrative Tools
16437 %allusersprofile%\Documents\My Music
16438 %allusersprofile%\Documents\My Pictures
16439 %allusersprofile%\Documents\My Videos
16440 C:\WINDOWS\resources
16441 C:\WINDOWS\resources\0409
16443 %userprofile%\Local Settings\Application Data\Microsoft\CD Burning
Somehow they both are related :P

Post Reply