Jump to content

Need Help with INF files!


Recommended Posts

I´m converting my RegTweaks Collection to the INF format, but there are some stones in my head:

As it was in the original REG files, most of entires are imported to the registry. But some of them have to be removed. In REG files, i just used "[-" in front of the directory in the registry i with do delete. In inf files, i have to use DelReg, right?

But since the collection has many tweaks in one single file, if i have many DelReg sections, when i call the INF file, won´t it get "confused" or something and might screw things up?

What i mean is, let´s say i have this tweaks in a REG file:

; Speeds up copying/moving of zip files (disable windows built in zip functionality)

[-HKEY_CLASSES_ROOT\.zip\CompressedFolder]

[-HKEY_CLASSES_ROOT\CLSID\{E88DCCE0-B7B3-11d1-A9F0-00AA0060FA31}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CompressedFolder]
;--------------------------------------------------------------------------------------------------------------------------------

; Disable Windows Installer Rollback (faster msi installs, But some MSI installers, like .NET Framework, wont work with this tweak activated, caused all sorts of problems. Not Recommended)

[HKEY_LOCAL_MACHINE,Software\Policies\Microsoft\Windows\Installer]
"DisableRollback",0x00010001,00000001

Converted to INF, it would be something like this:

; Speeds up copying/moving of zip files (disable windows built in zip functionality)

[DelReg]
HKCR,.zip\CompressedFolder

HKCR,CLSID\{E88DCCE0-B7B3-11d1-A9F0-00AA0060FA31}
HKLM,SOFTWARE\Classes\CompressedFolder
;--------------------------------------------------------------------------------------------------------------------------------

; Disable Windows Installer Rollback (faster msi installs, But some MSI installers, like .NET Framework, wont work with this tweak activated, caused all sorts of problems. Not Recommended)

HKCU,Software\Policies\Microsoft\Windows\Installer,"DisableRollback",0x00010001,00000001

Won´t it delete the things that are under the "DelReg" section, in wicth should not be deleted?

If yes, then i will have to put an [AddReg] line in all keys that have to be imported?

There isn´t a easier solution to solve my problem?

Link to comment
Share on other sites


You can have more than one addreg or delreg section.

I just converted mine so I'm not an expert.

Don't know the limit on how many addreg or delreg sections

you can have. I just used one of each in my inf file.

[version]

signature="$CHICAGO$"

[DefaultInstall]

AddReg = Tweak1_Addreg,Tweak2_Addreg

DelReg = Tweak1_DelReg,Tweak1_DelReg

[Tweak1_Addreg]

[Tweak1_DelReg]

[Tweak2_Addreg]

[Tweak1_DelReg]

Link to comment
Share on other sites

I´m doing some tests here, but need again some help:

How do i complete this:

HKCR,%MyComputer%\shell\services\command
@=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,73,00,79,00,73, 00,74,00,65,00,6d,00,33,00,32,00,5c,00,6d,00,6d,00,63,00,2e,00,65,00,78,00,;65,00,20,00,2f,00,73,00,20,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52, 00,6f,00,6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,;32,00,5c,00,73,00,65,00,72,00,76,00,69,00,63,00,65,00,73,00,2e,00,6d,00,73, 00,63,00,20,00,2f,00,73,00,00,00

I mean, @=hex(2) changes to what?

And this:

; Adds Device Manager to right click of MY Computer

HKLM,%MyComputer%\shell\DevMgr
@="Device Manager"
HKLM,%MyComputer%\shell\DevMgr\command
@="mmc.exe %%SYSTEMDRIVE%%\\WINDOWS\\SYSTEM32\\devmgmt.msc"

I think that values that have double back-slashes ( \\ ) are reg_binarry, is that right?

Could someone complete the above conversions for me? For now, all i did was convert the main paths (HKLM,%MyComputer%\shell,DevMgr), and created some strings.

Link to comment
Share on other sites

ryan, thanks for the link, but that article is not available in my language, and there is many many techinical terms, and my english is not that fine to fully understand the whole thing out.

can´t you help me out with this one?

i just need to know how i complete the above entries, then i´m half way there!

thanks.

gugutz.

Link to comment
Share on other sites

http://gosh.msfn.org/Files/DirIds.txt

0x00000001 is what you want. For example:

