Tweaked OS Detection project structure and added os check for PT Run (#4253)

* Tweaked OS Detection project structure and added check in Launcher

* Reverted formatter change to minimize diff
This commit is contained in:
Arjun Balgovind 2020-06-11 11:47:15 -07:00 committed by GitHub
parent 67c8d80190
commit fa7e4cc817
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 57 additions and 47 deletions

View File

@ -125,6 +125,7 @@
<ClInclude Include="keyboard_layout.h" />
<ClInclude Include="keyboard_layout_impl.h" />
<ClInclude Include="notifications.h" />
<ClInclude Include="os-detection\os-detect.h" />
<ClInclude Include="RestartManagement.h" />
<ClInclude Include="shared_constants.h" />
<ClInclude Include="timeutil.h" />
@ -159,6 +160,7 @@
<ClCompile Include="monitors.cpp" />
<ClCompile Include="notifications.cpp" />
<ClCompile Include="on_thread_executor.cpp" />
<ClCompile Include="os-detection\os-detect.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
</ClCompile>

View File

@ -111,6 +111,9 @@
<ClInclude Include="two_way_pipe_message_ipc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="os-detection\os-detect.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="RestartManagement.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -183,6 +186,9 @@
<ClCompile Include="two_way_pipe_message_ipc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="os-detection\os-detect.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="RestartManagement.cpp">
<Filter>Source Files</Filter>
</ClCompile>

View File

@ -6,6 +6,7 @@
#include <common/common.h>
#include "trace.h"
#include "resource.h"
#include <common/os-detection/os-detect.h>
extern "C" IMAGE_DOS_HEADER __ImageBase;
@ -131,6 +132,9 @@ public:
// Enable the powertoy
virtual void enable()
{
// Start PowerLauncher.exe only if the OS is 19H1 or higher
if (UseNewSettings())
{
unsigned long powertoys_pid = GetCurrentProcessId();
@ -188,6 +192,7 @@ public:
CloseHandle(hMapFile);
}
}
}
m_enabled = true;
}

View File

@ -238,9 +238,6 @@
<ProjectReference Include="..\common\common.vcxproj">
<Project>{74485049-c722-400f-abe5-86ac52d929b3}</Project>
</ProjectReference>
<ProjectReference Include="..\common\os-detection\os-detection.vcxproj">
<Project>{e6410bfc-b341-498c-8c67-312c20cdd8d5}</Project>
</ProjectReference>
<ProjectReference Include="..\common\updating\updating.vcxproj">
<Project>{17da04df-e393-4397-9cf0-84dabe11032e}</Project>
</ProjectReference>

View File

@ -14,7 +14,7 @@
#include <common/json.h>
#include <common\settings_helpers.cpp>
#include <os-detect.h>
#include <common/os-detection/os-detect.h>
#define BUFSIZE 1024