glitterglue Posted May 6, 2004 Posted May 6, 2004 Got a weird one here.I'm attempting to use an inf file to create some custom shortcuts.Here's part of what I've got in my "shortcut.inf" file:----------------------------------------[Version]Signature=$CHICAGO$[AddShortcuts]ProfileItems=WindowsExplorerAdd, InfoAdd[WindowsExplorerAdd] <---This section works great! Thanks Gosh!Name = "Windows Explorer"CmdLine = 10,,explorer.exeIconPath = 10,,explorer.exeIconIndex = 1InfoTip = "@%11%\shell32.dll,-22579"DisplayResource = "%11%\shell32.dll",22067[infoAdd] <---This section blows.. ??Name = "System Information"CmdLine = 10,,Info.exeWorkingDir = 10IconPath = 10,,Info.exeIconIndex = 1InfoTip = "Displays System Resource Information"----------------------------------------I'm "testing" using the command: "rundll32 setupapi,InstallHinfSection AddShortCuts 128 .\Shortcuts.inf"So, why does this create another .lnk file called "Windows Explorer" in my "All Users\Start Menu\Program" directory and not a "System Information" icon??Thx
glitterglue Posted May 7, 2004 Author Posted May 7, 2004 So, does anyone (besides Gosh) know enough about .inf files to answer the question .. .. ??
GreenMachine Posted May 7, 2004 Posted May 7, 2004 That code works fine in my tests. Perhaps you have a minor syntax error that is stopping the .INF file? Try reversing the order of the *Add sections, or something. The problem is not in the code ... Try mine ...Shortcuts.zipShortcuts.zip
glitterglue Posted May 7, 2004 Author Posted May 7, 2004 enuffsaid - If Gosh answered, that'd be great. I know that he's busy & I just didn't want to wait for his answer alone.GreenMachine - Hmm.. Your approach does indeed work - go figure.. The only difference between your way and mine is that I was "testing" from a command prompt - same test command, just a different method.I think I'll use the .cmd file approach from now on as that is more efficient. Thanks a bunch.
fczajka Posted June 3, 2004 Posted June 3, 2004 If I wanted to create the shortcut on the desktop instead of the start menu what would be the syntax?//FC
gosh Posted June 3, 2004 Posted June 3, 2004 Profileitems only makes start menu shortcuts.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.-gosh
DarkShadows Posted May 10, 2006 Posted May 10, 2006 (edited) Arrrrrgggggggggggggh! Whew, that felt good!I'm having exactly the same issue as the first post in this thread, and it is baffling me.This is my shortcut.inf file:[Version]Signature=$Windows NT$Provider=%INF-Creator%[DefaultInstall]ProfileItems = DOpusExe, DOpusHelp[DOpusExe]Name = %DOpusExeDescription%CmdLine = 16422,%DOpusExeFolder%, %DOpusExe%SubDir = %DOpusGroup%InfoTip = %DOpusExeTip%[DOpusHelp]Name = %DOpusHelpDescription%CmdLine = 16422,%DOpusHelpFolder%, %DOpusHelp%SubDir = %DOpusGroup%InfoTip = %DOpusHelpTip%[Strings]INF-Creator = "DarkShadows"DOpusGroup = "TEST-File Management\Directory Opus"DOpusExe = "dopus.exe"DOpusExeDescription = "Directory Opus"DOpusExeFolder = "GPSoftware\Directory Opus"DOpusExeTip = "The ultimate Windows Explorer replacement, and a while lot more!"DOpusHelp = "dopus.hlp"DOpusHelpDescription = "Directory Opus"DOpusHelpFolder = "GPSoftware\Directory Opus\Help"DOpusHelpTip = "Contains most syntax-related information."What happens is that only the DOpusHelp shortcut gets created. But here's what's even more weird: if I comment out the DOpusHelp section entirely, then the DOpusExe works fine. It's as if I can only create one shortcut per .inf file?I have already tried moving the DOpusHelp section before the DOpusExe section—same results. Can anybody see what I might have done wrong here?I should add that I am merely testing this file by right-clicking it and selecting Install from the context menu in Windows Explorer. Edited May 10, 2006 by DarkShadows
Yzöwl Posted May 10, 2006 Posted May 10, 2006 This one's a beauty, you're going to kick yourselfIn the strings section, you've got:DOpusExeDescription = "Directory Opus"DOpusHelpDescription = "Directory Opus"What is happening is that you are creating an exe shortcut with the name Directory Opus, then creating a hlp shortcut with exactly the same name; thus overwriting the first with the second!
DarkShadows Posted May 10, 2006 Posted May 10, 2006 This one's a beauty, you're going to kick yourself…In the strings section, you've got:DOpusExeDescription = "Directory Opus"DOpusHelpDescription = "Directory Opus"What is happening is that you are creating an exe shortcut with the name Directory Opus, then creating a hlp shortcut with exactly the same name; thus overwriting the first with the second!Yeah Yeah. This is my brain... and this my brain on next to no sleep Thanks Yzöwl!
ZileXa Posted May 30, 2006 Posted May 30, 2006 (edited) for an installer, am using ProfileItems as well to create Shortcuts, but I want my .INF to have an Uninstall section as well. The INF file is only used to create shortcuts.(its for a very easy installer that only need to do few things, the most efficient way for this is to use a batchfile. But I create the shortcuts with an INF file since there is no nice way to do it with batchfiles (The shortcuts must be created correctly for every Windows language, also Greek and French etc. Start menu\programs uses strange accents and stuff for these and other languages.. thats why INF is very handy for this.)But when uninstalling, these shortcuts need to be removed.... can't find any documentation about this ;This file will create the Shortcuts[Version]Signature = $Windows NT$;----------------------------------------------------------;INSTALL SHORTCUTS;----------------------------------------------------------[DefaultInstall]ProfileItems = Shortcut.guide, Shortcut.rebuild[Shortcut.guide]Name = "Guide"SubDir= mysubfolderWorkingDir = 16422CmdLine = 16422,"mysubfolder","Guide.pdf"[Shortcut.rebuild]Name = "rebuild"SubDir= mysubfolderWorkingDir = 16422CmdLine = 16422,"mysubfolder", Rebuild.exeInfoTip = "blahblah"[DefaultUninstall] <-- this part doesn't work like this...Profileitems = del.subfolder[del.subfolder]Name = mysubfolder,0x00000004 Edited May 30, 2006 by ZileXa
Yzöwl Posted May 31, 2006 Posted May 31, 2006 (edited) Try[Version]Signature = $Windows NT$[DefaultInstall]ProfileItems = SMGroup.Add, Shortcut.guide, Shortcut.rebuild[DefaultUninstall]ProfileItems = SMGroup.Del[SMGroup.Add]Name = mysubfolder, 0x4[Shortcut.guide]Name = GuideSubDir = mysubfolderWorkingDir = 16422CmdLine = 16422,mysubfolder,Guide.pdf[Shortcut.rebuild]Name = rebuildSubDir = mysubfolderWorkingDir = 16422CmdLine = 16422,mysubfolder, Rebuild.exeInfoTip = "blahblah"[SMGroup.Del]Name = mysubfolder, 0x6Updated due to stupid, 'lack of sleep', error. Edited May 31, 2006 by Yzöwl
ZileXa Posted May 31, 2006 Posted May 31, 2006 thanks! Name = mysubfolder, 0x6works!Now I only have one more problem left..
DarkShadows Posted October 28, 2006 Posted October 28, 2006 Q: Does anyone know how to create a shortcut.inf, where the target file has spaces in its file name?Here's the Shortcut.inf:[Version]Signature=$Windows NT$Provider=%INF-Creator%[DefaultInstall]ProfileItems = UL_PI_11_PDF.Shortcut,UL_GA_5_PDF.Shortcut,UL_Album_11_PDF.Shortcut[UL_PI_11_PDF.Shortcut]Name = %UL_PI_11_Name%CmdLine = 16422,"%UL_PI_Man_Dir%","%UL_PI_11_PDF%"SubDir = "%UL_PI_Man_Grp%"InfoTip = "%UL_PI_11_Tip%"[UL_GA_5_PDF.Shortcut]Name = %UL_GA_5_Name%CmdLine = 16422,"%UL_PI_Man_Dir%","%UL_GA_5_PDF%"SubDir = "%UL_PI_Man_Grp%"InfoTip = "%UL_GA_5_Tip%"[UL_Album_11_PDF.Shortcut]Name = "%UL_Album_11_Name%"CmdLine = 16422,"%UL_PI_Man_Dir%","%UL_Album_11_PDF%"SubDir = "%UL_PI_Man_Grp%"InfoTip = "%UL_Album_11_Tip%"[Strings]INF-Creator = "Kenneth R. Alcock"UL_PI_Man_Dir = "Ulead Systems\Ulead PhotoImpact 11\Manual"UL_PI_Man_Grp = "Digital Imaging\Ulead PhotoImpact 11\Manuals And Help"UL_PI_11_PDF = "PI-11 MANUAL.pdf"UL_PI_11_Name = "PhotoImpact 11 Manual"UL_PI_11_Tip = "Ulead PhotoImpact 11 User Manual"UL_GA_5_PDF = "GA-5 MANUAL.pdf"UL_GA_5_Name = "GIF Animator 5 Manual"UL_GA_5_Tip = "Ulead GIF Animator 5 User Manual"UL_Album_11_PDF = "ALBUM-11.pdf"UL_Album_11_Name = "Album 11 Manual"UL_Album_11_Tip = "Ulead Album 11 User Manual"Both of the .pdf files whose names contain spaces get messed up. For example, this is what happens to the target for the file named "PI-11 MANUAL.pdf":"C:\Program Files\Ulead Systems\Ulead PhotoImpact 11\Manual\PI-11" MANUAL.pdfNotice that Windows XP SP2 places the closing quote in the middle of the file name, before the space in the file name. By the way, I didn't name the files with spaces, they get installed that way.Any help is appreciated!
Yzöwl Posted October 28, 2006 Posted October 28, 2006 Q: Does anyone know how to create a shortcut.inf, where the target file has spaces in its file name?Yes!Try this version as is...[Version]Signature = $Windows NT$Provider = %INF-Creator%[DefaultInstall]ProfileItems = UL_PI_11_PDF.Shortcut, UL_GA_5_PDF.Shortcut,\ UL_Album_11_PDF.Shortcut[UL_PI_11_PDF.Shortcut]Name = %UL_PI_11_Name%CmdLine = 16422, %UL_PI_Man_Dir%, %UL_PI_11_SFN%SubDir = %UL_PI_Man_Grp%InfoTip = "%UL_PI_11_Tip%"[UL_GA_5_PDF.Shortcut]Name = %UL_GA_5_Name%CmdLine = 16422, %UL_PI_Man_Dir%, %UL_GA_5_SFN%SubDir = %UL_PI_Man_Grp%InfoTip = "%UL_GA_5_Tip%"[UL_Album_11_PDF.Shortcut]Name = %UL_Album_11_Name%CmdLine = 16422, %UL_PI_Man_Dir%, %UL_Album_11_PDF%SubDir = %UL_PI_Man_Grp%InfoTip = "%UL_Album_11_Tip%"[Strings]INF-Creator = "Kenneth R. Alcock"UL_Album_11_Name = "Album 11 Manual"UL_Album_11_PDF = "ALBUM-11.pdf"UL_Album_11_Tip = "Ulead Album 11 User Manual"UL_GA_5_Name = "GIF Animator 5 Manual"UL_GA_5_PDF = "GA-5 MANUAL.pdf"UL_GA_5_SFN = "GA-5MA~1.pdf"UL_GA_5_Tip = "Ulead GIF Animator 5 User Manual"UL_PI_11_Name = "PhotoImpact 11 Manual"UL_PI_11_PDF = "PI-11 MANUAL.pdf"UL_PI_11_SFN = "PI-11M~1.pdf"UL_PI_11_Tip = "Ulead PhotoImpact 11 User Manual"UL_PI_Man_Dir = "Ulead Systems\Ulead PhotoImpact 11\Manual"UL_PI_Man_Grp = "Digital Imaging\Ulead PhotoImpact 11\Manuals And Help"
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now