HKCR,"%MyComputer%\shell\services\command",,1,25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33
,00,32,0,5c,00,6d,00,6d,00,63,00,2e,00,65,00,78,00,65,00,20,00,2f,00,73,00,20,00,25,00,53,00,79,00,7
3,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00
,32,00,5c,00,73,00,65,00,72,00,76,00,69,00,63,00,65,00,73,00,2e,00,6d,00,73,00,63,00,20,00,2f,00,73,
00,00,00

Notice I used 1 instead of 0x00000001 for shorthand as the above link says you can.

EDIT: I don't know why IPB is screwing with the text formatting in the codebox, but you can copy/paste the correct code from the message edit box if you pretend like you're going to quote my post.

Edited by RyanVM
Link to comment
Share on other sites

You wouldn't create REG_EXPAND_SZ keys in that manner, you would use a far simpler and easy to read method.

Here is an example of a REG file:

Windows Registry Editor Version 5.00

[-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\image\ShellEx\ContextMenuHandlers\ShellImagePreview]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\Services\command]
@=hex(2):6d,00,6d,00,63,00,20,00,2f,00,73,00,20,00,22,00,25,00,73,00,79,00,\
73,00,74,00,65,00,6d,00,72,00,6f,00,6f,00,74,00,25,00,5c,00,73,00,79,00,73,\
00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,65,00,72,00,76,00,69,00,63,00,\
65,00,73,00,2e,00,6d,00,73,00,63,00,22,00,00,00

here is its INF equivalent:

[Version]
Signature = $Windows NT$

[DefaultInstall]
AddReg = Plus
DelReg = Minus

[Plus]
HKLM,%SC%\CLSID\%MC%\shell\Services\command,,0x20000,\
"mmc /s ""%systemroot%\system32\services.msc"""

[Minus]
HKLM,%SC%\SystemFileAssociations\image\%CH%\ShellImagePreview

[Strings]
SC = "SOFTWARE\Classes"
MC = "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
CH = "ShellEx\ContextMenuHandlers"

Both remove a key and add one too, the key added is an English version of the data you require!

Link to comment
Share on other sites

Signature = $Windows NT$

[DefaultInstall]

AddReg = Plus

DelReg = Minus

[Plus]

HKLM,%SC%\CLSID\%MC%\shell\Services\command,,0x20000,\

"mmc /s ""%systemroot%\system32\services.msc"""

I got the rest, but in this example, why the hex values where replaced bu " "mmc /s ""%systemroot%\system32\services.msc""" ??

Link to comment
Share on other sites

Because that is the exact command, (barring the additional double quotes, required for inf syntax, but I'll not explain that!), that you want to run. The reg syntax is only the hex code, (plus additional 00,s required for Regedit v5, but I'll not explain that either!), for the same command.

6d = m,00,6d = m,00,63 = c,00,20 = <space>,00,2f = /,00,73 = s,...etc.
Now reading the stuff in red mmc /s...etc

<Edit>

If I perform the same conversion to your original hex data, your actual command was

%windir%\system32\mmc.exe /s %SystemRoot%\system32\services.msc /s
That should therefore directly be replaced by my better code. You can now therefore just copy my inf and reg examples of that key and data as needed.

To help you out here is a direct correct example for your 'other' key and data.



; Adds Device Manager to right click of MY Computer
HKLM,%MyComputer%\shell\DevMgr,,,"Device Manager"
HKLM,%MyComputer%\shell\DevMgr\command,,0x20000,"mmc /s ""%systemroot%\system32\devmgmt.msc"""

[Strings]
MyComputer = "SOFTWARE\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}"

</Edit>

Link to comment
Share on other sites

would there be any problem if i put many AddReg and DelReg sections on the same file?

I mean like this:

[AddReg]
(some reg entrie)

[DelReg]
(some entrie to be removed)

[AddReg]
(another reg entrie)

[DelReg]
(another entrie to be removed)

Link to comment
Share on other sites

how do i convert to inf the "(Default)" keys?

like this:

; Makes a right click option for unknown files (Open with notepad)

HKCR,*\shell,@="\"notepad.exe %1\""

HKCR,*\shell\open,@="Open &With Notepad"

HKCR,*\shell\open\command,@="notepad.exe %1"

the " @= " means it is the "Default" key, the first key, between ( ), i don´t know how it is in the english xp, in mine the name is (Padrão) (something like (Standart) ).

Edited by gugutz
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...