EnumUsersReg + RegUnLoadKey
Hi all!
I found this very usefull header file EnumUsersReg.nsh (http://nsis.sourceforge.net/EnumUsersReg) and did some slight changes to it for my purposes.
Now the basic concept for logged-off users is to load their NTUSER.dat into the registry under HKU. This is done by the RegLoadKey Function (http://msdn.microsoft.com/en-us/libr...=VS.85%29.aspx). After reading/ editing the Reg values the hive is unloaded. This is done by the RegUnLoadKey Function (http://msdn.microsoft.com/en-us/libr...=VS.85%29.aspx).
So far, so good.
One major problem I encountered is that if the installer crashes before the loaded hives were unloaded again they remain which leads to the situation that the respective users cannot logg-on (or only with a temporary profile).
I tried to check if there are any "old" hives on installer start. But I have difficulties as I cannot remove/ unload them with RegUnLoadKey. Only a reboot removes them "automatically".
My question now is if there is any method other than to reboot the system to unload unwanted remained hives from the Registry?
Are there any additional things to make this technique most robust/ stable?
Many thanks for any help, hints, tipps etc.!
Gunther