Neat way to create quicklaunch (or otherwise) shortcuts

Discuss & post Update Pack addons here.
Post Reply
Mitsuko Aninikkou
Posts: 210
Joined: Tue Dec 13, 2005 12:52 pm
Location: The Netherlands (But running US WinXP, in case it comes up)

Neat way to create quicklaunch (or otherwise) shortcuts

Post by Mitsuko Aninikkou » Thu Mar 09, 2006 4:44 pm

I thought I'd post it here since I haven't seen it mentioned before. Since I'm crap at explaining, I'll just post some example code below, using µTorrent, installed to %ProgramFiles%\µTorrent.

Code: Select all

[DefaultInstall]
UpdateInis = µTorrent.quicklaunch

[µTorrent.quicklaunch]
setup.ini,progman.groups,,QLaunch=%53%\Application Data\Microsoft\Internet Explorer\Quick Launch
setup.ini,QLaunch,,"µTorrent,%16422%\µTorrent\µTorrent.exe"
That creates a (smaller than usual, by the way) shortcut to µTorrent.exe in the Quicklaunch bar, called µTorrent, with no description (dunno where to put that).

Neat, huh? But, there's one problem: the directory the shortcut points to has to be in all 8.3 format, or the shortcut gets corrupted. I'll give another example, using Mozilla Firefox.

Code: Select all

[DefaultInstall]
UpdateInis = Firefox.quicklaunch

[Firefox.quicklaunch]
setup.ini,progman.groups,,QLaunch=%53%\Application Data\Microsoft\Internet Explorer\Quick Launch
setup.ini,QLaunch,,"Mozilla Firefox,%16422%\Mozilla Firefox\firefox.exe"
Doesn't work. And no, just adding more quotes doesn't help; trust me, I tried. Here's the version that does create a working shortcut:

Code: Select all

[DefaultInstall]
UpdateInis = Firefox.quicklaunch

[Firefox.quicklaunch]
setup.ini,progman.groups,,QLaunch=%53%\Application Data\Microsoft\Internet Explorer\Quick Launch
setup.ini,QLaunch,,"Mozilla Firefox,%16422%\Mozill~1\firefox.exe"
The shortcut works, and the target is (in my case) "C:\Programs\Mozilla Firefox\firefox.exe". So, problem solved, right? Not quite, because what if you have another folder that comes alphabetically before Mozilla Firefox? Say I have a program installed called Mozilla Cleaner, that creates a Mozilla Cleaner folder in the program files. Now, Mozill~1 points to Mozilla Cleaner, and Mozill~2 points to Mozilla Firefox!

Well, that's all I know about it, hope you find it helpful; also, if someone knows how to get around the problem with this, please let me know.

User avatar
Mrs Peel
The Dominatrix Recoded
Posts: 1344
Joined: Tue Jan 17, 2006 2:02 am
Location: Aotearoa
Contact:

Post by Mrs Peel » Thu Mar 09, 2006 8:15 pm

Oh wow this is so cool! Thanks for sharing this trick with us cos it's been driving me nuts trying to get shortcuts into places other than the program menu. It's easy as pie with switchless installers cos you get an option to put them in other places such as desktop, start menu etc etc but I've not been able to figure code to use in my inf files.

I have read and reread this very interesting thread by Yzöwl over at MSFN and there were some nifty tricks in there, but I couldn't get my head around them well enough to apply it to my own addon infs. Maybe there is something here that can help you....

http://www.msfn.org/board/index.php?showtopic=29964

Oh yes and I discovered early on that you cannot have a space in shortcut exe names - even if you wrap them in quote tags - so I have had to resort to using 8:3 short path names for one or two of my inf files. I probably should have mentioned that here sooner, but I just guessed that everyone else knew that already and I was just being a dummy :D

I'm gonna have a wee play with your code today and see what I can do with it... LOL I hope it doesn't lead me to a whole bunch more addon rewrites tho ROFL.

One quick question about this code tho?

That method Kel taught me about make a lnk file for quicklaunch has a very useful advantage in that it applies that quicklaunch to all user profiles, so I would be interested to know if your method here can be employed to make quicklaunch shortcuts for all user profiles as well? Have you tested it in a proper install to experiment with that?

Cheers for the shares :)

Mitsuko Aninikkou
Posts: 210
Joined: Tue Dec 13, 2005 12:52 pm
Location: The Netherlands (But running US WinXP, in case it comes up)

