Help - Search - Members - Calendar
Full Version: [RESOLVED] buggy functioning of AddReg and SourceDisksFiles ?
The CD Forum > Bart's PE Builder > Troubleshooting
frizbit
UPDATE: Look at post nr.6 or click here http://www.911cd.net/forums//index.php?sho...st&p=165695 to jump directly to it.

UPDATE2: New plugin updated for HashTab v3.0, Windows XP Pro SP3 is used as source. Look for post nr.12 or click to jump directly to http://www.911cd.net/forums//index.php?sho...st&p=165706

First of all, hello everyone !

Second, my apologies if this is being asked and resolved for 100 times already.

My problem is with adding registry entries and file structure.

When trying to add some registry keys, they do appear but values do not get written
to \I386\SYSTEM32\CONFIG\SOFTWARE hive (checked by importing it in regedit under
manually created temporary key). Instead of value only blank is inserted (and by that i
mean there is no "(value not set"), just a blank value). I also tried to edit hive and
manually add missing keys, and it worked as expected.

What was used :
source = Windows XP SP3 Pro
program = BartPE 3.1.2.0
plugin = 7-Zip 4.65
settings = output path absolute
enabled plugins = default set

I used RegShot to scan for registry changes and build my sections.

This fails in my [Software.Addreg] section :
CODE
0x1,"Classes\*\shellex\ContextMenuHandlers\7-Zip",,"{23170F69-40C1-278A-1000-000100020000}"


In that entry, instead of value "{23170F69-40C1-278A-1000-000100020000}" i get "".

There are more but i think above will suffice. If needed i can post other problem keys.

About files - similar trouble but i have managed to work around it using [SourceDisksFolders],
it just recursively collects all files and folders in one go.

Basically i define destination folders in [WinntDirectories] section, but when adding many files in
[SourceDisksFiles] section, they end up in different parts of application folder.

This issue arises only if trying to add many files, happened to me when making additions for
WinRAR and TotalCommander (left WinRAR in favor of 7-Zip).
nuMe
QUOTE (frizbit @ Nov 11 2010, 03:43 PM) *
program = BartPE 3.1.2.0

Really!! Wow, where did you find it? http://nu2.nu/ ?
mbarnes
Hi frizbit

regarding 7-zip plugins

I looked at some old plugins and found they did not include any registry settings as 7-zip created them when it started

There are a variety of plugins about
(A ) Patrick Binnendijk (no registry),
(B ) thuun,
(C ) by fafot ; Modified by Benjamin Burrows 8/31/05, 8/17/06 ; Modified by Homes32 5/08/2010 plugin from ubcd4win.com)

and the files from V4.65 can be replaced by V9.1x beta

this line is in © I never checked to see if it was created correctly as 7-zip works under BartPE
0x1, "Classes\*\shellex\ContextMenuHandlers\7-Zip","","{23170F69-40C1-278A-1000-000100020000}"

personally I would check BartPE registry after booting up BartPE

-----------------
BartPE 3.1.2.0

The last version from Bart is 3.1.10A why use any older version ?


example from Ahead Nero plugin

[WinntDirectories]

a="Programs\Ahead\Nero",2
b="Programs\Ahead\Nero\CDI",3

[SourceDisksFiles]
files\*.cfg=a,,1
files\*.exe=a,,1
files\*.txt=a,,1
files\*.dll=a,,1

files\CDI\*.*=b,,4

you could list each file individually or *.exe or *.* [ ,,4 means files are optional no error if missing]


regards

Mike Barnes


frizbit
@nuMe:
Yes, i downloaded it from there. And i apologise for wrong version number.
It is 3.1.10a. I was looking at "product version" in properties of pebuilder.exe.

@mbarnes:
Yes i know 7zip does not require registry settings to work, but my problem
with registry (values not written correctly) still remains, and when i decide to
add HashTab, this issue will not be possible to just leave unresolved.

As for files, that is a viable way of doing SourceDisksFiles section. Not too broad
like with SourceDisksFolders.

