Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
793 views
in Technique[技术] by (71.8m points)

wix - Why does the MSI installer reconfigure if I delete a file?

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 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. :)

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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! :-).

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").

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.


UPDATE, October 2018:

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

  1. Self-repair - explained
  2. Self-repair - finding real-world solutions
  3. Self-repair - how to avoid it in your own package

Links:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...