mirror of
https://github.com/microsoft/PowerToys
synced 2025-09-02 15:35:12 +00:00
[runner, color picker, run] remove os dection (#10648)
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
#include "Generated Files/resource.h"
|
||||
#include <common/logger/logger.h>
|
||||
#include <common/SettingsAPI/settings_objects.h>
|
||||
#include <common/utils/os-detect.h>
|
||||
#include <common/utils/resources.h>
|
||||
|
||||
#include <colorPicker/ColorPicker/ColorPickerConstants.h>
|
||||
@@ -227,12 +226,8 @@ public:
|
||||
{
|
||||
ResetEvent(send_telemetry_event);
|
||||
ResetEvent(m_hInvokeEvent);
|
||||
// use only with new settings?
|
||||
if (UseNewSettings())
|
||||
{
|
||||
launch_process();
|
||||
m_enabled = true;
|
||||
}
|
||||
};
|
||||
|
||||
virtual void disable()
|
||||
|
@@ -11,7 +11,6 @@
|
||||
#include <common/utils/elevation.h>
|
||||
#include <common/utils/process_path.h>
|
||||
#include <common/utils/resources.h>
|
||||
#include <common/utils/os-detect.h>
|
||||
#include <common/utils/winapi_error.h>
|
||||
|
||||
#include <filesystem>
|
||||
@@ -185,9 +184,7 @@ public:
|
||||
Logger::info("Launcher is enabling");
|
||||
ResetEvent(m_hEvent);
|
||||
ResetEvent(send_telemetry_event);
|
||||
// Start PowerLauncher.exe only if the OS is 19H1 or higher
|
||||
if (UseNewSettings())
|
||||
{
|
||||
|
||||
unsigned long powertoys_pid = GetCurrentProcessId();
|
||||
|
||||
if (!is_process_elevated(false))
|
||||
@@ -269,7 +266,6 @@ public:
|
||||
CloseHandle(hMapFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Disable the powertoy
|
||||
virtual void disable()
|
||||
|
@@ -20,7 +20,6 @@
|
||||
#include <common/version/helper.h>
|
||||
#include <common/logger/logger.h>
|
||||
#include <common/utils/elevation.h>
|
||||
#include <common/utils/os-detect.h>
|
||||
#include <common/utils/process_path.h>
|
||||
#include <common/utils/timeutil.h>
|
||||
#include <common/utils/winapi_error.h>
|
||||
@@ -367,12 +366,12 @@ void run_settings_window(bool showOobeWindow)
|
||||
|
||||
BOOL process_created = false;
|
||||
|
||||
if (is_process_elevated())
|
||||
{
|
||||
// TODO: Revisit this after switching to .NET 5
|
||||
// Due to a bug in .NET, running the Settings process as non-elevated
|
||||
// from an elevated process sometimes results in a crash.
|
||||
// TODO: Revisit this after switching to .NET 5
|
||||
if (is_process_elevated() && !UseNewSettings())
|
||||
{
|
||||
process_created = run_settings_non_elevated(executable_path.c_str(), executable_args.data(), &process_info);
|
||||
// process_created = run_settings_non_elevated(executable_path.c_str(), executable_args.data(), &process_info);
|
||||
}
|
||||
|
||||
if (FALSE == process_created)
|
||||
|
Reference in New Issue
Block a user