Besides, i prefer to build my plugins from near-scratch. I just looked at few
of them and since then i don't use inf files out-of-the-box. RegShot is my friend.

Inf files aren't that alien to me, i did before a custom addition for nLite
(mainly adding files and shortcuts).

So... having HashTab behind a corner, does anyone have any suggestions how to
find a source of problems with AddReg, or even a solution ?

Ofcourse adding a startup (like RunOnce or similar) can resolve this via cmd script
to add keys afterwards, but it defeats the whole AddReg philosophy (not to mention
that it would be a crude workaround).

Ahh one more thing : i have setup a virtual machine with clean windows install and there
too bartpe did same buggy AddReg. May be an error on my side for placing it too "deep"
in folder-tree (it was originaly designed to work on C:\BartPE, will try that too).
Other than that, i don't see any other problems i may have caused.
dog
QUOTE (frizbit @ Nov 11 2010, 08:43 PM) *
This fails in my [Software.Addreg] section :
CODE
0x1,"Classes\*\shellex\ContextMenuHandlers\7-Zip",,"{23170F69-40C1-278A-1000-000100020000}"


Try
CODE
0x1,"Classes\*\shellex\ContextMenuHandlers\7-Zip","","{23170F69-40C1-278A-1000-000100020000}"

frizbit
QUOTE (dog @ Nov 12 2010, 08:40 AM) *
Try
CODE
0x1,"Classes\*\shellex\ContextMenuHandlers\7-Zip","","{23170F69-40C1-278A-1000-000100020000}"


I tried, same problem, but it did inspired me to try something else.

UPDATE:
During writing this post, i have noticed that in some lines i used UPPERCASE LETTER "X" in AddReg
section (and it was noted in docs that lowercase "x" must be used).
This caused a whole array of weird errors, if still interested then please read on !
Albeit a failure, this may help others discover why their inf's misbehave smile.gif

NOTE WELL WHAT FOLLOWS IS "OLD NEWS" !!!

Suspecting a foul play on PEBuilder's side, i have conducted several tests.

Testing conditions:
- PEBuilder installed to default location "c:\pebuilder3110a"
- active plugins are "HashTab" (custom built inf, see below), "Customize", "Keyboard Layout",
"Nu2Menu", "Nu2Shell", and "RAMDisk [Nu2 Productions]"

Contents of "hashtab.inf"
CODE
; hashtab.inf
; PE Builder v3 plug-in INF file for HashTab Shell Extension

[Version]
Signature="$Windows NT$"

[PEBuilder]
Name="custom HashTab 3.0.0.0"
Enable=1
Help="hashtab.htm"

[WinntDirectories]
a=Programs\HashTab,2

[SourceDisksFiles]
files\HashTab32.dll=a,,2

