Package.InstalledLocation | installedLocation property

Applies to Windows and Windows Phone

Gets the location of the installed package.

Syntax


public StorageFolder InstalledLocation { get; }

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.


Windows.ApplicationModel.Package package = Windows.ApplicationModel.Package.Current;
Windows.Storage.StorageFolder installedLocation = package.InstalledLocation;

String output = String.Format("Installed Location: {0}", installedLocation.Path);

Requirements

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:
© 2014 Microsoft