Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.
This repository was archived by the owner on Jul 19, 2024. It is now read-only.

Unable to use APIs available to real packages #21

Open

Description

Getting the following error when trying to get local/temp folders:

> Windows.Storage.ApplicationData.current
WinRTError: The process has no package identity.

I read around and looks like it's been a common issue for various UWP test runners, and in this specific case it happens because we don't really have any AppData associated with the script, but wondering if it would be possible to shim such APIs so that they would use e.g. script's folder as a base.

Activity

  1. jianchun commented on Mar 8, 2016

    @jianchun

    This module is a thin wrapper of JSRT API JsProjectWinRTNamespace and doesn't have further logic to patch differences when used inside/outside of a UWP. From a first glance, patching the differences seems out of scope of this module.

    Munyiri Kamau (@munyirik) Arunesh Chandra (@aruneshchandra) Yong Qu (@Yongqu) Do you have opinions?

  2. RReverser commented on Mar 8, 2016

    @RReverser
    Author

    Jianchun Xu (@jianchun) Patching the differences is rather a backup plan, I was wondering if it's possible to simulate the mentioned "package identity" so that all the APIs that rely on it, would still work.

  3. munyirik commented on Mar 8, 2016

    @munyirik
    Contributor

    It's not possible to do that i.e. make a desktop application impersonate a UWP application (aka WinRT/Store app). Some classes like ApplicationData are tied to UWP apps since app packages have their own storage folders. For example the LocalFolder property will point to the application's own local folder (e.g. C:\Users\MyName\AppData\Local\Packages\MyApp\LocalState) and not c:\Users\XYZ\AppData\Local. For a desktop app (i.e. Node.js (Chakra)) I think the way to do this would be to use environment variable. E.g. the local folder variable is LOCALAPPDATA.

  4. RReverser commented on Mar 8, 2016

    @RReverser
    Author

    For a desktop app (i.e. Node.js (Chakra)) I think the way to do this would be to use environment variable. E.g. the local folder variable is LOCALAPPDATA.

    Yeah, except then need to rewrite code to retrieve folders in asynchronous manner (as you can't get StorageFolder by path synchronously in opposite to ApplicationData.current.* items which pre-exist) which, in turn, affects all the code that depends on it and so on and so on. So I hoped it would be possible to simulate C:\Users\MyName\AppData\Local\Packages\MyApp\ via .\.uwp-package\ or anything that would give pre-defined paths via the same API for testing purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions