Jump to content











* * - - - 1 votes

Syntax of for [Iconfile] in Add_Shortcut


  • Please log in to reply
15 replies to this topic

#1 Guest_Msenn_*

Guest_Msenn_*
  • Guests

Posted 13 February 2008 - 02:10 PM

I want to preset an Icon of Shell32.dll for a shortcut.
Add_shortcut,[Type],[Folder],[Title],[WorkFolder],[Parameter],[IconFile],[Startm
ode]
Where [IconFile]=X:\Windows\System32\Shell32.dll,6 (the sixth icon of Shell32.dll)
This doen't work.
How do I specify the position in the Dll of the icon?
Manfred

#2 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 13 February 2008 - 03:52 PM

Because commas are used by the scripting syntax to separate parameters, you need to use #$c in lieu of the literal within a single parameter. So the icon would be identified as "Shell32.dll#$c6".

#3 Guest_Msenn_*

Guest_Msenn_*
  • Guests

Posted 13 February 2008 - 04:50 PM

Great, thank you!

#4 Guest_Msenn_*

Guest_Msenn_*
  • Guests

Posted 14 February 2008 - 10:46 AM

Because commas are used by the scripting syntax to separate parameters, you need to use #$c in lieu of the literal within a single parameter. So the icon would be identified as "Shell32.dll#$c6".


Hi Arvy,
I did test your advice, but i hadn't success with it.
What is wrong in my syntax?
Add_Shortcut,"Desktop",,"X:\Program Files\Autoinst\Autoinst.vbs","Unattended Installation","X:\Program Files\Autoinst",,"X:\Windows\System32\Shell32.dll#&c6" ?

#5 allanf

allanf

    Gold Member

  • .script developer
  • 1256 posts

Posted 14 February 2008 - 12:27 PM

Add_Shortcut,"Desktop",,"X:\Program Files\Autoinst\Autoinst.vbs","Unattended Installation","X:\Program Files\Autoinst",,"X:\Windows\System32\Shell32.dll#&c6"


'#$c' ?

#6 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 14 February 2008 - 01:42 PM

Yes, that's it. Dollar sign, not ampersand. Sharp eyes, allanf! :thumbsup:

I wanted to provide a documentation link for the complete list of those #$ substitutions, but I can't seem to find it today. Maybe someone else will point to it for us. One of the most important is #$p in lieu of % where you want your script to insert an environment variable for later (post-build) handling by Windows (e.g., "#$pSystemRoot#$p" for "%SystemRoot%").

#7 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 14 February 2008 - 01:57 PM

If you use WB to edit/write your scripts, then you have the needed substitutions in the right click menu.

:thumbsup:

#8 Guest_Msenn_*

Guest_Msenn_*
  • Guests

Posted 14 February 2008 - 02:09 PM

Yes, that's it. Dollar sign, not amperand.

I wanted to provide a documentation link for the complete list of those #$ substitutions, but I can't seem to find it today. Maybe someone else will point to it for us. One of the most important is #$p in lieu of % where you want your script to insert an environment variable for later (post-build) handling by Windows (e.g., "#$pSystemRoot#$p" for "%SystemRoot%").

A documentation would be good!
Besides my write error (only in forum, not in test environment) - it doesnot work, the icon is set to the default icon of wscript.exe (.vbs Extension).
All other parameters are right.
Maybe a '-' has to be added like this: ...\shell32.dll#$c-6 ?
According to the following hint I found this in the forum: associate_file,html,icon,%systemroot%\System32\Shell32.dll,-153 ?
I will make another test.

#9 allanf

allanf

    Gold Member

  • .script developer
  • 1256 posts

Posted 14 February 2008 - 02:14 PM

If you use WB to edit/write your scripts, then you have the needed substitutions in the right click menu.

:thumbsup:


MedEvil,

That reminded me of something that has been around for at least the last few versions of Winbuilder. In the Script Editor, Rt Click (or Wizard Dropdown) => 'Special Chars' => 'Line break (#$x)' returns '#$s', the sub for a space! .... Nuno? :D

#10 allanf

allanf

    Gold Member

  • .script developer
  • 1256 posts

Posted 14 February 2008 - 02:18 PM

I will make another test.


Yes! Very interested to hear if you can get it to work... :thumbsup:

#11 Guest_Seiba_*

Guest_Seiba_*
  • Guests

Posted 15 February 2008 - 12:05 PM

Yes! Very interested to hear if you can get it to work... :thumbsup:

Doing a test with many special characters didn't solve the problem.
Maybe using icons of Dlls is not implemented in Add_Shortcut.
Manfred

#12 Brito

Brito

    Platinum Member

  • .script developer
  • 10565 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 15 February 2008 - 12:45 PM

Doing a test with many special characters didn't solve the problem.
Maybe using icons of Dlls is not implemented in Add_Shortcut.
Manfred



I don't know the answer either, but maybe Pedrole15 or Galapo might know better since they were working directly on the latest API version and might even consider adding this as option in the future.

:thumbsup:

#13 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 15 February 2008 - 12:49 PM

Hmmmm. Interesting. Is it inserting all of the parameters correctly into the [shortcut] section of the vistape.cfg file? Reproducing the line from vistape.cfg here might help to clarify where in the process the problem is happening -- i.e., in the entry itself or in the creation of the shortcut.

#14 pedrole15

pedrole15

    Silver Member

  • .script developer
  • 731 posts
  •  
    France

Posted 15 February 2008 - 08:29 PM

In liveXP Icon must be a filename with no path (same folder of the program you make the shortcut))
normaly .exe or .ico but there no test on it, so other can work
Icon index is set to 0
in VistaPE should work same

#15 online

online

    Silver Member

  • Advanced user
  • 767 posts

Posted 19 February 2008 - 01:07 PM

How do I specify the position in the Dll of the icon?

I think that under VistaPE current API do not support shortcuts with DLL icon pointing.
If true in order to workaround the issue you can extract the icon from the dll, copy it in related folder and set the related new path in your shortcut line...
Or you can create a real shortcut (with your preferred icon pointing) and add it in your script in order to extract itself in the right place...

#16 Seiba

Seiba

    Member

  • Members
  • 33 posts
  •  
    Germany

Posted 19 February 2008 - 07:18 PM

I think that under VistaPE current API do not support shortcuts with DLL icon pointing.
If true in order to workaround the issue you can extract the icon from the dll, copy it in related folder and set the related new path in your shortcut line...
Or you can create a real shortcut (with your preferred icon pointing) and add it in your script in order to extract itself in the right place...

Thanks Online, i will do this.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users