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




"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?
    ... "If the user of the device is adding registry ... entries, you should *tell him* that the OS upgrade will destroy them and ... the upgrade." ... So, hives will stay ...
    (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: How Do I to update kernel keeping registry settings?
    ... component that needed those modified registry settings has already crashed. ... 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 ...
    (microsoft.public.windowsce.embedded)