Reputation: 200
I can get a handle to my app package using Windows.ApplicationModel.Package.current.installedLocation property. Please can you tell me if its possible to replace files in the package with newer ones during runtime. please provide snippets if possible.
Upvotes: 0
Views: 84
Reputation: 7024
Your package location is read-only by design. If you want to replace those contents at runtime, then take this strategy:
Note that you can use ms-appx:/// and ms-appdata://local/ URIs to get to files via StorageFile.getFileFromApplicationUriAsync, rather than getting a StorageFolder first. This can simplify the code.
Upvotes: 1
Reputation: 8161
I'm pretty sure that directory is Read Only: See Access Denied Installed Location.
Why would you want to write to that directory in the first place? Why not go through the normal update process?
Upvotes: 0