Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Package.InstalledLocation | installedLocation property

Gets the location of the installed package.

Syntax


var installedLocation = package.installedLocation;

Property value

Type: StorageFolder

The location of the installed package.

Remarks

There are several other ways to refer to the a file in a package.

  • You can just begin a URI with a "/" to refer to the package root. For example:

    <img src="/file.png" alt="" />

  • You can use the "ms-appx:///" protocol. For example:

    <img src="ms-appx://packageFullName/file.png" alt="" />

  • You can also omit the package name to let the system fill in the domain, as shown here:

    <img src="ms-appx:///file.png" alt="" />

For more info about how to refer to files in an app's package, see How to load file resources.

Examples

Use the Package.Current | current property to get the package for the current app. Use the Package.InstalledLocation | installedLocation property to get the location of the installed package as a Windows.Storage.StorageFolder object.


var package = Windows.ApplicationModel.Package.current;
var installedLocation = package.installedLocation;

var output = [ "Installed Location: " + installedLocation.path ];

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.ApplicationModel
Windows::ApplicationModel [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows.ApplicationModel
Windows::ApplicationModel [C++]

Metadata

Windows.winmd

See also

Samples
App package information sample
Reference
Package

 

 

Show:
© 2015 Microsoft