Re: How Do I to update kernel keeping registry settings?
- From: "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT com>
- Date: Tue, 8 Apr 2008 09:45:11 -0700
My inclination is to say, "If the user of the device is adding registry
entries, you should *tell him* that the OS upgrade will destroy them and
give him some suggestions for saving his critical settings, if any, before
the upgrade."
Trying to do this all yourself is just going to be a nightmare. You're
going to keep doing this *forever*?! Every time you have an upgrade, maybe
twice a year or something, you have to generate a new REG file? And people
have to make sure that they install all of the upgrade REG files whenever
they do an upgrade (what if they miss one? They lose the settings that were
new with that new OS). No matter what scheme you come up with, there are at
least as many disadvantages as there are advantages. Are you sure that your
users are even *using* the registry, as opposed to having configuration
files for any application-specific settings that they might have? Maybe
it's just not even a problem...
Paul T.
"Miguel Ángel Pérez" <MiguelngelPrez@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:12196CF3-CC74-430E-A83F-BE5A143AD97C@xxxxxxxxxxxxxxxx
Thanks a lot for the information. I think you are right. I would get into
a
mess with my last possible solution. What do you think about the
following?
1. Build the new kernel with "reginit.ini" file of the installed kernel on
the target (as from now, the previous kernel). So, hives will stay
persistent. I could use "pbpostmakeimg.bat" file to overwrite the new
"reginit.ini" file with the previous one before "nk.bin" file has been
created.
2. Extract differences between the new kernel and the previous kernel.
3. Use a CAB file or an application in order to set, modify or delete keys
from the registry.
Any recommendation is welcome. Thanks.
Have a nice day!
--
Miguel Ángel Pérez Ruiz
"Dean Ramsier" wrote:
I think you're asking for trouble. You can't save/restore registry
entries
that you don't understand because you don't know how they are used. This
also doesn't help you if your upgraded image removes a previously
existing
reg entry. You're almost certain to create problems that are very
difficult
to solve.
Instead, accept the fact that an OS upgrade is a major event similar to
reinstalling Windows on your desktop. In this case, if you are careful
to
ensure that the upgrade didn't cause any registry changes in from the
original base image then you won't lose your registry hives (hive
validity
is based on a signature created from the base registry).
If you do need to persist registry entries, then limit the entries to
well
known ones if there are any. Save them by specifying them, not be
leaving
out certain ones that you know to be a problem.
--
Dean Ramsier - eMVP
BSQUARE Corporation
"Miguel Ángel Pérez" <MiguelngelPrez@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:968FFBFF-5697-4106-8FE6-1C0741582EF3@xxxxxxxxxxxxxxxx
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.
.
- 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]
- Re: How Do I to update kernel keeping registry settings?
- From: Miguel Ángel Pérez
- Re: How Do I to update kernel keeping registry settings?
- From: Dean Ramsier
- Re: How Do I to update kernel keeping registry settings?
- From: Miguel Ángel Pérez
- How Do I to update kernel keeping registry settings?
- Prev by Date: Re: How Do I to update kernel keeping registry settings?
- Next by Date: Re: Has anyone had their Ethernet port "Lockup"?
- 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
|
|