mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[GPO][MWB]Add policy to disable service mode (#37366)
* [MWB]Add policy to disable service mode * Add restart note * Tweak settings to disable setting * Tweak infobars * Policy should be machine only
This commit is contained in:
@@ -92,6 +92,17 @@ namespace MouseWithoutBorders.Class
|
||||
|
||||
bool serviceMode = firstArg == ServiceModeArg;
|
||||
|
||||
if (PowerToys.GPOWrapper.GPOWrapper.GetConfiguredMwbAllowServiceModeValue() == PowerToys.GPOWrapper.GpoRuleConfigured.Disabled)
|
||||
{
|
||||
if (runningAsSystem)
|
||||
{
|
||||
Logger.Log("Can't run as a service. It's not allowed according to GPO policy. Please contact your systems administrator.");
|
||||
return;
|
||||
}
|
||||
|
||||
serviceMode = false;
|
||||
}
|
||||
|
||||
// If we're started from the .dll module or from the service process, we should
|
||||
// assume the service mode.
|
||||
if (serviceMode && !runningAsSystem)
|
||||
|
||||
Reference in New Issue
Block a user