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/install.manifest | 16 ++++++++++++++++ installer/installer.cpp | 7 ++++++- installer/installer.vcxproj | 7 +++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 installer/install.manifest 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 @@ + + + + + + + + + + + + + + + + \ 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 #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)) { 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 @@ false + true @@ -66,6 +67,9 @@ true RequireAdministrator + + install.manifest + @@ -88,6 +92,9 @@ true RequireAdministrator + + install.manifest + -- cgit v1.2.3