How to disable recovering missed files for Visual Studio Installer Projects?

人盡茶涼 提交于 2020-02-05 13:17:06

问题


I created a program that uses images from the Blizzard API service. I created an installer for the program, and I place the images in the "User's Application Data Folder". Installation is excellent, the images are unpacked into the folder "AppData / Roaming / MyApp".

There is a need for the images to be deleted, and the program will download them from the Blizzard service itself. But when you delete the installed files, the installer starts restoring the files, and the program cannot download fresh data from the Blizzard service.

Is it possible to disable recovery for the folder "AppData / Roaming / MyApp"? Or you have any idea how to resolve it?

For creating installer I using "Microsoft Visual Studio Installer Projects" https://marketplace.visualstudio.com/items?itemName=VisualStudioClient.MicrosoftVisualStudio2017InstallerProjects

Help me please.


回答1:


Download Files: Can you install your service and then download the files from the server and not install them via MSI at all? This will de-couple them from any MSI self-repair interference. MSI does not know anything about the files in this scenario.

Self-Repair: Windows Installer (MSI) self-repair is a very intricate thing to deal with: Why does the MSI installer reconfigure if I delete a file?. And here is a more elaborate piece: How do I avoid triggering MSI self-repair with my WiX / MSI package? I wouldn't really recommend studying it too much: the concept is simple (keep installed files in correct version), but the problems that result are intricate and difficult to fix.

Blank GUIDs: There is a method where you can install the files via components that has a blank GUID. Then they are simply installed and never checked again. This should eliminate self-repair problems.

Read-Only Templates: Finally you can install a bunch of template files to a per-machine path (for example under program files) and then copy them in place for each user. Can be very effective. You can then overwrite them and delete at will.


Recommendation: I would install my service and download the files from the server on demand. That should give you full control of the whole process from code that is easier to debug than setup code (custom actions).



来源:https://stackoverflow.com/questions/57606517/how-to-disable-recovering-missed-files-for-visual-studio-installer-projects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!