Jump to content


Photo

[Tutorial] Exotic INF ProfileItems/Shortcuts


  • Please log in to reply
72 replies to this topic

#41 DaRk MaDnEsS

DaRk MaDnEsS

    Live Free or Die Hard

  • Contributors
  • 971 posts
  • Location:Some where out computer
  • OS:Windows 7

Posted 22 October 2009 - 05:53 PM

yes I want to make a INF that installs the application (.exe) installshield...


you understand French?
otherwise I ask you in French by private message because my English is very bad ..


sorry i have been busy the couple of days

sorry i don't understand French well

but ok can you tell me the name of the application so i can see what is the problem exactly

#42 Geej

Geej

    Wincert Addict

  • Ultimate Sponsor
  • 591 posts
  • OS:Windows XP Pro

Posted 20 June 2010 - 08:17 AM

Does inf shortcut allows shortcut syntax to launch application in Min,Max,Normal mode?
If can, how to do it?

#43 ricktendo

ricktendo

    Group: Banned

  • Global Mods
  • 7,770 posts
  • Location:La Ceiba
  • OS:Windows 8 x64

Posted 20 June 2010 - 03:11 PM

Does inf shortcut allows shortcut syntax to launch application in Min,Max,Normal mode?
If can, how to do it?

I too am looking for how but have never found it...I wanted this when I made my Windows Search addon, because the startup shortcut was set to minimized or something

If you find out how please report back

#44 Geej

Geej

    Wincert Addict

  • Ultimate Sponsor
  • 591 posts
  • OS:Windows XP Pro

Posted 08 July 2010 - 02:50 AM

I too am looking for how but have never found it...I wanted this when I made my Windows Search addon, because the startup shortcut was set to minimized or something

If you find out how please report back


I thought about this and think that Profileitems does not have the command to set it.
So I thought using vbscript could do the job and after experimenting with it, it could do it only during T13.

I hereby enclosed an sysoc.inf addon that run vbscript to create shortcut at begining of T13. (It runs silently)
The vbscript creates 2 shortcut in Max mode. 1) Windows Movie Maker and 2) Program Files folder shortcut on desktop

Geej_T13_VBSshortcut_addon.cab
Size: 3.47 Kb (3,554 bytes)
MD5: 04E6C90BCF9C1008969DC0E2AE813F3C


CreateShortcuts.pdf for future reference
CreateShortcuts.zip
Size: 38.93 Kb (39,864 bytes)
MD5: 8C15321A2309F687A5EF9A3D7CFAF645

Below screenshot is a test shown that at T13, actual vbs execution path is root drive. Also not all windows shortcut are ready. Only Windows Movie Maker etc.
IE and WMP are not created by setup at T13. I have disabled the prompt message in the addon.

Posted Image

inf code that self-delete after vbs execution.
[Version]
Signature=$Windows NT$

[DefaultInstall]
RegisterDLLs=Start.Register

[Start.Register]
11,,rundll32.exe,,,"advpack.dll,LaunchINFSection %1%\vbs1test.inf,Install"

[Install]
RunPreSetupCommands=Create.EmptyDirectorys
CopyFiles=vbs1.Copy
AddReg =AddRegSection
RunPostSetupCommands =Del.i386

[Create.EmptyDirectorys]
CMD /Q/C MD """%1%\i386""" & COPY /D/Y  """%1%\*.cab""" """%1%\i386"""

[vbs1.Copy]
CreateShortcuts.vbs

[Install.Delvbs]
DelFiles=vbs1.Copy,PNF.copy
Updateinis=Sysoc.Edit
SmartReboot=N		; Suppress reboot prompt at T13
Cleanup=1

[PNF.copy]
vbs1test.PNF,,,1	; this file can only be deleted after reboot (when setup completes and boots to user desktop)

[Sysoc.Edit]
%17%\sysoc.inf,Components,vbs1test=*

[Del.i386]
RUNDLL32 advpack.dll,DelNodeRunDLL32 %1%\i386,8

[Optional Components]
vbs1test

[vbs1test]
OptionDesc  =vbs1test
Tip         =%Tip0%
Modes       =0,1,2,3
CopyFiles   =vbs1.Copy
AddReg 	    =AddRegSection

[SourceDisksNames.x86]
1="Vbs shortcut Files","vbsShcut.cab",,"i386"

