diff --git a/browser/components/enterprisepolicies/Policies.jsm b/browser/components/enterprisepolicies/Policies.jsm index 996c3ad6c011..eba55ec75ff0 100644 --- a/browser/components/enterprisepolicies/Policies.jsm +++ b/browser/components/enterprisepolicies/Policies.jsm @@ -942,6 +942,10 @@ var Policies = { }, }, + LegacyProfiles: { + // Handled in nsToolkitProfileService.cpp (Windows only) + }, + LocalFileLinks: { onBeforeAddons(manager, param) { // If there are existing capabilities, lock them with the policy pref. diff --git a/browser/components/enterprisepolicies/schemas/policies-schema.json b/browser/components/enterprisepolicies/schemas/policies-schema.json index 493747c08bff..fb3d9d507c1b 100644 --- a/browser/components/enterprisepolicies/schemas/policies-schema.json +++ b/browser/components/enterprisepolicies/schemas/policies-schema.json @@ -477,6 +477,10 @@ } }, + "LegacyProfiles": { + "type": "boolean" + }, + "LocalFileLinks": { "type": "array", "items": { diff --git a/toolkit/profile/nsToolkitProfileService.cpp b/toolkit/profile/nsToolkitProfileService.cpp index 01131dd5b9ef..37771c33d821 100644 --- a/toolkit/profile/nsToolkitProfileService.cpp +++ b/toolkit/profile/nsToolkitProfileService.cpp @@ -14,6 +14,7 @@ #ifdef XP_WIN # include # include +# include "mozilla/PolicyChecks.h" #endif #ifdef XP_UNIX # include @@ -1797,9 +1798,12 @@ bool nsToolkitProfileService::IsSnapEnvironment() { * application versions to different locations, some application sandboxing * systems as well as enterprise deployments. This environment variable provides * a way to opt out of dedicated profiles for these cases. + * + * For Windows, we provide a policy to accomplish the same thing. */ bool nsToolkitProfileService::UseLegacyProfiles() { - return !!PR_GetEnv("MOZ_LEGACY_PROFILES"); + return !!PR_GetEnv("MOZ_LEGACY_PROFILES") || + PolicyCheckBoolean(L"LegacyProfiles"); } struct FindInstallsClosure {