How can I find the installation directory for my UWP application?

Raymond Chen

Raymond

After you’ve installed a UWP application, you may want to know where it got installed to. Maybe there’s a deployment bug that you’re trying to resolve. Maybe it’s just because you’re curious.

Programmatically, your application can ask for the Windows.Application­Model.Package.Current.Installed­Location.Path.

From PowerShell, you can say

Get-AppxPackage -Name YourPackageName

and it will print various tidbits about your package, including its Install­Location.

Bonus chatter: If you are retrieving the path programmatically because you want to reference content from it, you don’t need to get the path. You can use the ms-appx protocol to access your packaged content. For example

ms-appx:///Relative/Path/To/Content.jpg

references the specified a file relative to your install directory. Some components will accept a URI directly, such as Bitmap­Image.Uri­Source. If you need to convert it to a Storage­File, you can use Storage­File.Get­File­From­Application­Uri­Async.

Raymond Chen
Raymond Chen

Follow Raymond