Post by Mitsuko Aninikkou » Fri Mar 10, 2006 5:01 am

Aha! Check here: http://www.robvanderwoude.com/shortcutinf.html for full syntax information for the created shortcuts! He says that putting quotes around the <target> field extends it to long file names; perhaps the other fields have to be included for this to work?

Mitsuko Aninikkou
Posts: 210
Joined: Tue Dec 13, 2005 12:52 pm
Location: The Netherlands (But running US WinXP, in case it comes up)

Post by Mitsuko Aninikkou » Fri Mar 10, 2006 5:11 am

I just tried it and it doesn't work; the problem is that no matter how much you quote the target, they do not get copied into the target field; is there any way to specify that the quotes are a character that should be included in the string? (like %20 for spaces in websites)

User avatar
Mrs Peel
The Dominatrix Recoded
Posts: 1344
Joined: Tue Jan 17, 2006 2:02 am
Location: Aotearoa
Contact:

Post by Mrs Peel » Fri Mar 10, 2006 5:28 am

Oooh nice link, I'll read thru it later when I have some leisure time. Thanks!

Mitsuko Aninikkou
Posts: 210
Joined: Tue Dec 13, 2005 12:52 pm
Location: The Netherlands (But running US WinXP, in case it comes up)

Post by Mitsuko Aninikkou » Fri Mar 10, 2006 7:20 am

