Add `nsSystemInfo` runtime flag for whether running application is running under Microsoft Windows S Mode
Categories
(Firefox :: Installer, enhancement, P3)
Tracking
()
People
(Reporter: nalexander, Assigned: bhearsum)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fidedi-tikka])
Attachments
(3 files)
To adjust behaviour depending on whether the application is running under Microsoft Windows S Mode, we'll need a runtime flag. https://docs.microsoft.com/en-us/uwp/api/windows.system.profile.windowsintegritypolicy?view=winrt-22000 suggests there are APIs for discovering this, and they’re definitely in the WinRT headers, so we should be able to just ask the system for these details.
Note to self: on my system, c:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/cppwinrt/winrt/Windows.System.Profile.h
looks to have the expected functions exposed.
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
This patch uses the Windows.System.Profile.WindowsIntegrityPolicy class to determine whether or not Windows is in S mode. This class is only available beginning with SDK 17763 (newer than what we use right now), so we need to fetch it at runtime with some magic.
I was able to test this on a couple of Windows 10 systems, and verifying that it was set to false (by dumping Services.sysinfo to the console). I'm not aware of a way to test that it detects S mode properly until we can get a copy of Firefox with this code in it into the Store, so it can be installed on an S mode machine -- but the tests I have done appear to confirm that we're fetching the class and calling its method properly (early attempts here resulted in crashes due to access violations).
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
This is not strictly necessary, but it's probably useful to have, and will aid QA in verifying the original patch in this bug.
Comment 5•3 years ago
|
||
bugherder |
Comment 6•3 years ago
|
||
bugherder |
Comment 7•3 years ago
|
||
This bug assumes that MSIX packaged Firefox will work in S-mode, but apparently it does not. See bug 1741539.
Assignee | ||
Comment 8•3 years ago
|
||
(In reply to Masatoshi Kimura [:emk] from comment #7)
This bug assumes that MSIX packaged Firefox will work in S-mode, but apparently it does not. See bug 1741539.
As I noted in that bug, we've explicitly disabled S mode installs for now, so this is future looking work for after we've re-enabled it.
Comment 9•3 years ago
|
||
Hello! Are there any steps we could use to test this or it cannot be tested yet because MSIX is blocked in Windows S Mode? Thank you!
Assignee | ||
Comment 10•3 years ago
|
||
(In reply to Alexandru Trif, QA [:atrif] from comment #9)
Hello! Are there any steps we could use to test this or it cannot be tested yet because MSIX is blocked in Windows S Mode? Thank you!
Not quite yet, because of the block you mentioned. I'm looking into setting up a separate App on the Store that we can test with, though. I'll be in touch when it's possible to verify this.
Reporter | ||
Comment 11•3 years ago
|
||
(In reply to bhearsum@mozilla.com (:bhearsum) from comment #10)
(In reply to Alexandru Trif, QA [:atrif] from comment #9)
Hello! Are there any steps we could use to test this or it cannot be tested yet because MSIX is blocked in Windows S Mode? Thank you!
Not quite yet, because of the block you mentioned. I'm looking into setting up a separate App on the Store that we can test with, though. I'll be in touch when it's possible to verify this.
My preference is to get Firefox Nightly into the Store, possibly with a private audience, so that we can use it for this type of QA testing (and we can leave it available for Windows S Mode). But that's blocked (for me, at least) on a very strange behaviour with package identifiers in the Store. I had one frustrating interaction with the Store support folks and have emailed another MS contact about this behaviour, but no reply yet. We'll have to escalate to get this addressed, it seems.
Comment 12•3 years ago
|
||
Unfortunately Firefox 96 did not show SMode-ness correctly in about:support
.
Services.sysinfo.processInfo.isWindowsSMode
should be (await Services.sysinfo.processInfo).isWindowsSMode
.
Assignee | ||
Comment 13•3 years ago
|
||
Updated•3 years ago
|
Comment 14•3 years ago
|
||
Comment 15•3 years ago
|
||
bugherder |
Comment 16•3 years ago
|
||
Change the status for beta to have the same as nightly and release.
For more information, please visit auto_nag documentation.
Description
•