[Software.AddReg]
;--------------TEST AREA ---------------
0X1,"testkey\testsubkey\subsubkey\HashTab",,"{8A56567E-A333-4843-B6E1-C3A262E41D8C}"
0X1,"Classes\*\shellex\PropertySheetHandlers\HashTab",,"{8A56567E-A333-4843-B6E1-C3A262E41D8C}"
;---------------------------------------
0X1,"Classes\AppID\HashTab.DLL","AppID","{0A3C1C8E-5829-4CFD-B1CC-475DB010B883}"
0X1,"Classes\AppID\{0A3C1C8E-5829-4CFD-B1CC-475DB010B883}",,"HashTab"
0X1,"Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}",,"HashPage Class"
0X1,"Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}","AppID","{0A3C1C8E-5829-4CFD-B1CC-475DB010B883}"
0X1,"Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}\InprocServer32",,"X:\Programs\HashTab\HashTab32.dll"
0X1,"Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}\InprocServer32","ThreadingModel", "Apartment"
0X1,"Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}\ProgID",,"HashTab.HashPage.1"
0X0,"Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}\Programmable"
0x1,"Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}\TypeLib",,"{1F9B20F0-0AA5-4EEB-B5ED-FADA0C41D073}"
0x1,"Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}\VersionIndependentProgID", , "HashTab.HashPage"
0x1,"Classes\Interface\{1BC2DEA9-DCDB-4961-8BDB-107767D135A9}",,"IDropTargetImpl"
0x1,"Classes\Interface\{1BC2DEA9-DCDB-4961-8BDB-107767D135A9}\ProxyStubClsid",,"{00020424-0000-0000-C000-000000000046}"
0x1,"Classes\Interface\{1BC2DEA9-DCDB-4961-8BDB-107767D135A9}\ProxyStubClsid32",,"{00020424-0000-0000-C000-000000000046}"
0x1,"Classes\Interface\{1BC2DEA9-DCDB-4961-8BDB-107767D135A9}\TypeLib",,"{1F9B20F0-0AA5-4EEB-B5ED-FADA0C41D073}"
0x1,"Classes\Interface\{1BC2DEA9-DCDB-4961-8BDB-107767D135A9}\TypeLib","Version","1.0"
0x1,"Classes\Interface\{B3D7DD5D-510B-477C-9521-2BCBCC91762C}",,"IHashPage"
0x1,"Classes\Interface\{B3D7DD5D-510B-477C-9521-2BCBCC91762C}\ProxyStubClsid",,"{00020424-0000-0000-C000-000000000046}"
0x1,"Classes\Interface\{B3D7DD5D-510B-477C-9521-2BCBCC91762C}\ProxyStubClsid32",,"{00020424-0000-0000-C000-000000000046}"
0x1,"Classes\Interface\{B3D7DD5D-510B-477C-9521-2BCBCC91762C}\TypeLib",,"{1F9B20F0-0AA5-4EEB-B5ED-FADA0C41D073}"
0x1,"Classes\Interface\{B3D7DD5D-510B-477C-9521-2BCBCC91762C}\TypeLib","Version","1.0"
0x0,"Classes\TypeLib\{1F9B20F0-0AA5-4EEB-B5ED-FADA0C41D073}"
0x1,"Classes\TypeLib\{1F9B20F0-0AA5-4EEB-B5ED-FADA0C41D073}\1.0",,"HashTab 1.0 Type Library"
0x0,"Classes\TypeLib\{1F9B20F0-0AA5-4EEB-B5ED-FADA0C41D073}\1.0\0"
0x1,"Classes\TypeLib\{1F9B20F0-0AA5-4EEB-B5ED-FADA0C41D073}\1.0\0\win32",,"X:\Programs\HashTab\HashTab32.dll"
0x1,"Classes\TypeLib\{1F9B20F0-0AA5-4EEB-B5ED-FADA0C41D073}\1.0\FLAGS",,"0"
0x1,"Classes\TypeLib\{1F9B20F0-0AA5-4EEB-B5ED-FADA0C41D073}\1.0\HELPDIR",,"X:\Programs\HashTab"
0x1,"Classes\HashTab.HashPage",,"HashPage Class"
0x1,"Classes\HashTab.HashPage\CLSID",,"{8A56567E-A333-4843-B6E1-C3A262E41D8C}"
0x1,"Classes\HashTab.HashPage\CurVer",,"HashTab.HashPage.1"
0x1,"Microsoft\Windows\CurrentVersion\Shell Extensions\Approved","{8A56567E-A333-4843-B6E1-C3A262E41D8C}","HashTab Property Page"
0x1,"Microsoft\Windows\CurrentVersion\Shell Extensions\Approved","{B1883831-F0D8-4453-8245-EEAAD866DD6E}","HashTab Context Menu"

[Default.AddReg]
0x0,"Software\HashTab"
0x0,"Software\HashTab\Algorithms"
0x4,"Software\HashTab\Algorithms\CRC32","Enabled",0x1
0x4,"Software\HashTab\Algorithms\MD5","Enabled",0x1
0x4,"Software\HashTab\Algorithms\SHA-1","Enabled",0x1


