Jump to content

.INF Files


Worf

Recommended Posts

Hi

I want to make an addon of a program and i want the program to insert a short cut to the Start Up folder on instalation from an INF file, i have found the line below in the INF file which creates a short cut to the programs folder but it does not create on in the Start Up folder.

ProfileItems =Name.AddShortcut

how do i get it to install a short cut to the Startup Folder please?

Many Thanks

Worf.

P.S. Merry Christmas to all

Edited by Worf
Link to comment
Share on other sites


Heres a example of a profile Item...

ProfileItems=SpyBlast.Short

[SpyBlast.Short]

Name =SpywareBlaster

CmdLine =16422,%SPYBLAST%,spywareblaster.exe

SubDir =%SPYBLAST%

WorkingDir=16422,%SPYBLAST%

[strings]

SPYBLAST="SpywareBlaster"

Read more about ProfileItmes http://mirror.ryanvm.net/mrspeel/OSR_Guide...g_INF_Files.zip

You can also download this addon and check it out http://www.sokoolz.com/addons/r64/Ricks_CC...6.430_AddOn.rar

BTW the 0x00000001 flag means that it will create the shortcut in Current Uses instead of All Users

Link to comment
Share on other sites

The method will also depend largely upon the required content of the shortcut target.

Examples:

[Version]
Signature = $Windows NT$

[DefaultInstall]
;UpdateInis = WayOne
;ProfileItems = WayTwo

[WayOne]
;Startup shortcut - Windows Explorer opening in system32 directory
;Replace %16391% with %16408% for 'All Users' Startup directory
setup.ini, progman.groups,, "group0=""%16391%\"""
setup.ini, group0,,"""Windows Explorer"",""""""%10%\explorer.exe"""" /e,/root,%11%"""

[WayTwo]
;Startup shortcut - Windows Media Player
;Remove `,1` at end of Name string for 'All Users' Startup directory
Name = Windows Media Player,1
CmdLine = 16422,Windows Media Player,wmplayer.exe
SubDir = Startup

Remove the semicolon from either UpdateInis, ProfileItems or both under DefaultInstall in order to test

As you can see WayTwo is far easier to understand, but has limitations in the target field. Try to create the WayOne explorer command or even running an executable with a space in its name using WayTwo and you'll see what I mean.

Hope this helps!

Link to comment
Share on other sites

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

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.robvanderwoude.com/shortcutinf.html

Edited by Ver Greeneyes
Link to comment
Share on other sites

Here is my QuickLaunch shortcut trick

ProfileItems=QuickLaunch.AddShortcut

[QuickLaunch.AddShortcut]Name =Windows Sidebar,0x00000001

CmdLine =16422,%SIDEBAR%,sidebar.exe

SubDir =%QUICKL%

WorkingDir=16422,%SIDEBAR%

InfoTip ="Displays personalized slideshows, news feeds, and other customized information on the desktop."

[strings]

SIDEBAR="Windows Sidebar"

QUICKL ="..\..\Application Data\Microsoft\Internet Explorer\Quick Launch"

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