ricktendo Posted October 14, 2007 Posted October 14, 2007 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 flag0x00000002 Delete menu item flag0x00000004 Create Start menu group under All Users\Start\Programs0x00000005 Create Start menu group under Current User\Start\Programs0x00000006 Delete Start menu group under All Users\Start\Programs0x00000007 Delete Start menu group under Current User\Start\ProgramsHere 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 ExampleProfileItems = Sidebar.QuickLaunch.AddShortcut[Sidebar.QuickLaunch.AddShortcut]Name = %SIDEBAR%,8,26CmdLine = 16422,%SIDEBAR%,sidebar.exeSubDir = %QUICK%WorkingDir = 16422,%SIDEBAR%InfoTip = "@%%ProgramFiles%%\%SIDEBAR%\sidebar.exe,-1012"DisplayResource = "%%ProgramFiles%%\%SIDEBAR%\sidebar.exe",1000[Strings]SIDEBAR = "Windows Sidebar"QUICK = "Microsoft\Internet Explorer\Quick Launch"SendTo Shortcut ExampleThis 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.ProfileItems = Reg2Inf.SendTo.AddShortcut[Reg2Inf.SendTo.AddShortcut]Name = Reg2Inf,8,9CmdLine = 11,,Reg2InfHandler.cmdWorkingDir = 11IconPath = 11,,shell32.dllIconIndex = 71;<- Include this for DLL/EXE files with multipple iconsThe 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 soIconPath = 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 IEYou can also Delete Bookmarks... More info bellowProfileItems = RyanVM.AddBookmark[RyanVM.AddBookmark]Name = RyanVM's MSFN Files Page,8,6URL = "http://www.ryanvm.net/msfn/"IconPath = 16422,%IE%,IEXPLORE.EXEIconIndex = 1[Strings]IE = "Internet Explorer"Desktop & Folder Shortcut ExampleAnother double wammy, the following shows how to create a link to a Folder (%WinDir% or WINDOWS) in addition to creating it in %AllUsersProfile%\DesktopProfileItems = Desktop.WinDir.AddShortcut[Desktop.WinDir.AddShortcut]Name = WINDOWS,8,25CmdLine = 10,,;<- Will NOT work without subdir commasWorkingDir = 0;<- Very Important you use ZeroIconPath = 11,,shell32.dllIconIndex = 3;<- Folder icon number in shell32.dllHere 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 Setup0x00000008,2 = %UserProfile%\Start Menu\Programs0x00000008,5 = %UserProfile%\My Documents0x00000008,6 = %UserProfile%\Favorites <- Perfect for adding custom IE Bookmarks0x00000008,7 = %UserProfile%\Start Menu\Programs\Startup0x00000008,8 = %UserProfile%\Recent0x00000008,9 = %UserProfile%\SendTo0x00000008,11 = %UserProfile%\Start Menu0x00000008,13 = %UserProfile%\My Documents\My Music0x00000008,14 = %UserProfile%\My Documents\My Videos0x00000008,16 = %UserProfile%\Desktop0x00000008,19 = %UserProfile%\NetHood0x00000008,20 = %WinDir%\Fonts0x00000008,21 = %UserProfile%\Templates0x00000008,22 = %AllUserProfile%\Start Menu0x00000008,23 = %AllUserProfile%\Start Menu\Programs0x00000008,24 = %AllUserProfile%\Start Menu\Programs\Startup0x00000008,25 = %AllUserProfile%\Desktop0x00000008,26 = %UserProfile%\Application Data <- Perfect for QuickLauch0x00000008,27 = %UserProfile%\PrintHood0x00000008,28 = %UserProfile%\Local Settings\Application Data0x00000008,31 = %AllUsersProfile%\Favorites <- More IE Bookmarks0x00000008,32 = %UserProfile%\Local Settings\Temporary Internet Files0x00000008,33 = %UserProfile%\Local Settings\Cookies0x00000008,34 = %UserProfile%\Local Settings\History0x00000008,35 = %AllUsersProfile%\Application Data0x00000008,36 = %WinDir%0x00000008,37 = %WinDir%\system320x00000008,38 = %ProgramFiles%0x00000008,39 = %UserProfile%\My Documents\My Pictures0x00000008,40 = %UserProfile%0x00000008,41 = %WinDir%\system320x00000008,43 = %CommonProgramFiles%0x00000008,45 = %AllUsersProfile%\Templates0x00000008,46 = %AllUsersProfile%\Documents0x00000008,47 = %AllUsersProfile%\Start Menu\Programs\Administrative Tools0x00000008,48 = %UserProfile%\Start Menu\Programs\Administrative Tools0x00000008,53 = %AllUsersProfile%\Documents\My Music0x00000008,54 = %AllUsersProfile%\Documents\My Pictures0x00000008,55 = %AllUsersProfile%\Documents\My Videos0x00000008,56 = %ResourceDir%0x00000008,57 = %ResourceDir%4090x00000008,59 = %UserProfile%\Local Settings\Application Data\Microsoft\CD BurningIn 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 MenuProfileItems = MU.DelShortcut[MU.DelShortcut]Name=Windows Update,0x0000000A,22 killswitch667 1 Quote
MrNxDmX Posted March 26, 2008 Posted March 26, 2008 Neat tut, thanks rick This helped me to create my sortcuts in current user directory. It doesnt seem so important, but some programs use that dir, and their uninstallers too. Quote
Preputium64 Posted April 5, 2008 Posted April 5, 2008 (edited) great job. But can I ask you a question for my nero addon shortcut? The orginal Nero ControlCenter shortcut target line is "C:\Program Files\Common Files\Nero\Nero Web\SetupX.exe" MODE="update" and i want prepare it for my addon shortcutThis is my code in nero.inf for Nero ControlCenter shortcut[Nero.Webcut]Name =Nero ControlCenterCmdLine =16427,"Nero\Nero Web",SetupX.exe MODE="update"SubDir ="Nero\Setup"WorkingDir=16422,"Nero\%PROG_NAME%"IconPath =16427,"Nero\Nero Web",nps.dllIconIndex =0InfoTip ="Update The Legendary Burner!"But when i install addon this shotcut target line is become to "C:\Program Files\Common Files\Nero\Nero Web\SetupX.exe" MODE=updateso it doesn't work. How i add invert commas("") in shortcut target line? Edited April 5, 2008 by Preputium64 Quote
ricktendo Posted April 5, 2008 Author Posted April 5, 2008 Responded to your PM also (its easy, you just quote the quotes )[Nero.Webcut]Name =Nero ControlCenterCmdLine =16427,"Nero\Nero Web",SetupX.exe MODE="""update"""SubDir ="Nero\Setup"WorkingDir=16422,"Nero\Nero Web"IconPath =16427,"Nero\Nero Web",nps.dll;IconIndex =0 ;<-Don't need this, IconPath will automatically use the 1st icon by defaultInfoTip ="Update The Legendary Burner!" Quote
Guest Posted June 27, 2008 Posted June 27, 2008 (edited) i`m having a problem in the cmd line the file name has a space in it and i cant fix it plz help. Edited June 27, 2008 by Dark_Knight Quote
ricktendo Posted June 27, 2008 Author Posted June 27, 2008 i`m having a problem in the cmd line the file name has a space in it and i cant fix it plz help.Yes I know, this is a problemPost your example Quote
Guest Posted June 27, 2008 Posted June 27, 2008 THIS IS MY INF [Version]Signature="$Windows NT$"[Optional Components]FOXIT[DefaultInstall]AddReg =FOXIT.AddRegCopyFiles =FOXIT.FILESProfileItems=Desketop.AddShortcut,Foxit.AddShortcut,Uninstall.AddShortcut[FOXIT]OptionDesc ="Foxit Pdf Reader"Tip ="Small PDF reader"Modes =0,1,2,3AddReg =FOXIT.AddRegCopyFiles =FOXIT.FILESrofileItems=Desketop.AddShortcut,Foxit.AddShortcut,Uninstall.AddShortcut[DestinationDirs]FOXIT.FILES=16422,%FX%[sourceDisksNames.x86]1="WinXp","Foxit.Cab",,I386[sourceDisksFiles]FoxitReader.exe=1Readme.txt=1Uninstall.exe=1[FOXIT.FILES]Foxit Reader.exe,FoxitReader.exeReadme.txtUninstall.exe[FOXIT.AddReg]HKCU,"Software\%FX%\FrameWnd","WindowPos",0x0,"2,3,-1,-1,-1,-1,22,29,982,583"HKCU,"Software\%FX%\MainFrame","AdvertiseIndex",0x0,"8"HKLM,"SOFTWARE\%FX%","isplugin",0x0,"0"HKLM,"SOFTWARE\%FX%","isreaderpro",0x0,"0"HKLM,"SOFTWARE\%FX%","InstallPath",0x0,"%16422%\%FX%\"HKLM,"SOFTWARE\%FX%","Version",0x0,"2.3.2008.2923"HKLM,"SOFTWARE\%FX%","IsForAllUser",0x0,"1"[Desketop.AddShortcut]Name ="Foxit Reader",8,25CmdLine =16422,%FX%,%SH%WorkingDir=-1[Foxit.AddShortcut]Name ="Foxit Reader"CmdLine =16422,%FX%,%SH%SubDir =%FX%WorkingDir=-1[uninstall.AddShortcut]Name =UninstallCmdLine =16422,%FX%,Uninstall.exeSubDir =%FX%WorkingDir=-1[strings]FX="Foxit Software\Foxit Reader"SH="Foxit Reader.exe" Quote
Guest Posted June 28, 2008 Posted June 28, 2008 it`s ok now i fixed it using this FOXITR~1.exe and it worked fineand thx Quote
ricktendo Posted June 28, 2008 Author Posted June 28, 2008 it`s ok now i fixed it using this FOXITR~1.exe and it worked fineand thxDude nice thinking BTW I was going to do it but it was using a totally difrent way of adding shortcuts, I was just about to post it Quote
Guest Posted June 28, 2008 Posted June 28, 2008 (edited) Dude nice thinking BTW I was going to do it but it was using a totally difrent way of adding shortcuts, I was just about to post itthx i remembered the dos and that ~1 thing for tall folders and filesso i did the same and entered the dos and tried it and it worked you should still post this new way i need to try it.it might be betterand thx Edited June 29, 2008 by Dark_Knight Quote
Kal Posted September 21, 2008 Posted September 21, 2008 Any special flag for %UserProfile%\Desktop (not %UsersProfile% neither %AllUsersProfile%) ? Quote
Ken@fri Posted September 30, 2008 Posted September 30, 2008 Hi Ricks !I'd like to create the shortcut below to uninstall my app (KO Approach). Does it work ?[uninstall.Startcut]Name =Uninstall KO Approach,0x00000008,23CmdLine ="rundll32.exe advpack.dll,LaunchINFSection %17%\Approach.inf,Uninstall.KOA <-- THIS COMMANDSubDir =KO ApproachWorkingDir=16422,KO ApproachIconPath =11,,shell32.dllIconIndex =110Thanks. Quote
Kelsenellenelvian Posted September 30, 2008 Posted September 30, 2008 [Uninstall.Startcut]Name =Uninstall KO Approach,0x00000008,23CmdLine ="rundll32.exe advpack.dll,LaunchINFSection Approach.inf,Uninstall.KOA"SubDir =KO ApproachIconPath =11,,shell32.dllIconIndex =110This should work fine for you like that. Quote
Ken@fri Posted September 30, 2008 Posted September 30, 2008 @KelsThanks for your quicks reply :thumbsup_anim: Quote
Ken@fri Posted October 3, 2008 Posted October 3, 2008 (edited) [Uninstall.Startcut]Name =Uninstall KO Approach,0x00000008,23CmdLine ="rundll32.exe advpack.dll,LaunchINFSection Approach.inf,Uninstall.KOA"SubDir =KO ApproachIconPath =11,,shell32.dllIconIndex =110This should work fine for you like that.[EDIT]@ KelsFailed. But lines below work fine :[Uninstall.Startcut]Name =Uninstall %KOSOFT%,0x00000008,23CmdLine =11,,rundll32.exe,"advpack.dll,LaunchINFSection Approach.inf,Uninstall.KOA"WorkingDir =11,,SubDir =%KOSOFT%IconPath =11,,shell32.dllIconIndex =110 Tried & found work fine too CmdLine =11,,rundll32.exe,"advpack.dll LaunchINFSection Approach.inf,Uninstall.KOA"CmdLine =11,,rundll32.exe,advpack.dll "LaunchINFSection Approach.inf,Uninstall.KOA"Thanx again for help. Edited October 3, 2008 by Ken@fri Quote
ricktendo Posted October 3, 2008 Author Posted October 3, 2008 This is the way to do itCmdLine =11,,"rundll32 advpack.dll LaunchINFSection Approach.inf,Uninstall.KOA" Quote
Ken@fri Posted October 4, 2008 Posted October 4, 2008 (edited) This is the way to do itCmdLine =11,,"rundll32 advpack.dll LaunchINFSection Approach.inf,Uninstall.KOA"Thanx, Ricks ( always too perfect, I see) :icon_cool: ! Edited October 4, 2008 by Ken@fri Quote
egorz Posted September 29, 2009 Posted September 29, 2009 Great job Ricks However i need to make a new task for the system scheduler from the inf file.What do U think 'bout? Quote
Cum zicea poetul Posted October 7, 2009 Posted October 7, 2009 Hi everyone, I signed up to discuss an adventure I'm having with removing shortcuts created with ProfileItems.First of all, ricktendo64 - thank you for sharing the info, it has been very useful.Your example of deleting a shortcut is given here:ProfileItems = MU.DelShortcut[MU.DelShortcut]Name=Windows Update,0x0000000A,22Microsoft, on the other hand, advocates a different method. They say the flag to be used is 0x00000002 (FLG_PROFITEM_DELETE)The problem is that I've tried them both, both work on XP, but none works on Vista or Seven.Here is the relevant part of the INF that I expect to do the job:[CreateStartMenuFolderEx]Name = %AppLink%SubDir = %App_StartMenuFolder%CmdLine = -1, %App_ProgramFolder%, File.exe ;-1 means Absolute pathWorkingDir = -1, %App_ProgramFolder%[DelStartMenuFolderEx]Name = %AppLink%,0x00000002I suspect it may have something to do with how I call the shortcut removal section. I do it this way:[DefaultUninstall]ProfileItems=DelStartMenuFolderExAt this point I have several questions:How did you discover the 0x0000000A flag?What do you think goes wrong during the attempt to remove the shortcut?Am I invoking the ProfileItems delete procedure correctly?The Name keyword takes 2 arguments, while you give it a third one - "22", what is it?I hope some light can be shed on this problem. Quote
Guest Posted October 7, 2009 Posted October 7, 2009 well try [DelStartMenuFolderEx]Name = %AppLink%,0x00000002SubDir = %App_StartMenuFolder%if i wasn't mistaken you think about it i tell you delete a file ?? you need to know it's place that why you will need the subdirthe other advantage in using the Ais 0x0000000A,22 << that the 22 says the file place so if i wasn't mistaken you wouldn't need the subdir test and tell Quote
ricktendo Posted October 7, 2009 Author Posted October 7, 2009 0x00000008,22 = %AllUserProfile%\Start Menu(just switch "8" to "A" and it deletes the shortcut)Yes you can also try/use either 0x00000002 or 0x00000003 to delete the shortcut.You have to also take in mind when you run your script...remember this shortcut does not actually get created until syssetup.inf is executed, which happens somewhere around or before t13Test your shortcut removal code on right now on your actual pc, if it works fine but not during setup then you should look at when you are executing it during the install@egorz if you know a way to use CMD.EXE or some other tool I could maybe try to launch it with .INF but no, dont know how to do that Quote
Cum zicea poetul Posted October 8, 2009 Posted October 8, 2009 Thank you for the quick feedback. I've tried multiple approaches and the behaviour is the same - the shortcut is not removed.Specifically, I tried the following:with and without SubDir = %App_StartMenuFolder%with "0x00000002", "0x00000003" and with "0x0000000A,22"I am surprised that none of them work, because the documentation says they should, and your experience is also suggesting that deleting shortcuts this way must work.remember this shortcut does not actually get created until syssetup.inf is executed, which happens somewhere around or before t13I am thinking that in my case the problem is in the fact that the procedure is not invoked at the right time.I also guessed it could have some thing to do with administrative privileges (or lack of them), but the results are the same even if I use "run as administrator".What other ideas you think I could test? Quote
Guest Posted October 8, 2009 Posted October 8, 2009 Thank you for the quick feedback. I've tried multiple approaches and the behaviour is the same - the shortcut is not removed.Specifically, I tried the following:with and without SubDir = %App_StartMenuFolder%with "0x00000002", "0x00000003" and with "0x0000000A,22"I am surprised that none of them work, because the documentation says they should, and your experience is also suggesting that deleting shortcuts this way must work.I am thinking that in my case the problem is in the fact that the procedure is not invoked at the right time.I also guessed it could have some thing to do with administrative privileges (or lack of them), but the results are the same even if I use "run as administrator".What other ideas you think I could test?try to change the 22 it's the file pathif %App_StartMenuFolder% mean 0x00000008,2 = %UserProfile%\Start Menu\Programsthen the command should be 0x0000000A,2to delete Quote
ricktendo Posted October 8, 2009 Author Posted October 8, 2009 Could you remove the %Strings% stuff and use the correct shortcut names, I will put together all 3 profileitems delete examplesIf you can post your entire INF file Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.