Closed Bug 1737177 Opened 3 years ago Closed 2 years ago

Add `nsSystemInfo` runtime flag for whether running application is running under Microsoft Windows S Mode

Categories

(Firefox :: Installer, enhancement, P3)

enhancement

Tracking

()

VERIFIED FIXED
96 Branch
Tracking Status
firefox96 --- fixed
firefox97 --- fixed
firefox98 --- fixed

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.

Whiteboard: [fidedi-tikka]
Severity: -- → S3
Priority: -- → P3

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).

Assignee: nobody → bhearsum
Status: NEW → ASSIGNED
Attachment #9249294 - Attachment description: Bug 1737177: Add `nsSystemInfo` runtime flag for whether running application is running under Microsoft Windows S Mode. r=nalexander! → Bug 1737177: Add `nsSystemInfo` runtime flag for whether running application is running under Microsoft Windows S Mode. r=mhowell!
Pushed by bhearsum@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2dc54f256ad3
Add `nsSystemInfo` runtime flag for whether running application is running under Microsoft Windows S Mode. r=mhowell

This is not strictly necessary, but it's probably useful to have, and will aid QA in verifying the original patch in this bug.

Pushed by bhearsum@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4ca4d5cbfc62
Add a string to about:support when Windows is in S Mode. r=mhowell
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch

This bug assumes that MSIX packaged Firefox will work in S-mode, but apparently it does not. See bug 1741539.

See Also: → 1741539

(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.

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!

Flags: needinfo?(bhearsum)

(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.

Flags: needinfo?(bhearsum)

(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.

Unfortunately Firefox 96 did not show SMode-ness correctly in about:support.
Services.sysinfo.processInfo.isWindowsSMode should be (await Services.sysinfo.processInfo).isWindowsSMode.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #9258736 - Attachment description: Bug 1737177: fix about:support display of S mode. r?nalexander! → WIP: Bug 1737177: fix about:support display of S mode
Pushed by bhearsum@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8e42c80a077b
WIP: Bug 1737177: fix about:support display of S mode r=nalexander
Status: REOPENED → RESOLVED
Closed: 3 years ago2 years ago
Resolution: --- → FIXED

Change the status for beta to have the same as nightly and release.
For more information, please visit auto_nag documentation.

Verified fixed with 98.0.1.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: