0

Assuming that an MSI package writes to the HKCU registry branch as part of its installation:

If the application subsequently alters these values, or these values are altered in another way, will the self-heal mechanism of the MSI revert these values to what MSI says they should be?

CJ7
  • 22,579
  • 65
  • 193
  • 321

1 Answers1

0

Yes, provided you have a mechansim to trigger resilency. Typically this is COM activation or an Advertised Shortcut. It can also be code that you put into your application to call the MSI API's.

If you have a situation like an Office AddIn where another process hosts your code and you have no shortcuts or COM activations occuring you can use this trick:

InstallTalk: Using Active Setup to Repair User Settings

Also realize, for the reocrd, that this is a pretty heavy and sometimes annoying process. You have to make sure your MSI is available if files are needed and a user see's a progress bar while the repair occurs. If something fails it can happen over and over. I've seen this in conference rooms where people logon for the first time and Office fails to do it's repair.

Another approach is to shift this requirement into the application and make it responsible for updating the user profile itself on first run.

Also, realize that MSI can't remove all these registry values in all the profiles on uninstall. It's impossible because the user profiles might be roaming and/or not even loaded.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • If it's a per-user installation, then wouldn't uninstallation be something that occurs according to which user is logged in, which would mean the registry values would in fact be removed? – CJ7 Feb 17 '12 at 13:57
  • A per-user would only install to HKCU of the user who did the install and yes they would be in scope to be removed. However, realize that this causes other problems. See Rule #30 http://blogs.msdn.com/b/windows_installer_team/archive/2006/05/24/605835.aspx – Christopher Painter Feb 17 '12 at 15:05