2

I need to be able to extract content from a WP8 xap file (by renaming to .zip & unzipping), change the content of one of my text files, repackage it (using send to compressed (zipped) folder then rename to xap) and the deploy it using XapDeploy.exe

All works fine except for the deploy stage. XapDeploy reports the Status as XAP file is invalid.

Is there another step I need to do?

Is this possible at all?

The reason for doing this outside of the build process is to allow customers who don't have the source code to change this single text file to suit their needs before deploying it to their workforce.

Julian Mountford
  • 173
  • 2
  • 14

2 Answers2

1

That process works just fine for me on WP8 using FIle Explorer.

Here are the two things that could have gone wrong:

  1. Are you trying to use production XAPs from the Windows Phone Apps service? Those are signed with the WmPrHeader and can no longer be changed without braking that signature. Make sure you're using XAPs generated from VS2012.

  2. Your ZIP format doesn't match the XAP ZIP format. It could be that the way you're adding a file into the ZIP and saving the new ZIP changes the compression algorithm to something unsupported by WP8. Make sure you're using the same compression alogirthm with the same parameters.

JustinAngel
  • 16,082
  • 3
  • 44
  • 73
  • Thanks for your answer. In response to your questions. 1. I'm not using production XAPs from the Windows Phone Apps Service. The XAP I'm using is the output from a build of my project in VS2012 Express for Windows Phone 8. Question 2. I'm compressing the folder by right clicking and choosing send to compressed zipped folder. What version of VS2012 do you have. Do you think I might need VS2012 Pro instead of Express? – Julian Mountford Jan 28 '13 at 15:23
  • Yeah, I'm relatively certain compressing folders with the built-in ZIP functionality won't meet the ZIP specification needed for XAPs. Use some ZIP tool to figure out those specs and then use a 3rd party library/tool to match those. – JustinAngel Jan 28 '13 at 18:33
  • Many thanks. If I use WinZip to edit the contents of the archive it works. – Julian Mountford Jan 29 '13 at 11:45
0

Silverlight supports only a subset of compression methods. You can use infoZip version 2.32 to repackage. Note, info zip Version 3.0 (current) archives are not compatible. There is a hint about PKZIP compatibility in the info zip bugs section.

dirkj
  • 38
  • 4