cairoshell
cairoshell copied to clipboard
Making Cairo the Default Shell Causes Error on Opening UWP/WinRT Apps
Describe the bug Some apps fail to launch and throw an error after upgrading Cairo today.
Chrome and Outlook launch, so not all programs fail. Here is the error message from Slack:
shell:appsFolder\91750D7E.Slack_8she8kybcnzg4!Slack Class not registered.
Same "Class not registered" for Microsoft Store as well.
Also, when set to "Set Windows Explorer As Shell", Cairo still launches as Shell, but the apps launch successfully.
Steps to reproduce
- Open Cairo Settings
- Go to Advanced and click the "Set Cairo as Shell"
- Log Off
- Log On
- Attempt to open programs: I tried Microsoft Store, Firefox and Slack
Expected behavior Programs should open and run without error. When switching to Windows shell as default, Cairo should not be used after logging off and logging on.
System information:
- Windows version: Windows 10 Pro, v.1909 OS build 18363.720
- Cairo version: Version 0.3.6984.0 - Pre-release
- 32-bit or 64-bit: 64-Bit
- In Cairo Settings > Advanced, is Cairo set as shell?: relates to bug
Additional context Just installed Cairo update today
Note 1:I tried rebooting, and the behavior is the same. Note 2: I've been upgrading since a while back, so this is not a new (clean) install. Not sure if this would create an issue.
Screenshots
Interesting, I am not able to reproduce (other than UWP apps like Microsoft Store, which are expected to not work). When opening Firefox, do you receive an error, or does it fail silently?
An example that fails for me, is the Movies and Tv default media player in Win10. My actual error on that app is File system error (-2018374635), firefox works fine as do most/all third party apps, it's just MS apps that have issues (for me). Throwing this in here, as it may be the same problem (or may not) and more data...is good usually.
@dbarronoss Thanks! It looks like these are all UWP apps, and this is a limitation that all Windows 10 shell replacements have, including Cairo. Unfortunately, we have not yet found a workaround for this, as only Explorer (and an enterprise-edition-only shell launcher) have the code to activate these apps.
I was afraid of that...and only MS has the secret sauce.
For Slack I get: shell:appsFolder\91750D7E.Slack_8she8kybcnzg4!Slack Class not registered I don't think these are all from Microsoft store. My Microsoft Outlook works, as well as Chrome. I just have to switch it back to use Windows as the shell, and it doesn't actually switch to Windows, but I can use the apps in Cairo. Weird, no?
For Slack I get: shell:appsFolder\91750D7E.Slack_8she8kybcnzg4!Slack Class not registered I don't think these are all from Microsoft store. My Microsoft Outlook works, as well as Chrome. I just have to switch it back to use Windows as the shell, and it doesn't actually switch to Windows, but I can use the apps in Cairo. Weird, no?
Uwp doesn’t necessarily mean that they are from the windows store, just the type of app and set of api’s that it uses.
I just have to switch it back to use Windows as the shell, and it doesn't actually switch to Windows, but I can use the apps in Cairo. Weird, no?
In this mode, we simply hide the Windows bits while they run in the background, so you get the best of both worlds 😃
There could be an option to launch processes without the Cairo shell, but rather with the Explorer shell (ProcessStartInfo.UseShellExecute to false for UWP apps for example).
@dremin
@dbarronoss Thanks! It looks like these are all UWP apps, and this is a limitation that all Windows 10 shell replacements have, including Cairo. Unfortunately, we have not yet found a workaround for this, as only Explorer (and an enterprise-edition-only shell launcher) have the code to activate these apps.
To launch (in UWP terminology this is called activation) Windows Store application you need to use IApplicationActivationManager
interface and its method ActivateApplication
where you pass App User Model Id (AUMID) of an app you need to launch. In the case of the Slack app, this AUMID is 91750D7E.Slack_8she8kybcnzg4!Slack
. I hope it will help somehow with solving this issue.
UPD.
A little add from me regarding invocating files of a particular type as it might be unclear at first. All we need is to determine AppID associated with a given file by calling the AssocQueryStringW with flag ASSOCSTR_APPID
and pass a file extension to it. If the function is successful then it returns AppID which can be used further in a call of IApplicationActivationManager::ActivateForFile.
Links for references: https://learn.microsoft.com/en-us/windows/win32/api/shlwapi/nf-shlwapi-assocquerystringw https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-iapplicationactivationmanager-activateforfile https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-iapplicationactivationmanager-activateapplication https://stackoverflow.com/a/12927313/1236317 https://learn.microsoft.com/en-us/windows/win32/shell/appids https://learn.microsoft.com/en-us/windows/configuration/find-the-application-user-model-id-of-an-installed-app