Adds PackageTool support for the `msix*` file extensions by cherry-picking the following commits from the v2 branch:
94d98dffcdd7d1a4c73bbc7396f408cf2379a8b6c414efd76f
This combination of commits does the following:
* Adds support for `.msix`, `.msixbundle`, `.mxixupload` package file extensions
* Proper handling of container files which contain stub packages
* Also adds support for creating submission pacakges for `.xvc` files (Xbox packages). Submitting those packages using the v1 API however remains untested.
* Makes all `Test-Path` commands use `-ErrorAction Ignore` to avoid any erroneous errors being reported due to lack of file access (all we care about is getting a `$true` or `$false` response from those function calls).
Resolves#216
* Updates the module version number
* Improved the installation documentation (to note that PowerShellGallery
is now an option). Also did some other minor documentation cleanup.
* Fix character escaping issues during config generation
Many years ago, #24 attempted to properly escape special characters
in a string by creating its own `Get-EscapedJsonValue` function, but
that only escaped `\`, `\t`, `\r`, `\n`. That doesn't cover all the
possible characters needing to be encoded though.
At the time, this clearly seemed like a _good_ idea, but looking back
at this code with more experience, it's not clear to me why I didn't
just use `ConvertTo-Json` directly. Doing that now.
One additional update that needed to be done however was to "escape"
in `tag` and `notesForCertification` with '//' with '\\'. This isn't
_completely_ correct, but not doing so meant that anything after that
would be improperly flagged as a comment by `Remove-Comment` and then
removed.
`Test-Path` will write to the error stream if there is a file access issue,
but still return back `$false`. Within this method, we simply want to test
if the file exists -- not having access to the file is an equivalence case
for us and should be silent.
This updates `Test-Path` to use `-ErrorAction Ignore` to silence any potential
errors that we don't care about.
Additionally this updates `Test-AssemblyIsDesiredVersion` to also be robust
to file access issues. If it has issues getting the file information, even
after getting passed the `Test-Path` in the parameter validation, we want to
gracefully return `$false` without undo error logging (we will write a
Warning log entry though for completeness).
This is a follow-up to cdee54f6e3 (Pull Request #124).
The API team originally added `isMinimalResponse=true` as an optional parameter to the
clone/POST command for new submissions, which had it return a sparse/minimal response
in order to reduce the likelihood of getting a `500` error response while it tried to
gather the complete data for the full submission response.
They have now added support for the same scenario for Flights as well, and so the same
type of change is being made to `New-ApplicationFlightSubmission` so that it creates
the cloned submission with `IsMinimalResponse=true` and then immediately tries to
`GET` that submission to get the full content.
We knew already that we wanted to use a random value for the
intial sleep time on the retry in order to ensure a nice time
spread for all clients (to reduce the likelihood of continued
contentions). However, to achieve this, we had PowerShell
randomly select one of five potential initial sleep times
(1, 1.25, 1.5, 1.75, 2).
To achieve a better spread, we'll instead let it truly select a random value between a larger initial spread of values between
0.40 and 2.0 with a larger range of granularity.
This change is attempting to solve a real problem we're
experiencing lately with an increased number of 429 errors
(too many requests in a given minute).
Sped up the module for users not using a Proxy. `AccessToken` is now cached for the
duration of the console session, and only needs to be refreshed when it expires (which is about
every 60 minutes). Previously, the access token was only cached for the duration of the currently
executing command, which meant that any succesive interactions at the commandline required a new
`AccessToken` to be acquired.
The Store has opened up gaming options and trailers to
all apps, whether or not they explicitly have the
"advanced listings" option added.
The API is making a change to always return back
`true` for `hasAdvancedListingSupport`, but that
doesn't completely unblock StoreBroker. StoreBroker also
followed the guidance in the documentation that indicated
if `trailers` or `gamingOptions` was `null` in the cloned
submission, it meant that they weren't supported. That
is no longer accurate and the MSDN documentation is being
updated, but that also means that StoreBroker needs to make
some minor changes to accomodate that change in behavior
from the API.
There was an error in `Patch-ApplicationSubmission` (used internally
by `Update-ApplicationSubmission`) where it checked for
`-UpdateGamingOptions` for both updating gaming options as well
as for updating trailers, where it should have been checking
`-UpdateTrailers` for the trailers portion.
The XML DOM that PowerShell returns treats inner text of an `XMLElement`
differently depending on whether it has any attributes/comments on it
vs just purely having text inside.
In the case of a `<Caption />` element, we know it will always have at
least one attribute on it. That means that getting the caption text
will always be by querying for the `InnerText` of that element. The same
goes for the `<Image />` element for trailers: there must always be an
attribute specifying the image file, thus any text within the element
will always be accessed via `InnerText`.
For the `<Title />` element of a `<Trailer />`, things are different.
There are no attributes on that, so accessing the actual text of the
trailer will be different depending on whether the element has a
comment within the node or not. At the moment, StoreBroker expected
there to always be that Loc comment within the `<Title />` element:
<!-- _locComment_text="{MaxLength=255} Trailer title 1" -->
Thus, it always accessed the text via `InnerText.Trim()`.
A StoreBroker user ran into an issue when processing their trailers
when their localized PDP files did _not_ have this comment, as
packaging failed with this error:
Convert-TrailersToObject : You cannot call a method on a null-valued expression.
At StoreBroker\PackageTool.ps1:1432 char:9
In this scenario, calling `InnerText` returned `$null`, and so we were calling
`$null.Trim()` which resulted in the error.
The fix is to simply check if we're working with a String (the scenario when
there is no inner comment), and if not, to then proceed with getting the `InnerText`.
To ensure we don't have the problem anywhere else, I've made the fix more generic
with a helper method, and updated all of the places where we currently attempt
to access the text content of an `XMLElement`.
CHANGELOG.md hasn't been updated since StoreBroker was first released.
We should change that.
I've already gone through and added the appropriate [`git tags`](https://git-scm.com/docs/git-tag)
for every release, and now the CHANGELOG will provide a very quick summary of every change as well
for quick and easy perusal.
Going forward, we should keep both this CHANGELOG and the tags up-to-date.
Additionally updated CONTRIBUTING.md to explain the procedure going forward,
and to call out all of the contributors that we've had so far.
Releasing the StoreBroker PowerShell module to the public,
along with the documentation and code for deploying an
internal proxy for the Windows Store Submission API.