Include folder in setup project

2020-02-28 06:48发布

问题:

I want to include a folder in a setup project so that when I deploy that setup the complete folder is also deployed to the install location.

回答1:

Right click the setup project, and select "View" > "File System", and from there you can access a lot of special folders like install folder, appdata, desktop etc, and add files to there, that will be created when you install the application. Make sure to set the "alwayscreate" property to true.



回答2:

The answer is good because it gave me clue on how to fix my problem. I think that my requirement was slightly different. I had to include contents of another library project from the same solution. This seems to work fine for Console Applications/Web Sites, but Installer for some reason was not including it. There might be a better way, but this worked for me. In similar fashion, right click the setup project, and:

- Select "View" > "Custom Actions". 
- Right click on "Install" folder and select "Add Custom Action". 
- Double click on "Application Folder"
- Click on "Add Output..."
- Select the project from the dropdown and in my instance I selected "Content Files", OK it and give it a name. 

This will include any resources, from the selected project marked as Content and that are marked for copying, into your installer.