MSFN Forum: Custom Shortcuts in INF Files - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Custom Shortcuts in INF Files Rate Topic: -----

#1 User is offline   glitterglue 

  • Newbie
  • Group: Members
  • Posts: 14
  • Joined: 29-March 04
  • OS:Windows 7 x64
  • Country: Country Flag

  Posted 06 May 2004 - 05:18 PM

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


#2 User is offline   glitterglue 

  • Newbie
  • Group: Members
  • Posts: 14
  • Joined: 29-March 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 07 May 2004 - 11:50 AM

So, does anyone (besides Gosh) know enough about .inf files to answer the question .. .. ??

#3 User is offline   enuffsaid 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 865
  • Joined: 26-December 03

Posted 07 May 2004 - 12:09 PM

You don't want Gosh to answer? :)

#4 User is offline   GreenMachine 

  • ineXPlicable
  • Group: Developers
  • Posts: 3,062
  • Joined: 22-August 03

Posted 07 May 2004 - 12:18 PM

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

Attached File(s)



#5 User is offline   glitterglue 

  • Newbie
  • Group: Members
  • Posts: 14
  • Joined: 29-March 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 07 May 2004 - 12:36 PM

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.

#6 User is offline   fczajka 

  • Group: Members
  • Posts: 6
  • Joined: 26-May 04

Posted 03 June 2004 - 09:24 AM

If I wanted to create the shortcut on the desktop instead of the start menu what would be the syntax?

//FC

#7 User is offline   gosh 

  • gosh 2.0
  • Group: Patrons
  • Posts: 2,347
  • Joined: 03-October 03
  • OS:none specified
  • Country: Country Flag

Posted 03 June 2004 - 03:54 PM

Profileitems only makes start menu shortcuts.

Quote

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

#8 User is offline   DarkShadows 

  • The brighter the light, the darker the shadows.
  • PipPip
  • Group: Members
  • Posts: 272
  • Joined: 12-January 05

Posted 10 May 2006 - 01:32 AM

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

This post has been edited by DarkShadows: 10 May 2006 - 01:36 AM


#9 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,369
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 10 May 2006 - 02:08 AM

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!

#10 User is offline   DarkShadows 

  • The brighter the light, the darker the shadows.
  • PipPip
  • Group: Members
  • Posts: 272
  • Joined: 12-January 05

Posted 10 May 2006 - 02:46 AM

View PostYzöwl, on May 10 2006, 04:08 AM, said:

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!

#11 User is offline   ZileXa 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 767
  • Joined: 27-May 04

Posted 30 May 2006 - 05:08 PM

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

This post has been edited by ZileXa: 30 May 2006 - 05:23 PM


#12 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,369
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 30 May 2006 - 06:41 PM

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.

This post has been edited by Yzöwl: 31 May 2006 - 07:16 AM


#13 User is offline   ZileXa 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 767
  • Joined: 27-May 04

Posted 31 May 2006 - 08:34 AM

thanks!
Name = mysubfolder, 0x6
works!
Now I only have one more problem left..

#14 User is offline   DarkShadows 

  • The brighter the light, the darker the shadows.
  • PipPip
  • Group: Members
  • Posts: 272
  • Joined: 12-January 05

Posted 28 October 2006 - 01:01 AM

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!

#15 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,369
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 28 October 2006 - 06:04 AM

View PostDarkShadows, on Oct 28 2006, 08:01 AM, said:

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" 


#16 User is offline   DarkShadows 

  • The brighter the light, the darker the shadows.
  • PipPip
  • Group: Members
  • Posts: 272
  • Joined: 12-January 05

Posted 28 October 2006 - 10:19 AM

Thanks Yzöwl! :thumbup

I thought about using short file names too. But I was wondering if there was a means to handle file names with spaces. I guess not. I tried sticking multiple quotes everywhere to no avail. It seems that .inf file conventions can not handle file names with spaces (though they do handle long file names without them).

Short names get tricky if one has a folder full of files with similarly named files.

On the plus side, the Windows XP shortcut ends up pointing to the long file name, even though the short name was specified.

#17 User is offline   DarkShadows 

  • The brighter the light, the darker the shadows.
  • PipPip
  • Group: Members
  • Posts: 272
  • Joined: 12-January 05

Posted 30 November 2006 - 10:09 AM

I just noticed that every Program Files group I've created with an .inf file is user-based, not under All Users.

Q: Using an .inf file, how can you create program groups/shortcuts under each of these?
  • All Users Profile
  • Default User's Profile
  • Current User's Profile
I know if the .inf is run at a certain point of Windows Setup, that Default User will be the current user, so groups and shortcuts will end up under each new user account created afterward. But I'm looking for an .inf file syntax answer here.

Thanks in advance for any ideas!

This post has been edited by DarkShadows: 30 November 2006 - 10:09 AM


#18 User is offline   mohammadgerami 

  • Newbie
  • Group: Members
  • Posts: 20
  • Joined: 13-February 07

Posted 30 March 2007 - 05:49 PM

thanks for shortcut

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy