Failed to Load Registry Hive - HoJoPE Hives Factory Script
#1
Posted 07 October 2009 - 02:59 AM
Had some time to look at it and have been running into a problem or 2.
When i try to make my LiveXP build i get this error
RegHiveLoad - Failed to load registry hive: [WB-Setup] From file: [%BaseDir%\Target\LiveXP\I386\System32\setupreg.hiv]
The file does exist, so i have no idea what to do
any suggestions?
#2
Posted 07 October 2009 - 03:31 AM
after messing around for 30mins shutting down and running winbuilder, clearing caches and temp folders i restarted my computer and now it works...
#3
Posted 07 October 2009 - 07:15 AM
Peter
#4
Posted 07 October 2009 - 07:33 AM
There is "Clean Temporary Files" button on main screen of LiveXP which also unmount redundant hive left from a failure during build.
#5
Posted 07 October 2009 - 07:47 AM
The faster way is to start regedit and unmount the hive, which is left from a previous stopped build.
Peter
Thanks, didn't know that!
@pantner
There is "Clean Temporary Files" button on main screen of LiveXP which also unmount redundant hive left from a failure during build.
I did that and it didn't help
#6
Posted 07 October 2009 - 07:58 AM
When a script mounted a hive with an individual name, the clean function cannot know that.
Peter
#7
Posted 07 October 2009 - 08:04 AM
Thanks panther, and thanks psc.I did that and it didn't help
@psc
I slightly remember there was a utility made by you which closes all hives. Maybe my memory tricks me ! Can you point the right direction.
#9
Posted 07 October 2009 - 08:40 AM
works nice
An idea,
is it needed/possible to close only hives from a specific folder, ex: %targetdir%\System32\config\
edit (or file)
#10
Posted 07 October 2009 - 09:51 AM
Maybe some user can tell me.
Peter
#11
Posted 07 October 2009 - 10:06 AM
At least normal users wont get into this trouble that cause restart of pc again
"physical file name" i guess you mean the hive name on registry since we can check if hive file(s) mounted by trying to delete or copyI currently do not know a way, how to get the physical file name of a mounted hive.
@pantner
now "Clean Temporary Files" button unmounts ALL mounted hives
Update your scripts (specifically script.project)
#12
Posted 07 October 2009 - 10:07 AM
There is NO known way AFAIK.I currently do not know a way, how to get the physical file name of a mounted hive.
Maybe it would be time you could consider this kind of approach:
http://www.boot-land...?showtopic=7681
If we (please read you in this case, as my programming skills are near to 0 ) adopt an independent and "filesystem oriented" approach, it should be possible and relatively easy to log filesystem activities.
Not a priority, of course, but something you should keep in a corner of your mind for when there are no more important things to fix.
jaclaz
#13
Posted 07 October 2009 - 10:35 AM
See registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\hivelist .I currently do not know a way, how to get the physical file name of a mounted hive.
It has values like these.
\REGISTRY\MACHINE\SOFTWARE REG_SZ \Device\HarddiskVolume1\Windows\System32\config\SOFTWARE
\REGISTRY\MACHINE\SYSTEM REG_SZ \Device\HarddiskVolume1\Windows\System32\config\SYSTEM
However, I don't known how to determine drive letters of \Device\HarddiskVolumeN.
#14
Posted 07 October 2009 - 10:45 AM
Good.However, I don't known how to determine drive letters of \Device\HarddiskVolumeN.
The \Device\HarddiskVolumeN is a dynamic value.
It can be found by dosdev:
http://www.boot-land...?...c=6492&st=3
or dd --list:
http://www.boot-land...?showtopic=8219
jaclaz
#15
Posted 07 October 2009 - 11:56 AM
See registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\hivelist .
It has values like these.
\REGISTRY\MACHINE\SOFTWARE REG_SZ \Device\HarddiskVolume1\Windows\System32\config\SOFTWARE
\REGISTRY\MACHINE\SYSTEM REG_SZ \Device\HarddiskVolume1\Windows\System32\config\SYSTEM
However, I don't known how to determine drive letters of \Device\HarddiskVolumeN.
I'm rather sure that I now can fullfill lancelot's suggestion.
Peter
#16
Posted 07 October 2009 - 12:09 PM
http://moyix.blogspo...stry-hives.html
#17
Posted 07 October 2009 - 02:40 PM
I'm rather sure that I now can fullfill lancelot's suggestion.
Peter
Done
See http://www.boot-land...?...ost&p=81169
@Paraglider: Using native API was not necessary:
Buffer := AllocMem(DefBufferSize);
HivePath := ParamStr(1);
DosDrive := AnsiLeftStr(HivePath, 2);
NTDrive := DOS2NT(DosDrive);
HivePath := AnsiReplaceText(HivePath, DosDrive, NTDrive);
Status := RegOpenKeyEx(HKEY_LOCAL_MACHINE, PAnsiChar('SYSTEM\CurrentControlSet\Control\hivelist'), 0, KEY_READ,regKey);
if Status = ERROR_SUCCESS then
begin
childNum := 0;
repeat
ValueSize := DefValueSize;
BufferSize := DefBufferSize;
Status := RegEnumValue(regKey, childNum, PChar(childName), ValueSize, nil, @KeyType, Buffer, @BufferSize);
if Status = ERROR_SUCCESS then
begin
key := getString(ChildName);
if AnsiStartsText(cHKLM_code, key) then
begin
Value := BinToString(keyType, buffer, BufferSize);
if AnsiStartsText(HivePath, Value) then
begin
Key := AnsiReplaceText(Key, cHKLM_code, '');
RegUnLoadHive(HKEY_LOCAL_MACHINE, key);
Dec(childNum);
end;
end;
end;
Inc(childNum);
until Status <> ERROR_SUCCESS;
RegCloseKey(regKey);
FreeMem(Buffer);
end;
function DOS2NT(const DOS: string): string;
var
buf: string;
begin
SetLength(buf, MAX_PATH);
QueryDosDevice(PAnsiChar(DOS), PAnsiChar(buf), Length(buf));
Result := getString(buf);
end;
Peter
#18
Posted 07 October 2009 - 08:03 PM
thanks a lot , works nice in my tests, if you agree (if there is no harm danger) i will put it fully to livexp tomorrow.
#19
Posted 07 October 2009 - 08:58 PM
Allow me a suggestion:
If possible, put it into 'OnExit' rather than into (or additional to) the project's 'clean' button.
When the build exits, everything should be 'forgotten'
Peter
#20
Posted 07 October 2009 - 09:05 PM
additional to the project's 'clean button => reason ===> sometimes winbuilder halts unexpectadly and user probably would like to start with cleaning first.
and to the very early start of project (hitting blue button with forgeting opened registry hive, maybe manually )
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users