如果我删除文件,为什么 MSI 安装程序会重新配置? [英] Why does the MSI installer reconfigure if I delete a file?
问题描述
我在 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永久错误只读 False注册 vsdrfDoNotRegister系统错误传递错误重要错误
PackageAs vsdpaDefault Permanent False ReadOnly False Register vsdrfDoNotRegister System False Transitive False Vital False
如果这是微不足道的,请原谅我.我不敢相信我无法让谷歌放弃答案.:)
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.
self-repair 或正式名称 resilency 还有很多,请查看 这篇关于自我修复问题的综合文章解决您的特定问题的方法.文章很长,但如果你有自我修复的问题,应该值得一读.
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:
链接:
- 类似:Visual Studio 2015 msi 构建启动另一个安装
- RestartManager 导致辅助角色重启
- 在 msi 安装程序中修复选项的用途是什么,它的实际作用是什么(内部)?
- 禁用已安装程序的 MSI 自动修复
这篇关于如果我删除文件,为什么 MSI 安装程序会重新配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!