[DestinationDirs]
vbs1.Copy=10		; copy .vbs files to C:\windows
PNF.copy=17

[SourceDisksFiles]
CreateShortcuts.vbs=1

[AddRegSection]
HKLM,"%VBSSC%","300",0x0,"%10%\CreateShortcuts.vbs"
HKLM,"%VBSSC%","301",0x0,"rundll32.exe advpack.dll,LaunchINFSection vbs1test.inf,Install.Delvbs"

[Strings]
Tip0 = "Test vbScript via ROE at T13"
VBSSC="SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\VBSshortcut"
vbs code is a bit long, so won't want to post the code here. See the addon for the actual detail. I hope it will be useful with this method.

#45 phasma

phasma

    Lurker

  • Members
  • Pip
  • 2 posts
  • OS:Windows XP Pro

Posted 24 September 2010 - 11:28 PM

Does inf shortcut allows shortcut syntax to launch application in Min,Max,Normal mode?
If can, how to do it?


Has anyone found a way yet?

Anyways, thank you Geej for the VBScript and if you or anyone is interested I implemented into a batchfile
that will search for your ShortCuts and output it to .vbs using your script as a template.

This should eliminate (atleast for me) the use of alot of .inf and batchfiles.

THX

#46 ricktendo

ricktendo

    Group: Banned

  • Global Mods
  • 7,770 posts
  • Location:La Ceiba
  • OS:Windows 8 x64

Posted 25 September 2010 - 03:24 AM

Nope, have not

#47 Geej

Geej

    Wincert Addict

  • Ultimate Sponsor
  • 591 posts
  • OS:Windows XP Pro

Posted 16 July 2011 - 07:37 AM

In profileitems, there is Hotkey=hotkey-value (ref)
What is the exact syntax to set this value? (say I want it Ctrl+Alt+U)

Where can I download "Windows SDK documentation" as mention in the above ref link?

Anyone here knows?

#48 ricktendo

ricktendo

    Group: Banned

  • Global Mods
  • 7,770 posts
  • Location:La Ceiba
  • OS:Windows 8 x64

Posted 16 July 2011 - 02:18 PM

In profileitems, there is Hotkey=hotkey-value (ref)
What is the exact syntax to set this value? (say I want it Ctrl+Alt+U)

Where can I download "Windows SDK documentation" as mention in the above ref link?

Anyone here knows?

I think you can get this if you go to the properties of a LNK file and enter the keyboard shortcuts...then using the same values in the INF profileitem

BTW I think the way you have it written (Ctrl+Alt+U) will work give it a try

#49 Geej

Geej

    Wincert Addict

  • Ultimate Sponsor
  • 591 posts
  • OS:Windows XP Pro

Posted 17 July 2011 - 04:42 AM

I think you can get this if you go to the properties of a LNK file and enter the keyboard shortcuts...then using the same values in the INF profileitem

BTW I think the way you have it written (Ctrl+Alt+U) will work give it a try

Have tried before I ask here. Not working. Actually I asked because I encountered this challenge while making Pretty Run addon, which has "Ctrl + Alt + S" set as hotkey.

Neverthless, I made some progress but still has no total solution to it.
Hotkey syntax is hex-base keyboard code. (which I am unable to find any proper keyboard code thur googling)

Here is a sample inf test if Pretty Run is installed.

[Version]
Signature=$Windows NT$

[DefaultInstall]
ProfileItems=Start.Shortcut1

[Start.Shortcut1]
Name      =%ShortcutN1%
SubDir    =%ProfileSubdir%
CmdLine   =16422,Pretty Run,PrettyRun.exe
WorkingDir=16422,Pretty Run
;HotKey    ="Ctrl + Alt + S"  ;Desired hotkey
HotKey    =0x200 ;  Ctrl +
;HotKey    =0x14 ; got it as Caplock
;HotKey    =0x400 ;  Alt +

[Strings]
ShortcutN1=PrettyRun
ProfileSubdir=Pretty Run

As you can see, hotkey is partially set only. Need to know how to do it exactly... If someone can throw some more light here, that will be great.

Edited by Geej, 17 July 2011 - 04:43 AM.


#50 ricktendo

ricktendo

    Group: Banned

  • Global Mods
  • 7,770 posts
  • Location:La Ceiba
  • OS:Windows 8 x64

Posted 17 July 2011 - 05:13 AM

