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
|
Minimum supported client | Windows 8 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
See also
- Samples
- App package information sample
- Reference
- Package
Build date: 2/25/2013