2

using XNA 4.0's TileStorage.OpenStream() you can access files located in the application's binary folder, which are deployed with your application.

You can add files to visual studio project and set them to "copy to output directory", and then these get deployed to the phone, and can be viewed on your PC by looking at your "bin\windows phone\debug" folder

however, if you copy files directly to the "bin\windows phone\debug" folder, these are not deployed to your phone (FYI they get deployed to your Xbox if you are doing xbox development)

How can I deploy additional files to the phone, without adding them to visual studio? Basically I wish to use a postbuild script to get content from a file share, and deploy this + an index file (generated in postbuild) to the phone.

is there any tool, or easy solution for this problem?

JasonS
  • 7,443
  • 5
  • 41
  • 61
  • I'd suggest that everything to build the app should be in the solution, and under source control, which makes the point a bit moot; is there a reason this isn't an option for you? – Rowland Shaw Jan 12 '12 at 12:52
  • we have a custom content workflow for items created using our own editor tools, including custom serialized data (created with our own editor tools) that we wish to deploy to be read by the app. it's an extremely big pain-in-the-butt to manually add each of these files while in the development process. maybe it's possible to "add" a stub .archive file to the csproj for "copy to output" that all our files gets added to, but that is a pretty hacky workaround – JasonS Jan 12 '12 at 13:05

1 Answers1

7

A xap file is just a zip file with a different extension. So you can use the post-build event to edit the xap before deployment, using any command-line-aware zip extractor.

For instance, with 7zip:

"C:\Program Files (x86)\7-Zip\7z.exe" a -tzip $(ProjectDir)$(OutDir)Test.xap C:\FileToInject.png
Kevin Gosse
  • 38,392
  • 3
  • 78
  • 94