-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assume neutral architecture when none is specified #90
Conversation
StoreBroker/PackageTool.ps1
Outdated
@@ -1962,7 +1967,7 @@ function Get-FormattedFilename | |||
return $formattedBundleTags -join '_' | |||
} | |||
|
|||
function Read-ApplicationMetadata | |||
function Read-OOoOOApplicationMetadata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea. Fixed, thanks.
@@ -1608,6 +1608,11 @@ function Read-AppxMetadata | |||
|
|||
$metadata.version = $manifest.Package.Identity.Version | |||
$metadata.architecture = $manifest.Package.Identity.ProcessorArchitecture | |||
if ([String]::IsNullOrWhiteSpace($metadata.architecture)) | |||
{ | |||
$metadata.architecture = "neutral" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be single-assignment:
$metadata.architecture = if (...) { … } else { … }
Alternatively, I've been wanting a custom helper function like:
$metadata.architecture = If-NotNull -Then $manifest.Package.Identity.ProcessorArchitecture -Else "neutral"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're describing creating a null-coalescing operator (??
in C#). but for PowerShell.
Given that this is the type of base functionality that a language should support, and given the fact that it's being considered for 6.1, I'd rather not try to roll our own at this time.
I'd prefer to leave as-is.
Per the [MSDN documentation](https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-identity), `neutral` is the default value for `ProcessorArchitecture`. Updating our Appx metadata reading logic to assume `neutral` when none is specified. This will avoid a later exception in `Get-FormattedFilename` that does Metadata table validation. Resolves Issue 89
de140a0
to
ad205ee
Compare
Per the MSDN documentation,
neutral
is the default value forProcessorArchitecture
.Updating our Appx metadata reading logic to assume
neutral
when none is specified.This will avoid a later exception in
Get-FormattedFilename
that does Metadata table validation.Resolves Issue #89