Skip to content
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

Enable building of msix package #9289

Merged
merged 16 commits into from
Apr 16, 2019
Merged

Conversation

SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Apr 3, 2019

PR Summary

Add support in packaging.psm1 to produce a .msix AppX package. Update the docker image to use the new msix package type. Update the associated yml files so AzDevOps performs the build.

PR Context

Enable publishing PSCore6 to Microsoft Store

PR Checklist

tools/packaging/packaging.psm1 Outdated Show resolved Hide resolved
tools/packaging/packaging.psm1 Outdated Show resolved Hide resolved
tools/packaging/packaging.psm1 Outdated Show resolved Hide resolved
tools/packaging/packaging.psm1 Outdated Show resolved Hide resolved
assets/AppxManifest.xml Outdated Show resolved Hide resolved
tools/packaging/packaging.psm1 Show resolved Hide resolved
@wjk
Copy link

wjk commented Apr 4, 2019

We would probably want to add the following XML elements to the manifest:

<Properties>
  <desktop6:RegistryWriteVirtualization>disabled</desktop6:RegistryWriteVirtualization>
</Properties>
<!-- other content... -->
<Capabilities>
  <rescap:Capability Name="unvirtualizedResources" />
</Capabilities>

This will instruct Windows to allow the packaged copy of PowerShell to modify the system Registry directly. Without it, PowerShell's Registry manipulation features will not function properly (the changes will be visible only to PowerShell), vastly impairing the usefulness of the program.

Note that users will need to be running 19H1 for this to work. The use of the desktop6 namespace should not impair loading of the package on downlevel versions of Windows 10 (assuming IgnorableNamespaces is used), but the capability might.

@SteveL-MSFT
Copy link
Member Author

@wjk Thanks for that snippet! That should resolve the issue I see with using the registry provider from the msix. Will update the manifest.

@SteveL-MSFT
Copy link
Member Author

@wjk With those additions, it doesn't fix some issues with the msix package in that Move-Item, Copy-Item and Rename-Item doesn't work with registry provider when elevated and against HKLM:. New-Item and Remove-Item do work. And all cmdlets seem to work against HKCU:.

fix packaging to create resources.pri so that taskbar icon doesn't have background border
fix naming of package to align with msi package
@wjk
Copy link

wjk commented Apr 5, 2019

@SteveL-MSFT Unfortunately, I'm not running 19H1 yet, so I can’t help debug your HKLM issue. It seems really weird that some of the registry cmdlets would work, but others don’t. Do you see an error message, or do the changes simply silently fail?

@SteveL-MSFT
Copy link
Member Author

@wjk Getting an Access Denied error when attempting a move, rename, or copy. Here's the stacktace:

PSMessageDetails      :
Exception             : System.Security.SecurityException: Requested registry access is not allowed.
                           at Microsoft.Win32.ThrowHelper.ThrowSecurityException(String msg)
                           at Microsoft.Win32.RegistryKey.InternalOpenSubKeyCore(String name, Boolean writable,
                        Boolean throwOnPermissionFailure)
                           at Microsoft.PowerShell.Commands.RegistryWrapper.OpenSubKey(String name, Boolean writable)
                           at Microsoft.PowerShell.Commands.RegistryProvider.GetRegkeyForPath(String path, Boolean
                        writeAccess)
                           at Microsoft.PowerShell.Commands.RegistryProvider.CopyRegistryKey(IRegistryWrapper key,
                        String path, String destination, Boolean recurse, Boolean streamResult, Boolean
                        streamFirstOnly)
                           at Microsoft.PowerShell.Commands.RegistryProvider.CopyItem(String path, String destination,
                        Boolean recurse)
TargetObject          : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\3\test\test
CategoryInfo          : PermissionDenied: (HKEY_LOCAL_MACHINE\\u2026erShell\3\test\test:String) [Copy-Item],
                        SecurityException
FullyQualifiedErrorId : System.Security.SecurityException,Microsoft.PowerShell.Commands.CopyItemCommand
ErrorDetails          :
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {0, 1}

</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.17763.0" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only 1809?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried the msix on 1803 and it didn't install understand msix, I think it only supports .appx.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can update the version information once we verify it'll work on those versions.

@PoshChan
Copy link
Collaborator

@SteveL-MSFT, your last commit had 1 failures in PowerShell-CI-macos
Validate 'Save-Help -DestinationPath for all PowerShell Core modules..Validate Save-Help for the 'Microsoft.PowerShell.Core' module

Expected $null, but got 'Microsoft.PowerShell.Core_00000000-0000-0000-0000-000000000000_en-US_HelpContent.zip'.
at <ScriptBlock>, /Users/vsts/agent/2.149.2/work/1/s/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1: line 332
332:     $expectedCompressedFile | Should -Be $compressedFile

@SteveL-MSFT
Copy link
Member Author

@PoshChan please retry macos

@PoshChan
Copy link
Collaborator

@SteveL-MSFT, successfully started retry of PowerShell-CI-macOS

@TravisEz13 TravisEz13 merged commit 73114ee into PowerShell:master Apr 16, 2019
@TravisEz13 TravisEz13 added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Apr 16, 2019
@TravisEz13 TravisEz13 added this to the 7.0.0-preview.1 milestone Apr 16, 2019
TravisEz13 added a commit to TravisEz13/PowerShell that referenced this pull request May 23, 2019
Add support in packaging.psm1 to produce a .msix AppX package.  Update the docker image to use the new msix package type.  Update the associated yml files so AzDevOps performs the build.

## PR Context

Enable publishing PSCore6 to Microsoft Store
TravisEz13 added a commit that referenced this pull request May 23, 2019
Add support in packaging.psm1 to produce a .msix AppX package.  Update the docker image to use the new msix package type.  Update the associated yml files so AzDevOps performs the build.

## PR Context

Enable publishing PSCore6 to Microsoft Store
@SteveL-MSFT SteveL-MSFT deleted the create-appx branch March 10, 2020 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants