Re: How Do I to update kernel keeping registry settings?



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.





.



Relevant Pages

  • Re: How Do I to update kernel keeping registry settings?
    ... Build the new kernel with "reginit.ini" file of the installed kernel on ... So, hives will stay ... accept the fact that an OS upgrade is a major event similar to ... ensure that the upgrade didn't cause any registry changes in from the ...
    (microsoft.public.windowsce.embedded)
  • Re: How Do I to update kernel keeping registry settings?
    ... Your English is better than my "anything else", ... registry hives are stamped with a ... Our users expect that an OS upgrade will involve a reset of the ...
    (microsoft.public.windowsce.embedded)
  • RE: for..in..do
    ... ' Configures the registry settings. ... ' Loads the individual user profile hives and configures needed USER ... Dim strUserSID, Subfolder, UserPaths, strRegPath, strRegistryHive, ... registry, import the reg file, then unload the reg hive. ...
    (microsoft.public.scripting.vbscript)
  • Re: Storing persistent configuration on separate partition using RegLoadKey
    ... it would be beneficial to move to use an application profile that can be moved around much easier that registry ... is the only EWF protected partition and is about ... >> store persistent configuration information in a file on the D: ... >> the registry since one can only load hives directly under HKLM or HKU ...
    (microsoft.public.windowsxp.embedded)
  • Re: Registry cleaner
    ... entries from my registry. ... entries exist in many different places in the hives, ... and think about giving USEFULL RESPONSES. ...
    (microsoft.public.windowsxp.general)