The part right below [Software.AddReg] section
CODE
0X1,"testkey\testsubkey\subsubkey\HashTab",,"{8A56567E-A333-4843-B6E1-C3A262E41D8C}"
0X1,"Classes\*\shellex\PropertySheetHandlers\HashTab",,"{8A56567E-A333-4843-B6E1-C3A262E41D8C}"


I have found some interesting test results. In second line, if i change key value
from REG_SZ to REG_MULTI_SZ and give a second value
CODE
0X1,"Classes\*\shellex\PropertySheetHandlers\HashTab",,"test","{8A56567E-A333-4843-B6E1-C3A262E41D8C}"


The key will still remain of type ox1 (REG_SZ), the value "test" will be SKIPPED and value "{8A56567E-A333-4843-B6E1-C3A262E41D8C}" (now second in row) will be correctly written !?

This puzzles me, because two things should have happened:
1. PEBuilder should have FAILED (with usual pehive lockup bug on error)
2. Hive itself should have been corrupted because default values are always 0x1 (REG_SZ) type

I thought that PEBuilder does not support writing to "Classes" subkey, so i created a dummy
"testkey" and this was located directly under "HKLM\SOFTWARE" and it too failed.

After this i tried another test
CODE
0X1,"Classes\*\shellex\PropertySheetHandlers\HashTab",,,"{8A56567E-A333-4843-B6E1-C3A262E41D8C}"


Note above, after the "HashTab" part there are THREE commas. This alone should have caused PEBuilder to
fail, because (as per plugin online docs) it format is regType, regKey, regValue, regData. This extra
comma CAUSED PEBUILDER TO SKIP BLANK VALUE AND WRITE A CORRECT DATA WITHOUT ERROR.
mbarnes
Hi frizbit

in case your hashtab plugin still has problems

see this post

How are you converting from a windows reg file to BartPE inf file ?
(some of these reg2inf programs also have bugs)

regards
Mike Barnes

CODE
; hashtab.inf
; requires xp sp2

[Version]
Signature= "$Windows NT$"

[PEBuilder]
Name="HashTab 1.9 - http://beeblebrox.org/hashtab/"
Enable=1

[WinntDirectories]
a=Programs\HashTab,2

[SourceDisksFiles]
files\HashTab.dll=a,,1

