[MS] Staging Part 1 - Sharing is Caring - devamazonaws.blogspot.com

A key phase in installing a package is staging the package:

var packageUri = new Uri("C:\\Packages\\ContosoParts-v1.2.3.4-x64.msix");
var options = new StagePackageOptions();
var packageManager = new PackageManager();
var result = await packageManager.StagePackageByUriAsync(packageUri, options);

When a package is staged for the first time, deployment performs several actions, including:

  • Creating a new package directory (commonly referred to as the pkgdir), for example C:\Program Files\WindowsApps\Contoso.Parts_1.2.3.4_x64__1234567890abc
  • Extracting the contents of the .msix into the pkgdir
  • Applying a tightly restricted access control list (ACL) to the pkgdir
  • Creating related directories used for system bookkeeping associated with the package
  • Applying similarly restrictive ACLs to these bookkeeping directories

Deployment secures these directories with strict permissions, typically granting users Read and potentially Execute access - but notably not Write access.

This ensures one user cannot modify the contents of a package in a manner that would compromise their own environment - or anyone else's.

Because MSIX guarantees the immutability of the pkgdir after staging, it can be safely shared across all users on the system - regardless of who installed the package or how many users make use of it.

This immutability also allows MSIX to efficiently minimize on-disk storage for identical content shared across packages.

But more on that in Part 2...


Post Updated on June 2, 2026 at 08:09AM
Thanks for reading
from devamazonaws.blogspot.com

Comments

Popular posts from this blog

[MS] Pulling a single item from a C++ parameter pack by its index, remarks - devamazonaws.blogspot.com

[MS] Boosting Azure DevOps Security with GHAS Code Scanning - devamazonaws.blogspot.com

[MS] The case of the crash when destructing a std::map - devamazonaws.blogspot.com