Heres something that could help if you know how to program http://www.experts-e...Q_21115259.html

Im hope someone smart will see this and help

#51 OnePiece

OnePiece

    WinCert Dominator

  • Italian Addon Makers
  • 1,627 posts
  • Location:Ballkan

Posted 17 July 2011 - 01:09 PM

maybe this helps
http://msdn.microsof...y/ms927178.aspx
http://msdn.microsof...1(v=vs.85).aspx

Ciao.

Edited by OnePiece, 17 July 2011 - 01:12 PM.


#52 bphlpt

bphlpt

    Wincert Addict

  • Ultimate Sponsor
  • 739 posts
  • OS:Windows 7 x64

Posted 18 July 2011 - 04:45 AM

The problem is the ALT key. CTL + S is an easily defined value. When you add the ALT key it ends up being quite different. It's like trying to find the value sent by CTL + ALT + Del. All references I found described writing a program to send the code. Sorry I couldn't be of much help.

Cheers and Regards

#53 ricktendo

ricktendo

    Group: Banned

  • Global Mods
  • 7,770 posts
  • Location:La Ceiba
  • OS:Windows 8 x64

Posted 18 July 2011 - 04:50 AM

Someone with time may have to painstakingly do them one by one and map the keyboard

#54 bphlpt

bphlpt

    Wincert Addict

  • Ultimate Sponsor
  • 739 posts
  • OS:Windows 7 x64

Posted 18 July 2011 - 07:27 AM

CREDIT - I referred to the following:
http://www.jimprice.com/jim-asc.shtml
Charts are copied from there.

                        My ASCII Chart (Hex)

     0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
