Re: How Do I to update kernel keeping registry settings?
- From: Miguel Ángel Pérez <MiguelngelPrez@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 3 Apr 2008 10:11:02 -0700
Thanks a lot for the information. I am trying to clarify my doubts.
I want to merge registry settings between old and new kernel. I should take
into account subkeys like "HKEY_LOCAL_MACHINE\Drivers\Active" because Device
Manager writes dynamically here the order of the loaded drivers during
booting phase. Therefore, I would ignore this entry.
My strategy could be the following:
1. Export HKCU and HKLM entries to a text file.
2. Compare this file with the new registry.
3. Next, if a key does not exist inside new registry, then set it. And if
there is a duplicated key, then do not overwrite the new key.
What do you think about this?
Thanks a lot.
Bye.
--
Miguel Ángel Pérez Ruiz
"Paul G. Tobey [eMVP]" wrote:
.
"Miguel Pérez" <MiguelPrez@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7D7CD71A-691C-4EC5-A09F-794E971AA93C@xxxxxxxxxxxxxxxx
Hi Paul,
First of all, thank you very much for your quick answer. I apologize for
my
English. I am going to try to explain better my problem.
Your English is better than my "anything else", so don't worry about it!
At the moment, I am working on how to manage upgrades that require
registry
modifications. As I understand it, registry hives are stamped with a
signature indicating the registry from which they are based and that
signature RegSaveKey operates on one hive at a time; calling this API on
HKEY_LOCAL_MACHINE will save the system hive to a file, and calling it on
HKEY_CURRENT_USER will save the current user's hive. Conversely,
RegReplaceKey can only be used with HKEY_LOCAL_MACHINE. It replaces the
system hive only. To replace a user hive, the OEM may call SetCurrentUser
with a NULL user name to log off the current user, and then call CopyFile
to
replace the user's invalid hive with a saved known viable hive must match
that of nk.bin's default registry or it will replace the existing registry
with the default. You can imagine the problems I might run into when I do
upgrades. Customers won't be happy if a firmware upgrade destroys their
registry settings. Do you have any experience with this problem?
No. Our users expect that an OS upgrade will involve a reset of the
registry, so they arrange to either regenerate the settings that they use or
use Remote Registry Editor to export a .REG file containing the section of
the registry that they care about, and reimport that on the device (we have
a utility), after the upgrade. You cannot do anything sensible by saving
the entire registry and then trying to restore it.
The main aim is to restore registry settings after I do an upgrade. The
backup and recover of the hive registry is possible with two APIs
(RegSaveKey, RegReplaceKey) but they work only for HKLM entries. I would
like
to backup HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER, too.
No, I don't think that this really *is* what you want. You're saying that
you made a change to the OS which involved changing the registry, but now
you're saying that you want to return the registry, after the upgrade, to
the state before the upgrade. If that's the case, whatever registry change
was made to the OS will be LOST. Why make the registry change in the OS at
all, if that's what you're going to do?
In addition to the previous statement, I was trying a Microsoft's
recommendation. To replace a user hive (HKCU), the OEM may call
SetCurrentUser with a NULL user name to log off the current user, and then
call CopyFile to replace the user's invalid hive with a saved known viable
hive. However, it does not work. :-(
I'm not sure about this (and, of course, as you can tell from above, I don't
think that you want to do this anyway). It seems to me that, if, before the
upgrade, you did a SetCurrentUser(NULL), then copied the old user hive to
some new filename (backed it up), and then, after the upgrade, you did
SetCurrentUser(NULL), and copied the backup over the 'new OS' user hive and
did a reboot, that that should be enough to do it. No?
Paul T.
- Follow-Ups:
- Re: How Do I to update kernel keeping registry settings?
- From: Dean Ramsier
- Re: How Do I to update kernel keeping registry settings?
- References:
- How Do I to update kernel keeping registry settings?
- From: Miguel
- Re: How Do I to update kernel keeping registry settings?
- From: Paul G. Tobey [eMVP]
- Re: How Do I to update kernel keeping registry settings?
- From: Miguel Pérez
- Re: How Do I to update kernel keeping registry settings?
- From: Paul G. Tobey [eMVP]
- How Do I to update kernel keeping registry settings?
- Prev by Date: Re: Example PCI driver?
- Next by Date: Re: Example PCI driver?
- Previous by thread: Re: How Do I to update kernel keeping registry settings?
- Next by thread: Re: How Do I to update kernel keeping registry settings?
- Index(es):
Relevant Pages
|
|