From a0be98df9546733c3f9e476b808e6c8f8eb843c4 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Sun, 27 Sep 2020 22:51:43 -0400 Subject: add os detection to installer it --probably-- doesn't run installation on anything older than W10 --- installer/installer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'installer/installer.cpp') 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 #include - +#include 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)) { -- cgit v1.2.3