How can I exclude a folder from a .NET installer for a website?

六月ゝ 毕业季﹏ 提交于 2019-12-23 17:10:47

问题


We have an installer for a website of ours which works great, I exclude the web.config and a few other files when creating the installer. However I can't seem to exclude a folder. Is this possible?

I've created the installer using the .NET built in Web Setup Project found in the visual studio group Other project types > Setup and Deployment within the new project dialog. This only has the option of including groups of output and excluding files via the filter.


回答1:


What technology are you using to generate your installer?

Edit after additional info in the question: OK, I haven't worked with the built in Web Setup Project, but I did use a regular setup project once. You control the output of each project that's included in the setup by setting the Build Action property of each content file. Set it to None to exclude a file.

There isn't a Build Action property for a folder, so you'll have to set it for all the files within a folder. If a folder doesn't have any content files, then it shouldn't be included in your setup project.




回答2:


The only way I found to exclude entire folders and any files within sub-directories was to modify the deployment project which fed into my Installer. Check out the following for information removing folders pre-build:

http://www.meadow.se/wordpress/?p=137

And this for post-build:

http://blogs.msdn.com/webdevtools/archive/2008/10/05/exclude-files-and-folders-from-wdp-output.aspx



来源:https://stackoverflow.com/questions/1189256/how-can-i-exclude-a-folder-from-a-net-installer-for-a-website

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