Jump to content











Photo
- - - - -

Failed to Load Registry Hive - HoJoPE Hives Factory Script


  • Please log in to reply
19 replies to this topic

#1 pantner

pantner

    Member

  • Members
  • 31 posts
  •  
    Australia

Posted 07 October 2009 - 02:59 AM

ok, been very busy so haven't touched Winbuilder in a while.

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 :hypocrite:

any suggestions?

#2 pantner

pantner

    Member

  • Members
  • 31 posts
  •  
    Australia

Posted 07 October 2009 - 03:31 AM

got it working.

after messing around for 30mins shutting down and running winbuilder, clearing caches and temp folders i restarted my computer and now it works... :hypocrite:

#3 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 07 October 2009 - 07:15 AM

The faster way is to start regedit and unmount the hive, which is left from a previous stopped build.

Peter :hypocrite:

#4 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 07 October 2009 - 07:33 AM

@pantner

There is "Clean Temporary Files" button on main screen of LiveXP which also unmount redundant hive left from a failure during build.

#5 pantner

pantner

    Member

  • Members
  • 31 posts
  •  
    Australia

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 :hypocrite:


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 :hypocrite:

#6 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 07 October 2009 - 07:58 AM

It only closes hives which are opened with API - standard names.

When a script mounted a hive with an individual name, the clean function cannot know that.

Peter

#7 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 07 October 2009 - 08:04 AM

I did that and it didn't help :hypocrite:

Thanks panther, and thanks psc.

@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.

#8 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 07 October 2009 - 08:21 AM

http://www.boot-land...?...ost&p=24366

Peter :hypocrite:

#9 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 07 October 2009 - 08:40 AM

@psc

works nice :hypocrite:

An idea,

is it needed/possible to close only hives from a specific folder, ex: %targetdir%\System32\config\

edit (or file)

#10 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 07 October 2009 - 09:51 AM

I currently do not know a way, how to get the physical file name of a mounted hive.

Maybe some user can tell me.

Peter

#11 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 07 October 2009 - 10:06 AM

@psc

:hypocrite:
At least normal users wont get into this trouble that cause restart of pc again :hypocrite: :smart:

I currently do not know a way, how to get the physical file name of a mounted hive.

"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 copy :hypocrite:


@pantner

now "Clean Temporary Files" button unmounts ALL mounted hives <_<
Update your scripts (specifically script.project) :smart:

#12 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 07 October 2009 - 10:07 AM

I currently do not know a way, how to get the physical file name of a mounted hive.

There is NO known way AFAIK.

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 :hypocrite:) 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. :hypocrite:

:hypocrite:

jaclaz

#13 karyonix

karyonix

    Frequent Member

  • Advanced user
  • 481 posts
  •  
    Thailand

Posted 07 October 2009 - 10:35 AM

I currently do not know a way, how to get the physical file name of a mounted hive.

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.

#14 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 07 October 2009 - 10:45 AM

However, I don't known how to determine drive letters of \Device\HarddiskVolumeN.

Good. :hypocrite:

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

:hypocrite:

jaclaz

#15 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

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.


:hypocrite:

I'm rather sure that I now can fullfill lancelot's suggestion.

Peter

#16 paraglider

paraglider

    Gold Member

  • .script developer
  • 1743 posts
  • Location:NC,USA
  •  
    United States

Posted 07 October 2009 - 12:09 PM

Don't think there is such a function in the regular registry api. You would need access to the kernel memory structures. May be something in the native api or you may need to write a device driver to access the kernel. Here is information you would need if you had access to the kernel data structures:

http://moyix.blogspo...stry-hives.html

#17 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 07 October 2009 - 02:40 PM

:hypocrite:

I'm rather sure that I now can fullfill lancelot's suggestion.

Peter


Done :thumbsup:

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 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 07 October 2009 - 08:03 PM

@psc

thanks a lot :thumbsup:, works nice in my tests, if you agree (if there is no harm danger) i will put it fully to livexp tomorrow. :hypocrite:

#19 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 07 October 2009 - 08:58 PM

I'm sure there is no harm.

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 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 07 October 2009 - 09:05 PM

'OnExit' <_< ==> When the build exits, everything should be 'forgotten' :thumbsup:

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 :hypocrite: (hitting blue button with forgeting opened registry hive, maybe manually :hypocrite:)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users