Visual Studio installation project - exclude web.config file if it exists

How can I exclude the web.config file (or app.config) in the visual studio installer if it already exists on the target machine (and folder)?

Typically, the web.config and app.config files contain configuration information specific to the client. If they just set up, their configuration files will be overwritten. I want to check the presence of a configuration file before overwriting them. If the configuration file already exists, I do not want to overwrite it.

+4
source share
2 answers

It is pretty simple. From the installer, right-click on the contents of the / primary output from the project, and there is an exception filter option. In this, simply create a new filter and add the files you want to exclude. Then you are done.

Now check your folder in which you installed, and you will not find excluded files there.

More details: http://dataerror.blogspot.in/2010/06/creating-web-setup-project-for-aspnet.html

Hope this helps you.

+6
source

You can use the search to determine if the files already exist, and then the conditions for installing components containing the files in the package

+1
source

Source: https://habr.com/ru/post/1382885/


All Articles