Reputation: 172230
I am using the Publish
feature of Visual Studio to create a ClickOnce setup file for my VSTO add-in.
I know that I can cause files to be deployed together with the application by setting their Build Action to Content
. Let's say I have a file called readme.txt
, whose Build Action is set to Content
. This is what happens:
publish
+-- setup.exe
+-- MyAddIn.vsto
+-- ApplicationFiles
+-- ...lots of files..
+-- readme.txt.deploy <--
Since the file contains information that I want the user to read before installing the application, this is what I want to happen:
publish
+-- setup.exe
+-- MyAddIn.vsto
+-- readme.txt <--
+-- ApplicationFiles
+-- ...lots of files..
Is there an easy way to do that?
Upvotes: 3
Views: 1154
Reputation: 23311
At the bottom of the project file:
<Target Name="AfterPublish">
<Exec Command="xcopy.exe /Y "$(TargetDir)readme.txt" "$(PublishUrl)"" />
</Target>
Here's what I was working on in case this more general scenario is useful for others:
<PropertyGroup>
<ReadmeFilesDir>README-files</ReadmeFilesDir>
</PropertyGroup>
<Target Name="AfterPublish">
<Exec Command="xcopy.exe /Y "$(TargetDir)README.html" "$(PublishUrl)"" />
<Exec Command="xcopy.exe /E /I /Y "$(TargetDir)$(ReadmeFilesDir)" "$(PublishUrl)$(ReadmeFilesDir)"" />
</Target>
I wonder if there's a badge for answering a six year-old question.
Upvotes: 4
Reputation: 198
Maybe you can use a post-build command to move the file to the location you want, then the wizard will package the folder as is.
Upvotes: -1