0  NUL SOH STX ETX EOT ENQ ACK BEL BS  HT  LF  VT  FF  CR  SO  SI
1  DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM  SUB ESC FS  GS  RS  US
2   SP  !   "   #   $   %   &   '   (   )   *   +   ,   -   .   /
3   0   1   2   3   4   5   6   7   8   9   :   ;   <   =   >   ?
4   @   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O
5   P   Q   R   S   T   U   V   W   X   Y   Z   [   \   ]   ^   _
6   `   a   b   c   d   e   f   g   h   i   j   k   l   m   n   o
7   p   q   r   s   t   u   v   w   x   y   z   {   |   }   ~ DEL


Another version of the table that includes Decimal, Hex, Octal, and HTML values can be found here - http://www.asciitabl...x/asciifull.gif

From my own experimentations, I've found that CTL effects the key codes in a "linear" manner. From the table above, the codes, in Hex, for A, B, C, D are 0x41, 0x42, 0x43, 0x44. CTL+A, CTL+B, CTL+C, CTL+D yielded 0x01, 0x02, 0x03, 0x04. My simple test program yielded the same results for CTL+a, CTL+b, CTL+c, CTL+d as CTL+A, CTL+B, CTL+C, CTL+D.

A table showing how ALT effects the value transmitted is this one:

                   IBM PC Keyboard Scan Codes


For many of the special key combinations such as ALT-A, F1, PgUp, and so forth,
the IBM PC uses a special two-character escape sequence. Depending on the programming
language being used and the level at which the keyboard is being accessed, the escape
character is either ESC (27, 0x1B), or NUL (0). Here are some common sequences:

Char.  Decimal Pair     Hex Pair    Char.  Decimal Pair    Hex Pair
ALT-A     (00,30)    (0x00,0x1e)    ALT-B    (00,48)    (0x00,0x30)
ALT-C     (00,46)    (0x00,0x2e)    ALT-D    (00,32)    (0x00,0x20)
ALT-E     (00,18)    (0x00,0x12)    ALT-F    (00,33)    (0x00,0x21)
ALT-G     (00,34)    (0x00,0x22)    ALT-H    (00,35)    (0x00,0x23)
ALT-I     (00,23)    (0x00,0x17)    ALT-J    (00,36)    (0x00,0x24)
ALT-K     (00,37)    (0x00,0x25)    ALT-L    (00,38)    (0x00,0x26)
ALT-M     (00,50)    (0x00,0x32)    ALT-N    (00,49)    (0x00,0x31)
ALT-O     (00,24)    (0x00,0x18)    ALT-P    (00,25)    (0x00,0x19)
ALT-Q     (00,16)    (0x00,0x10)    ALT-R    (00,19)    (0x00,0x13)
ALT-S     (00,31)    (0x00,0x1a)    ALT-T    (00,20)    (0x00,0x14)
ALT-U     (00,22)    (0x00,0x16)    ALT-V    (00,47)    (0x00,0x2f)
ALT-W     (00,17)    (0x00,0x11)    ALT-X    (00,45)    (0x00,0x2d)
ALT-Y     (00,21)    (0x00,0x15)    ALT-Z    (00,44)    (0x00,0x2c)
PgUp      (00,73)    (0x00,0x49)    PgDn     (00,81)    (0x00,0x51)
Home      (00,71)    (0x00,0x47)    End      (00,79)    (0x00,0x4f)
UpArrw    (00,72)    (0x00,0x48)    DnArrw   (00,80)    (0x00,0x50)
LftArrw   (00,75)    (0x00,0x4b)    RtArrw   (00,77)    (0x00,0x4d)
F1        (00,59)    (0x00,0x3b)    F2       (00,60)    (0x00,0x3c)
F3        (00,61)    (0x00,0x3d)    F4       (00,62)    (0x00,0x3e)
F5        (00,63)    (0x00,0x3f)    F6       (00,64)    (0x00,0x40)
F7        (00,65)    (0x00,0x41)    F8       (00,66)    (0x00,0x42)
F9        (00,67)    (0x00,0x43)    F10      (00,68)    (0x00,0x44)
F11       (00,133)   (0x00,0x85)    F12      (00,134)   (0x00,0x86)
ALT-F1    (00,104)   (0x00,0x68)    ALT-F2   (00,105)   (0x00,0x69)
ALT-F3    (00,106)   (0x00,0x6a)    ALT-F4   (00,107)   (0x00,0x6b)
ALT-F5    (00,108)   (0x00,0x6c)    ALT-F6   (00,109)   (0x00,0x6d)
ALT-F7    (00,110)   (0x00,0x6e)    ALT-F8   (00,111)   (0x00,0x6f)
ALT-F9    (00,112)   (0x00,0x70)    ALT-F10  (00,113)   (0x00,0x71)
ALT-F11   (00,139)   (0x00,0x8b)    ALT-F12  (00,140)   (0x00,0x8c)

Hint - If you look at how the keys are laid out on the keyboard, you'll probably see the pattern.

My VERY simple test program could not display these paired codes so I could not verify them, but I have no reason to doubt them. But as a result, I could also not display the paired codes created by CTL+ALT+A, etc. I assume it will also be a paired code, but I have not found a reference to describe what is actually produced. I've found AutoIT scripts that emulate these key presses, but those references also do not describe what the actual key codes are. Sorry I couldn't be of more help.

Cheers and Regards

#55 Geej

Geej

    Wincert Addict

  • Ultimate Sponsor
  • 591 posts
  • OS:Windows XP Pro

Posted 18 July 2011 - 10:47 PM

Just to share a few things. I got it set sucessfully as

HotKey    =0x653 ;  hex 200 + 400 + 53
where 200 is Ctrl +
400 is Alt +
53 is S

Thanks to ricktendo64, OnePiece & bphlpt for some thought & info on this.
I google around and found this vb forum post (small software) where you press a key and it returns dec & hex code.
Might be useful somehow without going to MSDN for the keycodes.
http://www.vbforums.com/showthread.php?t=499084
Download 1st post attachment, extract and find in bin folder, keycodes.exe (found it can run standalone)

So while fiddling with combination of hex codes, found Shift + (which might be useful)
has 0x115 or 0x107 (yes both codes set the same hotkey)
Since 200 = Ctrl + and 400 = Alt + , it might means some other values might also be valid for Ctrl + and Alt + respectively.
Just need to know which value. (I was googling when I stumbled 200 & 400 value and I didn't take note of the url. But it was from a vb forum thread where some codes are posted for Ctrl + and shift +. Unfortunately, the thread did not indicate how it derived these values as discussion was something else)

With this info, bphlpt, setting Ctrl + Alt + A hotkey is much easier now.
Just add these hex code: 200 + 400 + 41
You don't have to install Pretty Run to test. I made another simple inf for anyone who wish to test. I use "Disk Defragmenter.lnk" that is found in Accessories\systen Tools on XP so that you can see the effect.
(View the .lnk properties before applying this inf test)

[Version]
Signature=$Windows NT$

[DefaultInstall]
ProfileItems=Start.Shortcut1

[Start.Shortcut1]
Name      =%ShortcutN1%,0x8,23
SubDir    =%ProfileSubdir%
CmdLine   =11,,dfrg.msc
WorkingDir=11
;HotKey    ="Ctrl + Alt + A"  ;Desired hotkey
HotKey    =0x641 ;  hex 200 + 400 + 41
; where A=0x41
Infotip	  =Defragments your volumes so that your computer runs faster and more efficiently.

[Strings]
ShortcutN1=Disk Defragmenter
ProfileSubdir=Accessories\System Tools
Now, just press Ctrl + Alt + A and wait for Disk Defragmenter to launch.

Now we have some real solution to this thing but do not know if it is consistent globally or just limited to English US 101 keyboard . Same thing to consider when running on laptop or non-english keyboard such as Japanese / French etc. What if it is english keyboard but not 101 type? I really don't know.

Perhaps "Windows SDK documentation" might throw the rest of the light over this issue, but then it is yet another mystery to find out. (lol)

Cheers
  • mona and bphlpt like this

#56 ricktendo

ricktendo

    Group: Banned

  • Global Mods
  • 7,770 posts
  • Location:La Ceiba
  • OS:Windows 8 x64

Posted 18 July 2011 - 11:37 PM

Gr8 work, another INF mystery solved

#57 bphlpt

bphlpt

    Wincert Addict

  • Ultimate Sponsor
  • 739 posts
  • OS:Windows 7 x64

Posted 19 July 2011 - 04:15 AM

Great work Geej! I guess your finding the post telling you that "200 = Ctrl + and 400 = Alt +" was key. I tried verifying the keycodes by using keycodes.exe which you referenced and was unable to do it.

I'm on Win7 x32 using a Logitech keyboard. When running the keycodes.exe, I found that it displays the keycode information of the LAST key-up that occurs. I was unable to get it to display multi-key info, ie if I have CTL+Alt+A pressed, when I release them it only displays the info of whichever of those single keys is the LAST one to lift, even if only by a few microseconds. So keycodes.exe is unable to confirm those values of "200 = Ctrl + and 400 = Alt +". For the keys by themselves, keycodes.exe shows Ctrl=11(Hex) and Alt=12(Hex). So were you able to use keycodes.exe for anything useful for this particular problem, of did you only rely on the "200 = Ctrl + and 400 = Alt +" reference?

Cheers and Regards

#58 Geej

Geej

    Wincert Addict

  • Ultimate Sponsor
  • 591 posts
  • OS:Windows XP Pro

Posted 20 July 2011 - 02:50 AM

So were you able to use keycodes.exe for anything useful for this particular problem, of did you only rely on the "200 = Ctrl + and 400 = Alt +" reference?

Cheers and Regards

I face the same situation as you. keycodes.exe is not much use when using combined keystroke. I relied on "200 = Ctrl + and 400 = Alt +" reference only.

Found a more reliable alternative solution. Query the shortcut's properties using Shortcut v1.11 (console tool, shortcut.exe)
It returns a dec value. Then use windows calculator to convert dec to hex
For Ctrl + Alt +A, dec value return is 1601 which then converted to 641 in hex. tada :)

@echo off
Shortcut /F:"%ALLUSERSPROFILE%\Start Menu\Programs\Accessories\System Tools\Disk Defragmenter.lnk" /A:Q
pause

  • bphlpt likes this

#59 ricktendo

ricktendo

    Group: Banned

  • Global Mods
  • 7,770 posts
  • Location:La Ceiba
  • OS:Windows 8 x64

Posted 20 July 2011 - 03:11 AM

Now all we need to know is how to set Run: Normal Window/Minimized/Maximized and well have EVERYTHING!!! covered

#60 bphlpt

bphlpt

    Wincert Addict

  • Ultimate Sponsor
  • 739 posts
  • OS:Windows 7 x64

Posted 20 July 2011 - 10:33 AM

@Geej
The Shortcut tool you found seems to be a wonderful way to confirm the keycode! ie when you have created the link along with the desired Hotkey, then the Shortcut Tool can then be used to verify what the keycode is that equates to that Hotkey. I guess we just have to rely on remembering the "200 = Ctrl + and 400 = Alt +" trick for the actual creating of the Hotkey keycode in the first place. Thank you for pursuing this so diligently.

Cheer and Regards




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users