如果删除文件,为什么MSI安装程序会重新配置? [英] Why does the MSI installer reconfigure if I delete a file?

查看:117
本文介绍了如果删除文件,为什么MSI安装程序会重新配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Visual Studio 2008中创建了一个MSI安装程序包.问题是,在安装后,如果我删除了任何已安装的文件,则会出现问题.这不是我的安装程序包的预期行为.我的文件安装属性为:

I have created an MSI installer package in Visual Studio 2008. The problem is that after install, if I delete ANY of the installed files. This is not my intended behavior for my installer package. My File installation properties are:

PackageAs vsdpaDefault 永久错误 只读错误 注册vsdrfDoNotRegister 系统错误 传递错误 重大错误

PackageAs vsdpaDefault Permanent False ReadOnly False Register vsdrfDoNotRegister System False Transitive False Vital False

如果这很简单,请原谅我.我无法相信我无法让Google放弃答案. :)

If this is trivial, please forgive me. I can't believe I have not been able to get Google to give up the answer. :)

推荐答案

Windows Installer 是一种部署技术,其作用是安装指定的文件并注册表设置,并将其保留在指定的安装位置,并确保它们是正确的版本-为此目的,自我修复或弹性是一种机制.它的操作与开发人员即时交换文件以进行调试,开发和测试的需求相冲突.

Windows Installer is a deployment technology, its job is to install the specified files and registry settings and keep them in the specified install locations and to ensure they are the right versions - self-repair or resiliency is a mechanism to that end. Its operation conflicts with a developer's need to exchange files on the fly for debugging, development and testing.

作为开发人员,您可能有兴趣部署MSI,然后即时删除或替换文件以进行调试.在这些情况下,MSI可能会令人讨厌,因为它永远不会停止执行其工作,并且会重新安装正确的文件.这称为"自我修复".可能会很烦人! :-).

As a developer you may be interested in deploying your MSI and then deleting or replacing files on the fly to debug things. In these cases MSI can be a nuisance because it never stops doing its job and will reinstall the correct files. This is called "self-repair" and can be spectacularly annoying! :-).

有很多方法可以解决此问题,MSI非常复杂. 由于自我修复"通常从"advertised shortcut"调用此方法来避免此MSI功能的最简单方法是直接从文件系统而不是通过快捷方式启动EXE文件 .除了最复杂的EXE文件外,这将绕过MSI自修复机制.您还可以在桌面上手动创建一个非广告发布的快捷方式,该快捷方式不会触发自我修复(右键单击并按住可执行文件,同时按住鼠标右键,将其拖放到桌面上,然后在空白处释放按钮并点击在此处创建快捷方式").

There are a lot of ways to work around this, MSI is quite complex. Since the "self-repair" is normally invoked from an "advertised shortcut" the easiest way to avoid this MSI feature is to launch the EXE file directly from the file system and not via a shortcut. This bypasses the MSI self repair mechanism for all but the most complex EXE files. You can also manually create a non-advertised shortcut on the desktop that will not trigger a self-repair (right click and hold executable and whilst holding down the right mouse button, drag-and-drop to desktop and release button over an empty spot and click "Create shortcut here").

出于记录目的,自我修复由"自我修复入口点";用于密钥路径验证.它们包括公告的快捷方式,文件关联,COM注册表数据等.

For the record self-repair is triggered by "self-repair entry points" for key-path validation. They include advertised shortcuts, file associations, COM registry data among other things.

自我修复弹性(其正式名称)还有很多,请检查

There is a lot more to self-repair, or resiliency which is its official name, please check this comprehensive article on self-repair problems to find ways to resolve your specific problem. It is a long article, but it should be worth the read if you have self-repair problems.

更新,2018年10月 :

详细的自我修复 :比任何人都想了解的自我修复更重要:

Self-Repair In Detail: More than anyone wants to know about self-repair:

  1. 自我修复-解释
  2. 自我修复-找到现实的解决方案
  3. 自我修复-如何避免在自己的包装中使用它
  1. Self-repair - explained
  2. Self-repair - finding real-world solutions
  3. Self-repair - how to avoid it in your own package


链接 :


Links:

  • Similar: Visual Studio 2015 msi build initiates another installation
  • RestartManager causes worker role to restart

这篇关于如果删除文件,为什么MSI安装程序会重新配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