Windows 7 - HKEY_CURRENT_USER vs HKCU
Asked By mawa31
18-Nov-09 10:30 AM

Hi all,
I was laid off from my workplace, but since called back and I am once
again working on their installs. In my absence, user configuration
registry keys were moved from HKCU to HCU. This was done because a
large company evaluating our software for purchase did not like
Windows Installer self repair behavior when our app was initiated.
I have been told that moving the keys to HKU sidesteps this behavior or
appears to.
I know I am going to have to change some .exe's fired as custom actions
to look to this new location, but how does Windows Installer handle
this....
If I have a system search for a registry key under HKCU, which is then
used as a launch condition, will it now look to HKU if not found in
HKCU (which it will now not be).
I hope I am clear on this as I really need some help guidance with
writing to HKU. I have never done so before as there was never any
need.
Unfortunately, a release made it to the field with this change right
before I got back here and its starting to rear its ugly head.
Any information is GREATLY APPRECIATED!
Windows Installer
(1)
XP
(1)
Sogoanwellerto1590592972Yep
(1)
WindowsInstaller
(1)
DISABLEADVTSHORTCUTS
(1)
Wrongwith
(1)
Sidesteps
(1)
Workplace
(1)
mawa31 replied to mawa31
In addtion to any HKU help, is there a way to silence the Windows
Installer self repair dialogs. This may be another solution instead
of trying to hack through with placing stuff in HKU.
Wilson, Phil replied to mawa31

If the app self repairs when first launched then there is something wrong
with it. For example, maybe a custom action removes an installed file (or
registry key), tand hen the shortcut causes a repair to restore the file. So
to prevent the repair:
Best: The component containing the file (or registry key) can have a null
component Id. Ref Component table docs.
Worst?: Use non-advertised shortcuts that do not cause repair. Ref:
DISABLEADVTSHORTCUTS property.
The idea that moving registry keys from one hive to another makes repair go
away is incomprehensible to me. Maybe there is more to it than that? How can
this solve the problem? Do they have a technical explanation or just "well
it went away so we figured that was the solution" comment? There are proper
supported ways to prevent some repairs, and one of those is the right way to
go.
The other thing I do not understand is that hkey_users is a repository for
every user on the system and for default settings. If they wrote the HKU
then I assume they actually wrote to HKU\.DEFAULT or something strange.
--
Phil Wilson
The Definitive Guide to Windows Installer
http://www.apress.com/book/view/1590592972
mawa31 replied to Wilson, Phil

So
go
an
well
er
to
1590592972
Yep, Phil, you guessed it - it worked so I guess it solved the problem
was their approach. They could not see the forest through the trees or
whatever the saying is.
The reason their is self repair is that we require Admin to install
but Power User (on XP now) can run the app. When the non-installing
user initiates the app, there are user keys that get written for that
user.
I was thinking if they went the HKU route, they probably should have
just went HKLM, but I worry about permissions all the time so I do not
know if that would have been a good solution either.
We're currently in the process of reverting our install back to pre-
HKU changes, but I think this issue (getting around the self repair)
is going to raise its head again at some point if this top shelf
customer wants to purchase. Aside from possibly silencing the self
repair - not sidestep, just make the dialogs not display (if possible
at all) - I would guess that writing to HKLM instead would be a better
approach. ???
Any further thoughts, pointers, etc on this is greatly appreciated.
Hey Phil, have you written any other Windows Installer books lately.
I have The Definitive Guide to Windows Installer (2004) but was
wondering if there was something more recent to maybe cover the new
stuff in the engine.
Thanks again!
Wilson, Phil replied to mawa31

Writing to HKLM is generally a better choice. For a multi-user app, these
would be the default set of registry items. The app can then copy these to
HKCU and update them as required when the user first runs the app. HKLM is
readable for limited users. There is not really a practical way to populate
the HKCU items for all potential users of the system. Ironically, the MSI
way to do this is with HKCU key path registry items and have the MSI repair
do them when the user first runs the app, hence the repair dialog. It
should happen only once anyway, so maybe it is possible to persuade the
customer that this is the way to get the registry populated for all users,
even a user that does not even exist yet. I do not know of any way to suppress
the repair progress dialog in your situation.
Writing a book is very tedious. By the time you have seen the same text 20
million times in all the edits you are ready to go nuts. I'd do the update if
I had more time, because it is very time consuming too.
--
Phil Wilson
The Definitive Guide to Windows Installer
http://www.apress.com/book/view/1590592972
Yep, Phil, you guessed it - it worked so I guess it solved the problem
was their approach. They could not see the forest through the trees or
whatever the saying is.
The reason their is self repair is that we require Admin to install
but Power User (on XP now) can run the app. When the non-installing
user initiates the app, there are user keys that get written for that
user.
90 Updates Fail after reinstalling XP Pro Windows 7 Reinstalled XPP (update not clean). First update For Windows Installer 3.1 went good. Reboot. Next update attempted 90 updates and all failed. Suggestions?? Thanks!! Windows Update Discussions Windows XP (1) Internet Explorer 7 (1) Windows Installer (1) Windows Update (1) Windows Media (1) Outlook (1) XP (1) TenneseeToddy (1) These
Updates unable to be installed after repairing windows xp Windows 7 Hi, I owned a Dell XPS 1210, running genuine windows xp sp2. There were some issue with the mup.sys file and was advised to repair the windows installation with the installation cd provided by Dell. I did that and all was ok until windows started performing automatic updates. There were a lot of updates and these were downloading and installing ok initially. However, in the most recent windows update, the following updates were not able to be installed successfully after they were downloaded
Can't install Windows XP updates Windows 7 i keep getting the message to download 76 updates. . .i download them and then code and saying that these cannot be installed: These are the updates Critical Update for Windows XP (KB886185) Security Update for Windows XP (KB885836) Security Update for Windows XP (KB888302) Security Update for Windows XP (KB891781) Security Update for Windows XP (KB885835) Security
Some updates were not installed Windows 7 Im using windows xp sp2. I've seen so many threads down below, but couldn't find one helpful even though i have tried one of 'em with regards to windows genuine validation tools. The same error and message keep on popping up zillions of times it sounds as hell as below. The following updates were not installed: Security Update for Windows XP (KB873339) Critical Update for Windows XP (KB886185) Security Update for Windows XP (KB885836) Security Update for Windows XP (KB888302) Security Update
windows will not download securtiy updates Windows 7 Microsoft send me a message to download and install updates to my computer, and when i do. The security updates fail. These are the updates: Critical Update for Office XP on Windows XP Service Pack 2 (KB885884) Security Update for Windows XP (KB873339) Critical Update for Windows XP (KB886185) Security Update for Windows XP (KB885836) Security Update for Windows XP (KB888302) Security