{"id":97425,"date":"2017-11-20T07:00:00","date_gmt":"2017-11-20T22:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/?p=97425"},"modified":"2019-03-13T01:28:42","modified_gmt":"2019-03-13T08:28:42","slug":"20171120-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20171120-00\/?p=97425","title":{"rendered":"How can I find the installation directory for my UWP application?"},"content":{"rendered":"<p>After you&#8217;ve installed a UWP application, you may want to know where it got installed to. Maybe there&#8217;s a deployment bug that you&#8217;re trying to resolve. Maybe it&#8217;s just because you&#8217;re curious. <\/p>\n<p>Programmatically, your application can ask for the <code>Windows.<\/code><code>Application&shy;Model.<\/code><code>Package.<\/code><code>Current.<\/code><code>Installed&shy;Location.<\/code><code>Path<\/code>. <\/p>\n<p>From PowerShell, you can say <\/p>\n<pre>\nGet-AppxPackage -Name YourPackageName\n<\/pre>\n<p>and it will print various tidbits about your package, including its <code>Install&shy;Location<\/code>. <\/p>\n<p><b>Bonus chatter<\/b>: If you are retrieving the path programmatically because you want to reference content from it, you don&#8217;t need to get the path. You can use the <code>ms-appx<\/code> protocol to access your packaged content. For example <\/p>\n<pre>\nms-appx:\/\/\/Relative\/Path\/To\/Content.jpg\n<\/pre>\n<p>references the specified a file relative to your install directory. Some components will accept a URI directly, such as <code>Bitmap&shy;Image.<\/code><code>Uri&shy;Source<\/code>. If you need to convert it to a <code>Storage&shy;File<\/code>, you can use <code>Storage&shy;File.<\/code><code>Get&shy;File&shy;From&shy;Application&shy;Uri&shy;Async<\/code>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can ask PowerShell.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-97425","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>You can ask PowerShell.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/97425","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=97425"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/97425\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=97425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=97425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=97425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}