Mitsuko Aninikkou wrote:I just tried it and it doesn't work; the problem is that no matter how much you quote the target, they do not get copied into the target field; is there any way to specify that the quotes are a character that should be included in the string? (like %20 for spaces in websites)
I've tried various things, and I can't figure it out (dunno if it's possible, either). Could someone with more experience shed some light on this?

User avatar
eryen
Posts: 124
Joined: Thu Mar 09, 2006 5:58 pm

Post by eryen » Fri Mar 10, 2006 8:11 am

i tried too.

SC created but does not work.
Start path is not set. So link look at Windows\system32
icon is not set too.

Mitsuko Aninikkou
Posts: 210
Joined: Tue Dec 13, 2005 12:52 pm
Location: The Netherlands (But running US WinXP, in case it comes up)

Post by Mitsuko Aninikkou » Fri Mar 10, 2006 8:30 am

It doesn't matter if you set the start path or not, so long as you point it at the right file in the right absolute (though environment variables work) path, it works fine. You can still set it if you want though

Edit: Oh, and make sure the whole section that describes the shortcut's attributes is quoted, like in my examples; don't just quote them individually, as they're part of a whole.

User avatar
eryen
Posts: 124
Joined: Thu Mar 09, 2006 5:58 pm

Post by eryen » Fri Mar 10, 2006 10:12 am

Code: Select all

setup.ini,progman.groups,,"QLaunch=""%53%\Application Data\Microsoft\Internet Explorer\Quick Launch"""
setup.ini,progman.groups,,"Desktop=""%16409%"""
setup.ini,progman.groups,,"StartMenu=""%16407%""
setup.ini,QLaunch,,"""MSN Messenger 7.5"",""%24%\Progra~1\MSNMes~1\msnmsgr.exe"",""%16422%\%prog_dir%\msnmsgr.exe"",,,""%16422%\%prog_dir%"",,""MSN Messenger 7.5"""
setup.ini,Desktop,,"""MSN Messenger 7.5"",""%24%\Progra~1\MSNMes~1\msnmsgr.exe"",""%16422%\%prog_dir%\msnmsgr.exe"",,,""%16422%\%prog_dir%"",,""MSN Messenger 7.5"""
setup.ini,StartMenu,,"""MSN Messenger 7.5"",""%24%\Progra~1\MSNMes~1\msnmsgr.exe"",""%16422%\%prog_dir%\msnmsgr.exe"",,,""%16422%\%prog_dir%"",,""MSN Messenger 7.5"""
This works perfect.

Mitsuko Aninikkou
Posts: 210
Joined: Tue Dec 13, 2005 12:52 pm
Location: The Netherlands (But running US WinXP, in case it comes up)

Post by Mitsuko Aninikkou » Fri Mar 10, 2006 11:55 am

Yes, it does. But so does this - and you gotta admit it's shorter:

Code: Select all

setup.ini,progman.groups,,QLaunch=%16410%\Microsoft\Internet Explorer\Quick Launch
setup.ini,progman.groups,,Desktop=%16409%
setup.ini,progman.groups,,SrtMenu=%16407%
setup.ini,QLaunch,,"MSN Messenger 7.5,%16422%\MSNMes~1\msnmsgr.exe,,,,,MSN Messenger 7.5"
setup.ini,Desktop,,"MSN Messenger 7.5,%16422%\MSNMes~1\msnmsgr.exe,,,,,MSN Messenger 7.5"
setup.ini,SrtMenu,,"MSN Messenger 7.5,%16422%\MSNMes~1\msnmsgr.exe,,,,,MSN Messenger 7.5" 

User avatar
eryen
Posts: 124
Joined: Thu Mar 09, 2006 5:58 pm

Post by eryen » Fri Mar 10, 2006 6:14 pm

Mitsuko Aninikkou wrote:Yes, it does. But so does this - and you gotta admit it's shorter:

Code: Select all

setup.ini,progman.groups,,QLaunch=%16410%\Microsoft\Internet Explorer\Quick Launch
setup.ini,progman.groups,,Desktop=%16409%
setup.ini,progman.groups,,SrtMenu=%16407%
setup.ini,QLaunch,,"MSN Messenger 7.5,%16422%\MSNMes~1\msnmsgr.exe,,,,,MSN Messenger 7.5"
setup.ini,Desktop,,"MSN Messenger 7.5,%16422%\MSNMes~1\msnmsgr.exe,,,,,MSN Messenger 7.5"
setup.ini,SrtMenu,,"MSN Messenger 7.5,%16422%\MSNMes~1\msnmsgr.exe,,,,,MSN Messenger 7.5" 
İn some landuages %16422% gives error.
Because of space in "Program Files"
Link may be corrupt.
In turkish windows %16422% gives error.

So if u have problem u can use %24%\Progra~1\

Mitsuko Aninikkou
Posts: 210
Joined: Tue Dec 13, 2005 12:52 pm
Location: The Netherlands (But running US WinXP, in case it comes up)

Post by Mitsuko Aninikkou » Sat Mar 11, 2006 8:10 am

Aah, I see; thanks for the info!

User avatar
Mrs Peel
The Dominatrix Recoded
Posts: 1344
Joined: Tue Jan 17, 2006 2:02 am
Location: Aotearoa
Contact:

Post by Mrs Peel » Sat Mar 11, 2006 6:51 pm

eryen wrote:İn some landuages %16422% gives error.
Because of space in "Program Files"
Link may be corrupt.
In turkish windows %16422% gives error.

So if u have problem u can use %24%\Progra~1\
Holy cow! I had no idea about this issue. :shock:

It is obviously something that we need to be aware of as addon pack makers. I have been trying to include support for as many languages as possible in my packs so if I need to use alternative code for that purpose I really need to know this.

If this issue means you have been unable to use some of my addons which I made a point to include turkish language files for then I am very sorry about that Eryen :(

Do you have any links to documentation of this issue so I can research it some more and find just how many languages are effected?

Thanks for the headsup.

User avatar
RyanVM
Site Admin
Posts: 5189
Joined: Tue Nov 23, 2004 6:03 pm
Location: Pennsylvania
Contact:

Post by RyanVM » Sat Mar 11, 2006 7:09 pm

Do the problems occur if the path has quotes around it?
Get up to $200 off on hosting from the same people who host this website!
http://www.ryanvm.net/forum/viewtopic.php?t=2357

Mitsuko Aninikkou
Posts: 210
Joined: Tue Dec 13, 2005 12:52 pm
Location: The Netherlands (But running US WinXP, in case it comes up)

Post by Mitsuko Aninikkou » Sat Mar 11, 2006 7:54 pm

Do you mean if I replace say %16422%\Mozilla Firefox\firefox.exe with "%16422%\Mozilla Firefox\firefox.exe"? If you do, yes they still occur. The string is read correctly, but the quotes are assumed to be needed for correct interpretation of the string, and so aren't copied into the target field no matter what, even though they're -needed- there. (So no quotes around the entry in the Target field, and the shortcut is corrupted)

TechnoHunter
Posts: 506
Joined: Sun Feb 26, 2006 4:13 am

Post by TechnoHunter » Sun Mar 12, 2006 3:55 am

i wonder if you can string literal it.. ie "\"some path or other\""

any way to check ? (notice my total lack of addon pack making language skills)

TechnoHunter

Mitsuko Aninikkou
Posts: 210
Joined: Tue Dec 13, 2005 12:52 pm
Location: The Netherlands (But running US WinXP, in case it comes up)

Post by Mitsuko Aninikkou » Sun Mar 12, 2006 6:07 am

Yeah, I checked; just outputs "\"some path or other\"" as some path or other\

Mitsuko Aninikkou
Posts: 210
Joined: Tue Dec 13, 2005 12:52 pm
Location: The Netherlands (But running US WinXP, in case it comes up)

Post by Mitsuko Aninikkou » Mon Mar 20, 2006 11:06 am

Aha! I have finally fixed the problem with spaces in the filepath/filename corrupting the shortcuts!

The solution was, in fact, quite simple: strength in numbers! To make filepaths with spaces work, you need to add no less than six double quotes around it; six! I'll rewrite this guide properly when I have time; for now, here's some example code:

Code: Select all

[DefaultInstall]
UpdateInis = Firefox.quicklaunch

[Firefox.quicklaunch]
setup.ini,progman.groups,,QLaunch=%53%\Application Data\Microsoft\Internet Explorer\Quick Launch
setup.ini,QLaunch,,"Mozilla Firefox,""""""%16422%\Mozilla Firefox\firefox.exe"""""""
Or, as eryen pointed out, for some languages (i.e. Turkish):

Code: Select all

[DefaultInstall]
UpdateInis = Firefox.quicklaunch

[Firefox.quicklaunch]
setup.ini,progman.groups,,QLaunch=%53%\Application Data\Microsoft\Internet Explorer\Quick Launch
setup.ini,QLaunch,,"Mozilla Firefox,""""""%24%\Program Files\Mozilla Firefox\firefox.exe"""""""
Enjoy!

TechnoHunter
Posts: 506
Joined: Sun Feb 26, 2006 4:13 am

Post by TechnoHunter » Mon Mar 20, 2006 1:15 pm

holy quoting batman!

lord thas a lot of quotes to throw in a line.. as long as it works though :) good job tracking it down, it must have something to do with how many seperate times the line is actually parsed (and by what programs) as it seems that each time its parsed a pair of quotes gets stripped..

oddness!

TechnoHunter

dunk
Posts: 11
Joined: Tue Dec 20, 2005 11:14 am

Post by dunk » Tue Mar 21, 2006 6:46 am

i got my inf file to install my shortcuts manually, but how do i get it to run from an addon pack unattended? i tried making an addon pack with appropriate ini file - the inf file is expanded and copied to the inf subfolder during an unattended setup but doesnt seem to get executed

any ideas?

thanks

User avatar
Kelsenellenelvian
Moderator
Posts: 4383
Joined: Tue Nov 30, 2004 8:32 pm
Location: Pocatello, ID
Contact:

Post by Kelsenellenelvian » Tue Mar 21, 2006 6:59 am

Can you post your ini and inf file for one of us to look at please?

dunk
Posts: 11
Joined: Tue Dec 20, 2005 11:14 am

Post by dunk » Tue Mar 21, 2006 8:21 am

thanks - i've chosen a different route instead now

leave the inf uncompressed in $oem$ and run it from cmdlines.txt via a .cmd script

that way i dont have to create a pack each time i modify the thing, and i can run the .cmd file for a non-unattended setup eg a re-install/upgrade of an existing install

Mitsuko Aninikkou
Posts: 210
Joined: Tue Dec 13, 2005 12:52 pm
Location: The Netherlands (But running US WinXP, in case it comes up)

Post by Mitsuko Aninikkou » Tue Mar 21, 2006 9:03 am

It's a bit useless now, but to get it to install during windows setup you need to add an [Optional Components] section which in turn points to the various things you want to install.

For right clicking to install:

Code: Select all

[DefaultInstall]
blabla
For integration:

Code: Select all

[Optional Components]
Files

[Files]
blabla
Of course you can combine the two.

dunk
Posts: 11
Joined: Tue Dec 20, 2005 11:14 am

Post by dunk » Tue Mar 21, 2006 12:13 pm

thanks - thats helpful cos i can integrate these nicely

fearphage
Posts: 41
Joined: Mon Jun 12, 2006 1:58 pm
Location: Austin, TX

Post by fearphage » Fri Jun 16, 2006 12:06 pm

How would you go about cleaning up a quicklaunch shortcut created this way during the uninstall process?

Post Reply