Skip to content

Commit

Permalink
[TIMOB-24956] Fix issue where could not write appxmanifest file on Je…
Browse files Browse the repository at this point in the history
…nkins
  • Loading branch information
ewanharris committed Jul 13, 2017
1 parent 6755761 commit 99390e0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
0.5.2 (07/12/2017)
* [TIMOB-246830] Do not attempt to run winappdeploycmd if it does not exist
* [TIMOB-24683] Do not attempt to run winappdeploycmd if it does not exist
* [TIMOB-24956] Fix issue where temporary AppxManifest would not get written when fetching project guid
0.5.1 (07/04/2017)
-------------------
* [TIMOB-24922] Fix cert generation on VS2017 - Move to using vsDevCmd instead of vcvarsall
Expand Down
18 changes: 16 additions & 2 deletions bin/wp_get_appx_metadata.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Add-Type -assembly "system.io.compression.filesystem"
$AppPackagePath = $Args[0]

$shell = new-object -com shell.application
Expand All @@ -22,12 +23,25 @@ if ($item.extension -eq ".appxbundle") {

$manifest = @{ "Name" = "AppxManifest.xml" }
$manifest.Path = Join-Path $directory $manifest.Name
$manifest.File = $shell.NameSpace($zipFilePath).Items() | ? { $_.Name -eq $manifest.Name }
$shell.Namespace($directory).CopyHere($manifest.File)

$zip = [io.compression.zipfile]::OpenRead($zipFilePath)
$file = $zip.Entries | where-object { $_.Name -eq $manifest.Name}
$stream = $file.Open()

$reader = New-Object IO.StreamReader($stream)
$text = $reader.ReadToEnd()
$text | Out-File -filepath $manifest.Path -Force

$manifest.Xml = [xml](get-content $manifest.Path)


$reader.Close()
$stream.Close()
$zip.Dispose()

Remove-Item $zipFilePath
Remove-Item $manifest.Path


$var=@($manifest.Xml.Package.Identity.Name,$manifest.Xml.Package.PhoneIdentity.PhoneProductId)[![String]::IsNullOrEmpty($manifest.Xml.Package.PhoneIdentity.PhoneProductId)]
$var

0 comments on commit 99390e0

Please sign in to comment.