Here's another method that's a bit more versatile because it allows you to place a shortcut anywhere. Unfortunately it's less well documented.
Below I'll give the simplest possible example for using this method; this will create a shortcut called Shortcut to the file "test.exe" located in %SYSTEMDRIVE%\test and will place this shortcut in %SYSTEMDRIVE%\shortcut.
[Version]
Signature = $Windows NT$
[DefaultInstall]
UpdateInis = Shortcut
[Shortcut]
setup.ini,progman.groups,,Location=%24%\shortcut
setup.ini,Location,,"Shortcut,%24%\test\test.exe"
Here %24% equals %SYSTEMDRIVE% (but beware: some inf environment variables do not work at all times during windows setup; for instance 16384 which is supposed to point to the Desktop -does not- work when you integrate an inf into your Windows CD).
Now, the first step is obviously the UpdateInis section in DefaultInstall; but if you could work with the above methods I won't need to explain that. Secondly, we get to the syntax for the UpdateInis section. There are some things to note about this but here are the basics:
First comes the line
setup.ini,progman.groups,,Location=%24%\shortcut
which always has the syntax
setup.ini,progman.groups,,[variable name]=[location of the folder where the shortcut is to be placed]
Simple, right?
Then the next line
setup.ini,Location,,"Shortcut,%24%\test\test.exe"
has the syntax
setup.ini,[variable name],,[shortcut creation syntax surrounded by quotes]
The syntax for shortcut creation is a bit more complicated, but here it is:
[LinkTitle],[Target],[Icon_file],[Icon_index],[Profile],[Start In],[Description]
Of those, I only used the first two above, and for your average shortcuts that's enough.
Okay, so, fine. We can create shortcuts anywhere, huzzah. But wait, there's a catch. What if we have directories (or file names, for that matter) which contain spaces? "Just use quotes", you might think, but unfortunately it's not that simple. In fact I can't tell you the exact rules, but I've found experimentally that for the simplest form, using only the first two parts of the syntax, you need to surround the target with -six-, that's 6, pairs of double quotes, or it will not work.
Note that this is not true for the first line in the inf, as my next example will show.
If I wanted to make a quicklaunch shortcut called "Somewhat more compolicated" to a file in my My Documents folder called "Somewhat more complicated.exe", here's how to do it.
[Version]
Signature = $Windows NT$
[DefaultInstall]
UpdateInis = Shortcut
[Shortcut]
setup.ini,progman.groups,,QLaunch=%16410%\Microsoft\Internet Explorer\Quick Launch
setup.ini,QLaunch,,"Somewhat more complicated,""""""%53%\My Documents\Somewhat more complicated.exe"""""""
Note the seven quotes at the end; this is because I'm not using the other sections so I'm ending the syntax there.
Of course there's no real point in using this method for a quicklaunch shortcut (though I think it's easier after you get used to it) except that it seems to create shortcuts that only contain the needed information, so they're usually smaller
Hope this helps, below are some links with more info:
http://www.microsoft.com/technet/prodtechn...p.mspx?mfr=true
http://www.microsoft.com/technet/prodtechn...f.mspx?mfr=true
http://www.robvander...hortcutinf.html
This post has been edited by Ver Greeneyes: 23 December 2006 - 12:27 PM