Jump to content

Custom Shortcuts in INF Files


Recommended Posts

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.exe

IconPath = 10,,explorer.exe

IconIndex = 1

InfoTip = "@%11%\shell32.dll,-22579"

DisplayResource = "%11%\shell32.dll",22067

[infoAdd] <---This section blows.. :) ??

Name = "System Information"

CmdLine = 10,,Info.exe

WorkingDir = 10

IconPath = 10,,Info.exe

IconIndex = 1

InfoTip = "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

Link to comment
Share on other sites


enuffsaid - If Gosh answered, that'd be great. :rolleyes: 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.

Link to comment
Share on other sites

  • 4 weeks later...

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

Link to comment
Share on other sites

  • 1 year later...

:realmad: 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 by DarkShadows
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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 :wacko:

Thanks Yzöwl!

Link to comment
Share on other sites

  • 3 weeks later...

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= mysubfolder
WorkingDir = 16422
CmdLine = 16422,"mysubfolder","Guide.pdf"

[Shortcut.rebuild]
Name = "rebuild"
SubDir= mysubfolder
WorkingDir = 16422
CmdLine = 16422,"mysubfolder", Rebuild.exe
InfoTip = "blahblah"


[DefaultUninstall] <-- this part doesn't work like this...
Profileitems = del.subfolder
[del.subfolder]
Name = mysubfolder,0x00000004

Edited by ZileXa
Link to comment
Share on other sites

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 = Guide
SubDir = mysubfolder
WorkingDir = 16422
CmdLine = 16422,mysubfolder,Guide.pdf

[Shortcut.rebuild]
Name = rebuild
SubDir = mysubfolder
WorkingDir = 16422
CmdLine = 16422,mysubfolder, Rebuild.exe
InfoTip = "blahblah"

[SMGroup.Del]
Name = mysubfolder, 0x6

Updated due to stupid, 'lack of sleep', error.

Edited by Yzöwl
Link to comment
Share on other sites

  • 4 months later...

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.pdf

Notice 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!

Link to comment
Share on other sites

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"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...