Jump to content

[Tutorial] Exotic INF ProfileItems/Shortcuts


ricktendo

Recommended Posts

Here is the body of the INF file, I included the section with the strings, so you can see where everything is taken from.


[Version]
Signature = $Windows NT$

[DefaultInstall]
;UpdateInis=CreateStartMenuFolder
AddReg = RegAddUninst
ProfileItems = AddTest, AddTestEx

[DefaultUnInstall]
ProfileItems=AddTest.DelShortcut

[AddTest.DelShortcut]
Name =ACME distorterA,0x0000000A, 2
;Also tried with Name =%Soft_Name%,0x0000000A, 2
;SubDir =Sub Directory


[RegAddUninst]
HKLM,%SMWCV%\Uninstall\%Soft_Name%,DisplayName,,"ACME"
HKLM,%SMWCV%\Uninstall\%Soft_Name%,UninstallString,,"RunDll32 advpack.dll,LaunchINFSection d:\test\installer\installer.inf, DefaultUninstall"


;16422 = program files
[AddTest]
Name = ACME distorterA
SubDir = %Provider%
Infotip = "This is a tooltip weeha!"
CmdLine = -1, %App_ProgramFolder%, Acmedist.exe
WorkingDir = -1, %App_ProgramFolder%



[AddTestEx]
Name = %Soft_Name%
SubDir = %Provider%
Infotip = "This is a tooltip weeha!QQQQQQ"
CmdLine = -1, %App_ProgramFolder%, Acmedist.exe
WorkingDir = -1, %App_ProgramFolder%


[Strings]
SMWCV="Software\Microsoft\Windows\CurrentVersion"
Provider="ACME"
Soft_Name="ACME distorter 5.0"
AppLink="ACME distorter 5.0"
App_Name="ACME distorter 5.0"
App_StartMenuFolder="ACME\Distorter 5.0"
App_ProgramFolder="ACME\Distorter 5.0"
ShortCutFileName="ACME\Distorter 5.0.lnk"
PathAndFileName="ACMEdist.exe"
Arguments= ""

I tried using "0x0000000A,2", as suggested by DaRk MaDnEsS, but the result is the same - the shortcut continues to stay in the Start menu.

Edited by Cum zicea poetul
Link to comment
Share on other sites

Here is the body of the INF file, I included the section with the strings, so you can see where everything is taken from.


[Version]
Signature = $Windows NT$

[DefaultInstall]
;UpdateInis=CreateStartMenuFolder
AddReg = RegAddUninst
ProfileItems = AddTest, AddTestEx

[DefaultUnInstall]
ProfileItems=AddTest.DelShortcut

[AddTest.DelShortcut]
Name =ACME distorterA,0x0000000A, 2
;Also tried with Name =%Soft_Name%,0x0000000A, 2
;SubDir =Sub Directory


[RegAddUninst]
HKLM,%SMWCV%\Uninstall\%Soft_Name%,DisplayName,,"ACME"
HKLM,%SMWCV%\Uninstall\%Soft_Name%,UninstallString,,"RunDll32 advpack.dll,LaunchINFSection d:\test\installer\installer.inf, DefaultUninstall"


;16422 = program files
[AddTest]
Name = ACME distorterA
SubDir = %Provider%
Infotip = "This is a tooltip weeha!"
CmdLine = -1, %App_ProgramFolder%, Acmedist.exe
WorkingDir = -1, %App_ProgramFolder%



[AddTestEx]
Name = %Soft_Name%
SubDir = %Provider%
Infotip = "This is a tooltip weeha!QQQQQQ"
CmdLine = -1, %App_ProgramFolder%, Acmedist.exe
WorkingDir = -1, %App_ProgramFolder%


[Strings]
SMWCV="Software\Microsoft\Windows\CurrentVersion"
Provider="ACME"
Soft_Name="ACME distorter 5.0"
AppLink="ACME distorter 5.0"
App_Name="ACME distorter 5.0"
App_StartMenuFolder="ACME\Distorter 5.0"
App_ProgramFolder="ACME\Distorter 5.0"
ShortCutFileName="ACME\Distorter 5.0.lnk"
PathAndFileName="ACMEdist.exe"
Arguments= ""

I tried using "0x0000000A,2", as suggested by DaRk MaDnEsS, but the result is the same - the shortcut continues to stay in the Start menu.

well what i think it should work

[AddTest.DelShortcut]
Name =%Soft_Name%,0x0000000A, 2
SubDir = %Provider%

and the shortcut should be

[AddTestEx]
Name = %Soft_Name%,0x00000008,2
SubDir = %Provider%
Infotip = "This is a tooltip weeha!QQQQQQ"
CmdLine = -1, %App_ProgramFolder%, Acmedist.exe
WorkingDir = -1, %App_ProgramFolder%

test and tell me

Edit:

i think since it installs to all users

you might need to use 0x0000000A, 23

with the old inf ( i'm not sure tho i just got this in my head)

Edited by DaRk MaDnEsS
Link to comment
Share on other sites

[Adds]
Name=%Soft_Name%,0x00000008,2
SubDir=%Provider%
Infotip="This is a tooltip weeha!QQQQQQ"
CmdLine=-1,%App_ProgramFolder%,Acmedist.exe
WorkingDir=-1,%App_ProgramFolder%

[Deletes]
Name=%Soft_Name%,0x0000000A,2
SubDir=%Provider%

BTW you dont need to use any exotic inf profileitem flags for this shortcut, you can use 0x00000001 then 0x00000002 or 0x00000003 to delete it (OH an it does not install to all users its going into current user)

[Adds]
Name=%Soft_Name%,0x00000001
SubDir=%Provider%
Infotip="This is a tooltip weeha!QQQQQQ"
CmdLine=-1,%App_ProgramFolder%,Acmedist.exe
WorkingDir=-1,%App_ProgramFolder%

[Deletes1]
Name=%Soft_Name%,0x00000002
SubDir=%Provider%

[Deletes2]
Name=%Soft_Name%,0x00000003
SubDir=%Provider%

Link to comment
Share on other sites

How to use the flag "CE_COPYFLG_NO_DATE_DIALOG 0x20000000" which does not copy a file if the target file is newer.

in the copy section

lets say that you are copying DM.exe

DM.exe,,0x20000000

should do the trick

Link to comment
Share on other sites

ok thank you but I FGCBA reports errors by as follows :s

sorry my bad

i miss writien it

DM.exe,,,0x20000000

it should be 3 ,,, not only 2

If FGCBA Reports any error

try to test it and see

Link to comment
Share on other sites

my program .exe is an Installshield installer that creates files in "%ProgramFiles%\InstallShield Installation Information\(8F5A0981-5CDC-41D0-BCA2-AD3B777FC358)\" so I love creating knowledge in INF installer?

you mean you want to make an inf that installs fies to there

or .. ?

cause i don't understand

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 7 months later...

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

Link to comment
Share on other sites

  • 3 weeks later...

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.

vbst13.th.png

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.

Link to comment
Share on other sites

  • 2 months later...

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

Link to comment
Share on other sites

  • 9 months later...

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...