diff options
| author | a1xd <[email protected]> | 2020-09-27 22:51:43 -0400 |
|---|---|---|
| committer | a1xd <[email protected]> | 2020-09-27 22:51:43 -0400 |
| commit | a0be98df9546733c3f9e476b808e6c8f8eb843c4 (patch) | |
| tree | 89f5966e33f8ff85b987d32075e912923acfd618 | |
| parent | Fix for second dot not clearing: (diff) | |
| download | rawaccel-a0be98df9546733c3f9e476b808e6c8f8eb843c4.tar.xz rawaccel-a0be98df9546733c3f9e476b808e6c8f8eb843c4.zip | |
add os detection to installer
it --probably-- doesn't run installation on anything older than W10
| -rw-r--r-- | installer/install.manifest | 16 | ||||
| -rw-r--r-- | installer/installer.cpp | 7 | ||||
| -rw-r--r-- | installer/installer.vcxproj | 7 |
3 files changed, 29 insertions, 1 deletions
diff --git a/installer/install.manifest b/installer/install.manifest new file mode 100644 index 0000000..0478246 --- /dev/null +++ b/installer/install.manifest @@ -0,0 +1,16 @@ +<?xml version='1.0' encoding='UTF-8' standalone='yes'?> +<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'> + <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> + <application> + <!-- Windows 10 --> + <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> + </application> + </compatibility> + <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> + <security> + <requestedPrivileges> + <requestedExecutionLevel level='requireAdministrator' uiAccess='false' /> + </requestedPrivileges> + </security> + </trustInfo> +</assembly>
\ No newline at end of file diff --git a/installer/installer.cpp b/installer/installer.cpp index ac426af..03c8881 100644 --- a/installer/installer.cpp +++ b/installer/installer.cpp @@ -1,7 +1,9 @@ + + #include <iostream> #include <utility-install.hpp> - +#include <VersionHelpers.h> void add_service(const fs::path& target) { SC_HANDLE schSCManager = OpenSCManager( NULL, // local computer @@ -41,6 +43,9 @@ void add_service(const fs::path& target) { int main() { try { + if (!IsWindows10OrGreater()) { + throw std::runtime_error("OS not supported, you need at least Windows 10"); + } fs::path source = fs::path(L"driver") / DRIVER_FILE_NAME; if (!fs::exists(source)) { diff --git a/installer/installer.vcxproj b/installer/installer.vcxproj index 45ef0c8..a91ed09 100644 --- a/installer/installer.vcxproj +++ b/installer/installer.vcxproj @@ -49,6 +49,7 @@ </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <LinkIncremental>false</LinkIncremental> + <EmbedManifest>true</EmbedManifest> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ClCompile> @@ -66,6 +67,9 @@ <GenerateDebugInformation>true</GenerateDebugInformation> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> </Link> + <Manifest> + <AdditionalManifestFiles>install.manifest</AdditionalManifestFiles> + </Manifest> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ClCompile> @@ -88,6 +92,9 @@ <GenerateDebugInformation>true</GenerateDebugInformation> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> </Link> + <Manifest> + <AdditionalManifestFiles>install.manifest</AdditionalManifestFiles> + </Manifest> </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="installer.cpp" /> |