[Software.AddReg]
0x0, "Classes\*\shellex\PropertySheetHandlers\{8A56567E-A333-4843-B6E1-C3A262E41D8C}"
0x1, "Classes\AppID\HashTab.DLL","AppID","{0A3C1C8E-5829-4CFD-B1CC-475DB010B883}"
0x1, "Classes\AppID\{0A3C1C8E-5829-4CFD-B1CC-475DB010B883}","","HashTab"
0x0, "Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}\InprocServer32"
0x0, "Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}\ProgID"
0x0, "Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}\Programmable"
0x0, "Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}\TypeLib"
0x1, "Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}\VersionIndependentProgID","","HashTab.HashPage"
0x1, "Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}\TypeLib","","{1F9B20F0-0AA5-4EEB-B5ED-FADA0C41D073}"
0x1, "Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}\ProgID","","HashTab.HashPage.1"
0x1, "Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}\InprocServer32","","X:\Programs\HashTab\HashTab.dll"
0x1, "Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}\InprocServer32","ThreadingModel","Apartment"
0x1, "Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}","","HashPage Class"
0x1, "Classes\CLSID\{8A56567E-A333-4843-B6E1-C3A262E41D8C}","AppID","{0A3C1C8E-5829-4CFD-B1CC-475DB010B883}"
0x0, "Classes\Interface\{B3D7DD5D-510B-477C-9521-2BCBCC91762C}\ProxyStubClsid"
0x0, "Classes\Interface\{B3D7DD5D-510B-477C-9521-2BCBCC91762C}\ProxyStubClsid32"
0x1, "Classes\Interface\{B3D7DD5D-510B-477C-9521-2BCBCC91762C}\TypeLib","","{1F9B20F0-0AA5-4EEB-B5ED-FADA0C41D073}"
0x1, "Classes\Interface\{B3D7DD5D-510B-477C-9521-2BCBCC91762C}\TypeLib","Version","1.0"
0x1, "Classes\Interface\{B3D7DD5D-510B-477C-9521-2BCBCC91762C}\ProxyStubClsid32","","{00020424-0000-0000-C000-000000000046}"
0x1, "Classes\Interface\{B3D7DD5D-510B-477C-9521-2BCBCC91762C}\ProxyStubClsid","","{00020424-0000-0000-C000-000000000046}"
0x1, "Classes\Interface\{B3D7DD5D-510B-477C-9521-2BCBCC91762C}","","IHashPage"
0x1, "Classes\TypeLib\{1F9B20F0-0AA5-4EEB-B5ED-FADA0C41D073}\1.0\0\win32","","X:\Programs\HashTab\HashTab.dll"
0x0, "Classes\TypeLib\{1F9B20F0-0AA5-4EEB-B5ED-FADA0C41D073}\1.0\FLAGS"
0x1, "Classes\TypeLib\{1F9B20F0-0AA5-4EEB-B5ED-FADA0C41D073}\1.0\HELPDIR","","X:\Programs\HashTab\"
0x1, "Classes\TypeLib\{1F9B20F0-0AA5-4EEB-B5ED-FADA0C41D073}\1.0\FLAGS","","0"
0x1, "Classes\TypeLib\{1F9B20F0-0AA5-4EEB-B5ED-FADA0C41D073}\1.0","","HashTab 1.0 Type Library"
0x0, "Classes\HashTab.HashPage\CLSID"
0x1, "Classes\HashTab.HashPage\CurVer","","HashTab.HashPage.1"
0x1, "Classes\HashTab.HashPage\CLSID","","{8A56567E-A333-4843-B6E1-C3A262E41D8C}"
0x1, "Classes\HashTab.HashPage","","HashPage Class"
0x1, "Classes\HashTab.HashPage.1\CLSID","","{8A56567E-A333-4843-B6E1-C3A262E41D8C}"
0x1, "Classes\HashTab.HashPage.1","","HashPage Class"
frizbit
Thank you mbarnes for failsafe-inf.

This is how i do it :
-install/setup software with RegShot scanning for changes
-in regedit find all keys that are created or changed and export them
-copy all keys into inf and then manually convert in required format
-similar goes for files (less complicated, they are mostly grouped in single folder)

I know this is tedious and prone to errors, but that's how i like to do it.

The created hashtab plugin no longer has errors, tried it in total commander
and it performed as expected.

PS: Ah yes, and another thing. mbarnes you have shown inf for Hashtab.dll and mine is
HashTab32.dll. I suspect version has changed, so registry entries may differ. There
are too many differences to check for, but if you wish i can attach a new inf (it works for me).
mbarnes
Hi frizbit

I convert Windows reg files to BartPE inf files using reg2inf
(from Paragliders web site although there are several other versions)
This is a lot less error prone than doing it manually

regards
Mike Barnes
frizbit
Thanks mbarnes for the tip about reg2inf.
I will try it on next plugin.
mbarnes
Hi frizbit

To help newbys please publish your corrected version of the HashTab plugin

(put dependencies eg ; source = XP SP2 or later and your name & date in the comments section at the begining)

I have tested it after replacing 0X1 with 0x1 and ,, with ,"",
and removing
0X1,"testkey\testsubkey\subsubkey\HashTab",,"{8A56567E-A333-4843-B6E1-C3A262E41D8C}"


It seems Hashtab v3.00 supports more Hash methods than the older versions but after un-installing the old version then installing V3.00 it still only supports
MD5, CRC32 & SHA-1 by default.

regards
Mike Barnes
frizbit
Hi mbarnes, i did as you suggested.

Please look at this plugin and tell me if anything is not ok.

I followed the plugin structure, i hope it is correct.

For now plugin is here as attachment, but i do not know if there is
official link for all plugins that i can upload to.

Also, the new algorithms are available via settings menu with mouse right
click on hash list.

Click to view attachment
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.