Archive: Give a shortcut a special icon


Give a shortcut a special icon
Hello,

i have more than 4 shortscuts and every shortcut had to become a special icon.

As example:

1. Shortcut = abc.ico
2. Shortcut = 123.ico
3. Shortcut = def.ico
4. Shortcut = 456.ico

How can I do that? This icons are not in an .exe or somethings like that.

Thank you very much!

Best regards!


it's all here


Thank you, but now i have a new problem:

I have a droplist. If now a user selects an entry there, that-speaking a shortcut will provided. I tried with "var kfirmasc1", which does not function however. The shortcuts are provided, however not with the special ICON.

With the selection I inserted now the following:

StrCpy $kfirmasc1 "C:\DIRTOICON\KUBXP_BP.ICO"

And i create the Shortcut with:

CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\NAME ($kfirma1_name).lnk" "$OUTDIR\PROGRAMM\k.exe" "$kfirma1,$kfirmasc1"

But it dont works. After that I tried:

CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\NAME ($kfirma1_name).lnk" "$OUTDIR\DIR\k.exe" [$kfirma1[$kfirmasc1]]

It also dont works.

(The italic is changed for this Thread!)

How can I do that? I search for solutions, but i dont find one.

Thank you!!


You should include those extra icons and extract them e.g in $INSTDIR, then use them as described in documentation.


Okay, thanks.

But what is now right, when "$kfirmasc1" = "$INSTDIR\k.exe" 2

That
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\NAME ($kfirma1_name).lnk" "$OUTDIR\PROGRAMM\k.exe" "$kfirma1,$kfirmasc1"

or

CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\NAME ($kfirma1_name).lnk" "$OUTDIR\DIR\k.exe" [$kfirma1[$kfirmasc1]]

or

CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\NAME ($kfirma1_name).lnk" "$OUTDIR\DIR\k.exe" "$kfirma1" "$kfirmasc1"

Sorry, i dont know. The documentation is not clear for me.

Thanks


CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\NAME ($kfirma1_name).lnk" "$OUTDIR\DIR\k.exe" "parameters" "icon_path" "icon_index"

Pretty straight forward really.
If you don't have any parameters then use "" for it but you can't just miss it out.

Stu


Thank you. After I included the icons to the setup and use your code, it functioned.

Its really hard to write it in my setup. More than 2000 lines... puh :D ... but okay... its workingtime :)

Thank you!


You should split it up into modules with descriptive file names and comments and then !include those in your main script.

Stu