Link to home
Start Free TrialLog in
Avatar of chensu
chensuFlag for Canada

asked on

Values of a Regsitry Key Automatically Restored?

Our software product creates a registry key

HKEY_CURRENT_USER\Software\Company Name\Product Name\Items\ItemA\Info1

Info1 is a subkey and it has some values.

When our software shuts down, we will

1. delete the Info1 subkey to completely clean up.
2. recreate the Info1 subkey.
3. put some values there to save the states.

Everything works fine on all machines except one. This machine has Windows Server 2003 R2 Standard Edition Service Park 1. Some other machines also have the same OS. But the problem only happens on this machine. After step 2 and before step 3 above, some values are automatically restored. To isolate the problem, I've written a small program to do exactly the same thing. My small program does step 1, 2 and 3. In between the steps, I pop up a message box to pause the execution. After step 1 and before step 2, I verify with the Registry Editor that the Info1 subkey is gone. After step 2 and before step 3, I verify with the Registry Editor that the Info1 subkey is created without any values. But on that particular machine, some values are automatically restored right after I recreate the Info1 subkey. The strange thing is that those values are NOT the last saved values and they are the same every time.

Our software uses InstallShield and MSI.

Does anyone have any idea what is going on? Is this an MSI feature? Is this an OS feature?

Thanks.
Avatar of Jeffrey Kane - TechSoEasy
Jeffrey Kane - TechSoEasy
Flag of United States of America image

You do realize that HKEY_CURRENT_USER is only a mirror container?

Jeff
TechSoEasy
I should clarify that... HKEY_CURRENT_USER is built from the HKEY_USERS\SecurityID key upon login, so it's not a static key.

http://technet2.microsoft.com/WindowsServer/en/Library/6b6d2dcc-a083-4c49-9000-6f1324b208771033.mspx?mfr=true

Jeff
TechSoEasy

Avatar of chensu

ASKER

Thanks for your response.

Yes, I do realize that. But the problem doesn't happen at the time when I log in. Just to make sure, I tried monitoring the HKEY_USERS\SecurityID key and it produced the same result.

Any ideas?
This is not really an area I'm familiar with... it's probably better asked in the Windows Programming TA (http:Programming/Programming_Platforms/Win_Prog/), but in the mean time, take a look at this reference article:  http://www.microsoft.com/technet/desktopdeployment/bdd/standard/SupApp_5.mspx

If you want to place a pointer question over in the Windows Programming TA to this one, that would be a good idea:
http:help.jsp#hi262

Jeff
TechSoEasy
Avatar of chensu

ASKER

I think it is more or less an install issue or OS issue. The program I wrote is too small to make a mistake, not to mention that my program doesn't have those value names at all. I've posted the question to msi newsgroup.

Thanks.
HKEY_CURRENT_USER is also built from the User's profile (NTUSER.DAT).  My bet is their profile is corrupt or the permissions on it are incorrect.
Or the DEFAULT USER's NTUSER.DAT is corrupt or has bad permissions.

Jeff
TechSoEasy
Ahh... you didn't mention that you were logged in remotely or had this server configured as a Terminal Server!

Jeff
TechSoEasy
Avatar of chensu

ASKER

It has nothing to do with whether the user is logged in remotely or not. It does have something to do with Terminal Server. But I didn't know it was Terminal Server enabled in that I don't own the machine neither did I configure it. And I didn't even know it would matter.

Thanks for the help anyway.
Well, now you do know that it matters.  :-)

Jeff
TechSoEasy
Avatar of chensu

ASKER

Yes, indeed I learned something new. :-)
ASKER CERTIFIED SOLUTION
Avatar of RomMod
RomMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial