Show error message on pre-10 Windows

This commit is contained in:
Sebastian Messmer 2018-12-14 00:40:38 -08:00
parent d68247070f
commit 2648dd81ee
1 changed files with 9 additions and 2 deletions

View File

@ -5,6 +5,7 @@
#if defined(_MSC_VER)
#include <cpp-utils/network/WinHttpClient.h>
#include <VersionHelpers.h>
#else
#include <cpp-utils/network/CurlHttpClient.h>
#endif
@ -18,12 +19,18 @@ using std::make_shared;
using std::cerr;
int main(int argc, const char *argv[]) {
#if defined(_MSC_VER)
if (!IsWindows10OrGreater()) {
std::cerr << "CryFS is currently only supported on Windows 10 (or later)." << std::endl;
}
#endif
try {
auto &keyGenerator = Random::OSRandom();
#if defined(_MSC_VER)
auto httpClient = make_unique_ref<cpputils::WinHttpClient>();
auto httpClient = make_unique_ref<cpputils::WinHttpClient>();
#else
auto httpClient = make_unique_ref<cpputils::CurlHttpClient>();
auto httpClient = make_unique_ref<cpputils::CurlHttpClient>();
#endif
return Cli(keyGenerator, SCrypt::DefaultSettings, make_shared<IOStreamConsole>())
.main(argc, argv, std::move(httpClient), []{});