You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 19, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 19, 2024. It is now read-only.
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.
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.
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.
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.
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.
Activity
jianchun commentedon Mar 8, 2016
This module is a thin wrapper of JSRT API
JsProjectWinRTNamespaceand 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?
RReverser commentedon Mar 8, 2016
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.
munyirik commentedon Mar 8, 2016
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.
RReverser commentedon Mar 8, 2016
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 simulateC:\Users\MyName\AppData\Local\Packages\MyApp\via.\.uwp-package\or anything that would give pre-defined paths via the same API for testing purposes.