{"id":153,"date":"2026-06-02T00:09:01","date_gmt":"2026-06-02T07:09:01","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/insidemsix\/?p=153"},"modified":"2026-05-25T00:18:00","modified_gmt":"2026-05-25T07:18:00","slug":"staging-sharing-is-caring","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/insidemsix\/staging-sharing-is-caring\/","title":{"rendered":"Staging Part 1 &#8211; Sharing is Caring"},"content":{"rendered":"<p>A key phase in <a href=\"https:\/\/devblogs.microsoft.com\/insidemsix\/there-is-no-install-its-stage-and-register\/\">installing a package<\/a> is <strong>staging<\/strong> the package:<\/p>\n<pre><code class=\"csharp\">var packageUri = new Uri(\"C:\\\\Packages\\\\ContosoParts-v1.2.3.4-x64.msix\");\nvar options = new StagePackageOptions();\nvar packageManager = new PackageManager();\nvar result = await packageManager.StagePackageByUriAsync(packageUri, options);\n<\/code><\/pre>\n<p>When a package is staged for the first time, deployment performs several actions, including:<\/p>\n<ul>\n<li>Creating a new <strong>package directory<\/strong> (commonly referred to as the <em>pkgdir<\/em>), for example <code>C:\\Program Files\\WindowsApps\\Contoso.Parts_1.2.3.4_x64__1234567890abc<\/code><\/li>\n<li>Extracting the contents of the .msix into the pkgdir<\/li>\n<li>Applying a tightly restricted <a href=\"https:\/\/learn.microsoft.com\/windows\/win32\/secauthz\/access-control-lists\">access control list<\/a> (ACL) to the pkgdir<\/li>\n<li>Creating related directories used for system bookkeeping associated with the package<\/li>\n<li>Applying similarly restrictive ACLs to these bookkeeping directories<\/li>\n<\/ul>\n<p>Deployment secures these directories with strict permissions, typically granting users <strong>Read<\/strong> and potentially <strong>Execute<\/strong> access &#8211; but notably not <strong>Write<\/strong> access.<\/p>\n<p>This ensures one user cannot modify the contents of a package in a manner that would compromise their own environment &#8211; or anyone else&#8217;s.<\/p>\n<p>Because MSIX guarantees the immutability of the pkgdir after staging, it can be safely shared across all users on the system &#8211; regardless of who installed the package or how many users make use of it.<\/p>\n<p>This immutability also allows MSIX to efficiently minimize on-disk storage for identical content shared across packages.<\/p>\n<p>But more on that in Part 2&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A key phase in installing a package is staging the package: var packageUri = new Uri(&#8220;C:\\\\Packages\\\\ContosoParts-v1.2.3.4-x64.msix&#8221;); 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 [&hellip;]<\/p>\n","protected":false},"author":911,"featured_media":81,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[8,9,3,2,4],"class_list":["post-153","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-msix","tag-architecture","tag-code","tag-deployment","tag-msix","tag-stage"],"acf":[],"blog_post_summary":"<p>A key phase in installing a package is staging the package: var packageUri = new Uri(&#8220;C:\\\\Packages\\\\ContosoParts-v1.2.3.4-x64.msix&#8221;); 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 [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/posts\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/users\/911"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/comments?post=153"}],"version-history":[{"count":1,"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/posts\/153\/revisions"}],"predecessor-version":[{"id":165,"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/posts\/153\/revisions\/165"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/media\/81"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/media?parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/categories?post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/insidemsix\/wp-json\/wp\/v2\/tags?post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}