简体   繁体   English

MSI会自我修复还原注册表项吗?

[英]Will MSI self-heal revert registry entries?

Assuming that an MSI package writes to the HKCU registry branch as part of its installation: 假定MSI软件包在安装过程中写入HKCU注册表分支:

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? 如果应用程序随后更改了这些值,或者以其他方式更改了这些值,MSI的自愈机制是否会将这些值恢复为MSI所说的值?

Yes, provided you have a mechansim to trigger resilency. 是的,只要您具有触发弹性的机制即可。 Typically this is COM activation or an Advertised Shortcut. 通常,这是COM激活或广告快捷方式。 It can also be code that you put into your application to call the MSI API's. 也可以是您放入应用程序中以调用MSI API的代码。

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: 如果遇到类似Office AddIn的情况,其中另一个进程托管您的代码,并且没有发生快捷方式或COM激活,则可以使用以下技巧:

InstallTalk: Using Active Setup to Repair User Settings InstallTalk:使用活动设置修复用户设置

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. 如果需要文件,则必须确保MSI可用,并且在修复时用户会看到进度条。 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. 我已经在会议室里看到了这一点,那里的人们是第一次登录,而Office无法对其进行修复。

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. 另外,请意识到,MSI在卸载时无法删除所有配置文件中的所有这些注册表值。 It's impossible because the user profiles might be roaming and/or not even loaded. 这是不可能的,因为用户配置文件可能正在漫游和/或什至没有加载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM