diff --git a/CCEngine/CCEngine.rc b/CCEngine/CCEngine.rc index 16296ff..c964cba 100644 --- a/CCEngine/CCEngine.rc +++ b/CCEngine/CCEngine.rc @@ -1,2 +1,31 @@ IDI_ICON1 ICON DISCARDABLE "CCEngine.ico" +#include +#include "src/version.h" + +VS_VERSION_INFO VERSIONINFO +FILEVERSION VER_FILEVERSION +PRODUCTVERSION VER_PRODUCTVERSION +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", VER_COMPANYNAME_STR + VALUE "FileDescription", VER_FILEDESCRIPTION_STR + VALUE "FileVersion", VER_FILEVERSION_STR + VALUE "InternalName", VER_INTERNALNAME_STR + VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR + VALUE "LegalTrademarks1", VER_LEGALTRADEMARKS1_STR + VALUE "LegalTrademarks2", VER_LEGALTRADEMARKS2_STR + VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR + VALUE "ProductName", VER_PRODUCTNAME_STR + VALUE "ProductVersion", VER_PRODUCTVERSION_STR + END + END + + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END diff --git a/CCEngine/CCEngine.vcxproj b/CCEngine/CCEngine.vcxproj index e62e303..3e49913 100644 --- a/CCEngine/CCEngine.vcxproj +++ b/CCEngine/CCEngine.vcxproj @@ -47,12 +47,10 @@ - - @@ -70,18 +68,19 @@ true _WIN32_WINNT=0x0601;WIN32;_SCL_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions) true - $(ProjectDir)..\..\libLicenseClient\api;.\GeneratedFiles;%(AdditionalIncludeDirectories) stdcpplatest ProgramDatabase MultiThreadedDebugDLL true + %(AdditionalIncludeDirectories) Windows true + qtmaind.lib;Qt5Cored.lib;Qt5Guid.lib;Qt5Widgetsd.lib;%(AdditionalDependencies) - $(ProjectDir)..\..\libLicenseClient\api;.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName)\.;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtWidgets;$(CRYPTOPP_ROOT_DIR)include;$(LIBZIP_ROOT_DIR)include;$(ZLIB_ROOT_DIR)include;$(LIBCURL_ROOT_DIR)include;$(BOOST_ROOT_DIR)\. + %(AdditionalIncludeDirectories) _WIN32_WINNT=0x0601;WIN32;_SCL_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions) @@ -93,7 +92,6 @@ true _WIN32_WINNT=0x0601;WIN32;_SCL_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions); true - $(ProjectDir)..\..\libLicenseClient\api;.\GeneratedFiles;%(AdditionalIncludeDirectories) stdcpplatest @@ -104,10 +102,11 @@ false false + qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;%(AdditionalDependencies) _WIN32_WINNT=0x0601;WIN32;_SCL_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions); - $(ProjectDir)..\..\libLicenseClient\api;.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName)\.;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtWidgets;$(CRYPTOPP_ROOT_DIR)include;$(LIBZIP_ROOT_DIR)include;$(ZLIB_ROOT_DIR)include;$(LIBCURL_ROOT_DIR)include;$(BOOST_ROOT_DIR)\. + %(AdditionalIncludeDirectories) @@ -117,10 +116,23 @@ + + + + + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + Moc'ing %(Identity)... + $(ProjectDir)..\..\libLicenseClient\api;.\GeneratedFiles;$(Conan-qt-Root)\include\QtWidgets;$(ProjectDir)..\..\thirdparty\SingleApplication;$(USERPROFILE)\.conan\data\libzip\1.5.1\bincrafters\stable\package\dbbcb700636ed4dcef87df041870679358161bfa\include;$(USERPROFILE)\.conan\data\libcurl\7.61.1\bincrafters\stable\package\ad2605af224ca43af0e946078f4647e97ed84168\include;C:\.conan\uahlbm22\1\include;$(USERPROFILE)\.conan\data\cryptopp\7.0.0\bincrafters\stable\package\b786e9ece960c3a76378ca4d5b0d0e922f4cedc1\include;C:\.conan\hmd9bfi9\1\include;$(USERPROFILE)\.conan\data\bzip2\1.0.6\conan\stable\package\b786e9ece960c3a76378ca4d5b0d0e922f4cedc1\include;$(USERPROFILE)\.conan\data\OpenSSL\1.0.2o\conan\stable\package\312b5f5b013b9686179e3082c71ec55f20aea297\include;$(USERPROFILE)\.conan\data\zlib\1.2.11\conan\stable\package\b786e9ece960c3a76378ca4d5b0d0e922f4cedc1\include + _WIN32_WINNT=0x0601;WIN32;_SCL_SECURE_NO_WARNINGS;_DEBUG;QAPPLICATION_CLASS=QApplication;_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING;_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING;BOOST_USE_STATIC_LIBS;BOOST_ALL_NO_LIB;CURL_STATICLIB=1;_MBCS + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + Moc'ing %(Identity)... + $(ProjectDir)..\..\libLicenseClient\api;.\GeneratedFiles;$(Conan-qt-Root)\include\QtWidgets;$(ProjectDir)..\..\thirdparty\SingleApplication;$(USERPROFILE)\.conan\data\libzip\1.5.1\bincrafters\stable\package\fc750fec580977876c697df1eba7f91b3923261b\include;$(USERPROFILE)\.conan\data\libcurl\7.61.1\bincrafters\stable\package\e37072ee7d8e70a6842093ddc8fc71f26526e91f\include;C:\.conan\4gwcmfvt\1\include;$(USERPROFILE)\.conan\data\cryptopp\7.0.0\bincrafters\stable\package\2bb76c9adac7b8cd7c5e3b377ac9f06934aba606\include;C:\.conan\btu8fxq0\1\include;$(USERPROFILE)\.conan\data\bzip2\1.0.6\conan\stable\package\2bb76c9adac7b8cd7c5e3b377ac9f06934aba606\include;$(USERPROFILE)\.conan\data\OpenSSL\1.0.2o\conan\stable\package\b02659d133a8131c5433777813f6385a05a7ae8a\include;$(USERPROFILE)\.conan\data\zlib\1.2.11\conan\stable\package\2bb76c9adac7b8cd7c5e3b377ac9f06934aba606\include + _WIN32_WINNT=0x0601;WIN32;_SCL_SECURE_NO_WARNINGS;NDEBUG;QAPPLICATION_CLASS=QApplication;_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING;_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING;BOOST_USE_STATIC_LIBS;BOOST_ALL_NO_LIB;CURL_STATICLIB=1;_MBCS + @@ -148,6 +160,9 @@ {b12702ad-abfb-343a-a199-8e24837244a3} + + + diff --git a/CCEngine/CCEngine.vcxproj.filters b/CCEngine/CCEngine.vcxproj.filters index 500e292..e209d9a 100644 --- a/CCEngine/CCEngine.vcxproj.filters +++ b/CCEngine/CCEngine.vcxproj.filters @@ -12,6 +12,11 @@ {60322e81-4907-489e-87af-66b7f5778503} + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + true + @@ -38,6 +43,12 @@ src + + src + + + src + @@ -49,6 +60,9 @@ src + + src + @@ -84,5 +98,13 @@ src + + src + + + + + Resource Files + \ No newline at end of file diff --git a/CCEngine/conanfile.txt b/CCEngine/conanfile.txt new file mode 100644 index 0000000..ad6ec42 --- /dev/null +++ b/CCEngine/conanfile.txt @@ -0,0 +1,28 @@ +[requires] +libzip/1.5.1@bincrafters/stable +libcurl/7.61.1@bincrafters/stable +boost/1.69.0@conan/stable +cryptopp/7.0.0@bincrafters/stable +qt/5.12.0@bincrafters/stable + +[generators] +visual_studio + +[options] +libzip:shared=True +libcurl:shared=False +libcurl:with_openssl=False +libcurl:with_winssl=True +boost:shared=False +cryptopp:shared=False +qt:shared=True + +[imports] +bin, Qt5Cored.dll -> ./Debug @ root_package=qt +bin, Qt5Guid.dll -> ./Debug @ root_package=qt +bin, Qt5Widgetsd.dll -> ./Debug @ root_package=qt +bin, Qt5Core.dll -> ./Release @ root_package=qt +bin, Qt5Gui.dll -> ./Release @ root_package=qt +bin, Qt5Widgets.dll -> ./Release @ root_package=qt +plugins/platforms, qwindowsd.dll -> ./Debug/platforms @ root_package=qt +plugins/platforms, qwindows.dll -> ./Release/platforms @ root_package=qt diff --git a/CCEngine/project-common.props b/CCEngine/project-common.props index 32b7dd1..61fc50f 100644 --- a/CCEngine/project-common.props +++ b/CCEngine/project-common.props @@ -1,17 +1,14 @@ - - - - - + - %(AdditionalIncludeDirectories) + $(ProjectDir)..\..\libLicenseClient\api;$(ProjectDir)GeneratedFiles;%(AdditionalIncludeDirectories) %(AdditionalOptions) + _SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING;_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING;%(PreprocessorDefinitions) %(AdditionalLibraryDirectories) diff --git a/CCEngine/src/CCEngine.cpp b/CCEngine/src/CCEngine.cpp index 4db178b..da10e0a 100644 --- a/CCEngine/src/CCEngine.cpp +++ b/CCEngine/src/CCEngine.cpp @@ -15,9 +15,11 @@ CCEngine::CCEngine( const boost::filesystem::path& appPath, bool justUpdated, + bool startBrowser, QWidget *parent) : QMainWindow(parent) , m_appPath(appPath) + , m_autoStartBrowser(startBrowser) { qRegisterMetaType(); qRegisterMetaType(); @@ -92,6 +94,12 @@ void CCEngine::onCCServerStatusUpdate(CCServerStatus serverStatus) ui.lblHttpServerStatusVal->setText(textStatus); ui.lblHttpServerStatusVal->setStyleSheet(QString("QLabel { color: %1; }").arg(color)); ui.btnOpenBrowser->setEnabled(dataBrowsable); + + if (dataBrowsable && m_autoStartBrowser) + { + emit onOpenBrowser(true); + m_autoStartBrowser = false; + } } void CCEngine::onLoad() @@ -159,6 +167,13 @@ void CCEngine::onInstallUpdates(bool) } } +void CCEngine::onShowInForeground() +{ + showNormal(); + raise(); + activateWindow(); +} + void CCEngine::onParamsLoaded(SystemParams hashedParams, SystemParams origParams) { diff --git a/CCEngine/src/CCEngine.h b/CCEngine/src/CCEngine.h index 3478f16..d08dcb2 100644 --- a/CCEngine/src/CCEngine.h +++ b/CCEngine/src/CCEngine.h @@ -20,9 +20,10 @@ class CCEngine : public QMainWindow Q_OBJECT public: - CCEngine( - const boost::filesystem::path& appPath, - bool justUpdated, + CCEngine( + const boost::filesystem::path& appPath, + bool justUpdated, + bool startBrowser, QWidget *parent = Q_NULLPTR); virtual ~CCEngine(); @@ -39,6 +40,7 @@ private slots: void onOpenBrowser(bool); void onCheckForUpdates(bool); void onInstallUpdates(bool); + void onShowInForeground(); // License controller signal handlers void onParamsLoaded(SystemParams hashedParams, SystemParams origParams); @@ -69,4 +71,5 @@ private: CCLicenseController m_licenseController; CCServerManager m_ccServerManager; uint16_t m_port; + bool m_autoStartBrowser; }; diff --git a/CCEngine/src/CCLicenseController.h b/CCEngine/src/CCLicenseController.h index 5570141..ed8345e 100644 --- a/CCEngine/src/CCLicenseController.h +++ b/CCEngine/src/CCLicenseController.h @@ -4,7 +4,7 @@ #include "HTTPClient.h" #include "IModuleDatabase.h" -#include +#include #include diff --git a/CCEngine/src/CCServerManager.h b/CCEngine/src/CCServerManager.h index 90ac751..2678cca 100644 --- a/CCEngine/src/CCServerManager.h +++ b/CCEngine/src/CCServerManager.h @@ -2,7 +2,7 @@ #include "CCServer.h" -#include +#include enum class CCServerStatus { diff --git a/CCEngine/src/RunGuard.cpp b/CCEngine/src/RunGuard.cpp new file mode 100644 index 0000000..7ee3452 --- /dev/null +++ b/CCEngine/src/RunGuard.cpp @@ -0,0 +1,79 @@ +#include "RunGuard.h" + +#include + +namespace +{ + +QString generateKeyHash( const QString& key, const QString& salt ) +{ + QByteArray data; + + data.append( key.toUtf8() ); + data.append( salt.toUtf8() ); + data = QCryptographicHash::hash( data, QCryptographicHash::Sha1 ).toHex(); + + return data; +} + +} + + +RunGuard::RunGuard( const QString& key ) + : key( key ) + , memLockKey( generateKeyHash( key, "_memLockKey" ) ) + , sharedMemKey( generateKeyHash( key, "_sharedMemKey" ) ) + , sharedMem( sharedMemKey ) + , memLock( memLockKey, 1 ) +{ + memLock.acquire(); + { + QSharedMemory fix( sharedMemKey ); // Fix for *nix: http://habrahabr.ru/post/173281/ + fix.attach(); + } + memLock.release(); +} + +RunGuard::~RunGuard() +{ + release(); +} + +bool RunGuard::isAnotherRunning() +{ + if ( sharedMem.isAttached() ) + return false; + + memLock.acquire(); + const bool isRunning = sharedMem.attach(); + if ( isRunning ) + sharedMem.detach(); + memLock.release(); + + return isRunning; +} + +bool RunGuard::tryToRun() +{ + if ( isAnotherRunning() ) // Extra check + return false; + + memLock.acquire(); + const bool result = sharedMem.create( sizeof( quint64 ) ); + memLock.release(); + if ( !result ) + { + release(); + return false; + } + + return true; +} + +void RunGuard::release() +{ + memLock.acquire(); + if ( sharedMem.isAttached() ) + sharedMem.detach(); + memLock.release(); +} diff --git a/CCEngine/src/RunGuard.h b/CCEngine/src/RunGuard.h new file mode 100644 index 0000000..0912aac --- /dev/null +++ b/CCEngine/src/RunGuard.h @@ -0,0 +1,37 @@ +/** + * Code based on https://stackoverflow.com/a/28172162 + * @author Dmitry Sazonov + */ + +#ifndef RUNGUARD_H +#define RUNGUARD_H + +#include +#include +#include + + +class RunGuard +{ + +public: + RunGuard( const QString& key ); + ~RunGuard(); + + bool isAnotherRunning(); + bool tryToRun(); + void release(); + +private: + const QString key; + const QString memLockKey; + const QString sharedMemKey; + + QSharedMemory sharedMem; + QSystemSemaphore memLock; + + Q_DISABLE_COPY( RunGuard ) +}; + + +#endif // RUNGUARD_H \ No newline at end of file diff --git a/CCEngine/src/SingleAppGuard.cpp b/CCEngine/src/SingleAppGuard.cpp new file mode 100644 index 0000000..1273217 --- /dev/null +++ b/CCEngine/src/SingleAppGuard.cpp @@ -0,0 +1,69 @@ +#include "SingleAppGuard.h" + +#include "RunGuard.h" + +#include + +namespace +{ + + QString generateKeyHash(const QString& key, const QString& salt) + { + QByteArray data; + + data.append(key.toUtf8()); + data.append(salt.toUtf8()); + data = QCryptographicHash::hash(data, QCryptographicHash::Sha1).toHex(); + + return data; + } + +} + +SingleAppGuard::SingleAppGuard(QString key) + : uniqueAppKey(std::move(key)) +{} + +SingleAppGuard::~SingleAppGuard() +{ + exitRequested = true; + if (m_appLock) + { + m_appLock->release(); + } + if (m_workerThread.joinable()) + { + m_workerThread.join(); + } +} + +bool SingleAppGuard::tryToRun() +{ + auto keyHash = generateKeyHash(uniqueAppKey, "_appKey"); + m_runGuard = std::make_unique( uniqueAppKey ); + if ( !m_runGuard->tryToRun() ) + { + // just notify consumer and return + QSystemSemaphore appLock(keyHash, 0); + appLock.release(); + + return false; + } + + // create consumer + exitRequested = false; + m_appLock = std::make_unique(keyHash, 0, QSystemSemaphore::Create); + m_workerThread = std::thread([this]() + { + while (!exitRequested && m_appLock->acquire()) + { + if (exitRequested) + { + break; + } + emit instanceStarted(); + } + }); + + return true; +} diff --git a/CCEngine/src/SingleAppGuard.h b/CCEngine/src/SingleAppGuard.h new file mode 100644 index 0000000..56ce5e4 --- /dev/null +++ b/CCEngine/src/SingleAppGuard.h @@ -0,0 +1,32 @@ +#pragma once + +#include + +#include +#include + +class RunGuard; +class QSystemSemaphore; + +class SingleAppGuard : public QObject +{ + Q_OBJECT; + +public: + explicit SingleAppGuard(QString key); + virtual ~SingleAppGuard(); + +public: + bool tryToRun(); + +public: +signals: + void instanceStarted(); + +private: + QString uniqueAppKey; + std::atomic exitRequested; + std::thread m_workerThread; + std::unique_ptr m_runGuard; + std::unique_ptr m_appLock; +}; diff --git a/CCEngine/src/SystemParamsModel.h b/CCEngine/src/SystemParamsModel.h index 7293ff8..cec0f1c 100644 --- a/CCEngine/src/SystemParamsModel.h +++ b/CCEngine/src/SystemParamsModel.h @@ -2,7 +2,7 @@ #include "SystemParams.h" -#include +#include #include diff --git a/CCEngine/src/main.cpp b/CCEngine/src/main.cpp index 13c94a3..5afa51e 100644 --- a/CCEngine/src/main.cpp +++ b/CCEngine/src/main.cpp @@ -1,5 +1,8 @@ #include "CCEngine.h" + #include "OSUtils.h" +#include "SingleAppGuard.h" + #include #include @@ -15,6 +18,11 @@ namespace logging = boost::log; namespace expr = boost::log::expressions; namespace keywords = boost::log::keywords; +namespace +{ + constexpr char uniqueAppKey[] = "rE4ZDk0PsEG2K123lyharvJyQ9zeP9w"; +} + void initLogging() { auto logPath = ensureLogFolder("CCEngine"); @@ -35,6 +43,12 @@ void initLogging() int main(int argc, char *argv[]) { + SingleAppGuard guard( uniqueAppKey ); + if ( !guard.tryToRun() ) + { + return 0; + } + QApplication a(argc, argv); auto appDir = fs::system_complete(a.arguments().at(0).toStdString()).parent_path(); @@ -42,15 +56,33 @@ int main(int argc, char *argv[]) initLogging(); bool justUpdated = false; + bool minimized = false; + bool startBrowser = false; for (int i = 1; i < a.arguments().size(); ++i) { if (a.arguments().at(i) == "--updated") { justUpdated = true; } + if (a.arguments().at(i) == "--minimized") + { + minimized = true; + } + if (a.arguments().at(i) == "--start-browser") + { + startBrowser = true; + } } - CCEngine w(appDir, justUpdated); - w.show(); + CCEngine w(appDir, justUpdated, startBrowser); + if (!minimized) + { + w.show(); + } + + QObject::connect( + &guard, SIGNAL(instanceStarted()), + &w, SLOT(onShowInForeground())); + return a.exec(); } diff --git a/CCEngine/src/version.h b/CCEngine/src/version.h new file mode 100644 index 0000000..4448a75 --- /dev/null +++ b/CCEngine/src/version.h @@ -0,0 +1,21 @@ +#ifndef VERSION_H +#define VERSION_H + +#define VER_FILEVERSION 18,52,01 +#define VER_FILEVERSION_STR "185201\0" + +#define VER_PRODUCTVERSION 18,52,01 +#define VER_PRODUCTVERSION_STR "185201\0" + +#define VER_COMPANYNAME_STR "Apis spol. s r.o." +#define VER_FILEDESCRIPTION_STR "Catalogue of Currencies Serving Engine" +#define VER_INTERNALNAME_STR "CCEngine" +#define VER_LEGALCOPYRIGHT_STR "Copyright (c) 2018 Apis spol. s r.o." +#define VER_LEGALTRADEMARKS1_STR "All Rights Reserved" +#define VER_LEGALTRADEMARKS2_STR VER_LEGALTRADEMARKS1_STR +#define VER_ORIGINALFILENAME_STR "CCEngine.exe" +#define VER_PRODUCTNAME_STR "CCEngine" + +#define VER_COMPANYDOMAIN_STR "apis.sk" + +#endif // VERSION_H diff --git a/CCEngineLoader/CCEngineLoader.cpp b/CCEngineLoader/CCEngineLoader.cpp index c1ddee8..72ad37a 100644 --- a/CCEngineLoader/CCEngineLoader.cpp +++ b/CCEngineLoader/CCEngineLoader.cpp @@ -1,7 +1,7 @@ #include "CCEngineLoader.h" -#include -#include +#include +#include CCEngineLoader::CCEngineLoader( const boost::filesystem::path& appPath, diff --git a/CCEngineLoader/CCEngineLoader.vcxproj b/CCEngineLoader/CCEngineLoader.vcxproj index 0b6f886..af4c7b3 100644 --- a/CCEngineLoader/CCEngineLoader.vcxproj +++ b/CCEngineLoader/CCEngineLoader.vcxproj @@ -46,12 +46,10 @@ - - @@ -69,18 +67,19 @@ true _WIN32_WINNT=0x0601;WIN32;_DEBUG;%(PreprocessorDefinitions) true - $(ProjectDir)..\..\libLicenseClient\api;%(AdditionalIncludeDirectories) stdcpplatest ProgramDatabase MultiThreadedDebugDLL true + %(AdditionalIncludeDirectories) Windows true + qtmaind.lib;Qt5Cored.lib;Qt5Guid.lib;Qt5Widgetsd.lib;%(AdditionalDependencies) - $(ProjectDir)..\..\libLicenseClient\api;.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName)\.;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtWidgets;$(CRYPTOPP_ROOT_DIR)include;$(LIBZIP_ROOT_DIR)include;$(ZLIB_ROOT_DIR)include;$(LIBCURL_ROOT_DIR)include;$(BOOST_ROOT_DIR)\. + %(AdditionalIncludeDirectories) _WIN32_WINNT=0x0601;WIN32;_DEBUG;QT_DLL;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;CURL_STATICLIB;_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING;_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING;_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING;_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING;_MBCS @@ -92,7 +91,6 @@ true _WIN32_WINNT=0x0601;WIN32;NDEBUG;%(PreprocessorDefinitions) true - $(ProjectDir)..\..\libLicenseClient\api;%(AdditionalIncludeDirectories) stdcpplatest @@ -103,10 +101,11 @@ false false + qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;%(AdditionalDependencies) _WIN32_WINNT=0x0601;WIN32;NDEBUG;BOOST_EXCEPTION_DISABLE;QT_NO_DEBUG;QT_DLL;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;CURL_STATICLIB;_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING;_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING;_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING;_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING;_MBCS - $(ProjectDir)..\..\libLicenseClient\api;.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName)\.;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtWidgets;$(CRYPTOPP_ROOT_DIR)include;$(LIBZIP_ROOT_DIR)include;$(ZLIB_ROOT_DIR)include;$(LIBCURL_ROOT_DIR)include;$(BOOST_ROOT_DIR)\. + %(AdditionalIncludeDirectories) diff --git a/CCEngineLoader/UpdateWorker.h b/CCEngineLoader/UpdateWorker.h index 8099e90..e59af69 100644 --- a/CCEngineLoader/UpdateWorker.h +++ b/CCEngineLoader/UpdateWorker.h @@ -2,7 +2,7 @@ #include -#include +#include enum class UpdateStatus { diff --git a/CCEngineLoader/conanfile.txt b/CCEngineLoader/conanfile.txt new file mode 100644 index 0000000..9057912 --- /dev/null +++ b/CCEngineLoader/conanfile.txt @@ -0,0 +1,18 @@ +[requires] +libzip/1.5.1@bincrafters/stable +libcurl/7.61.1@bincrafters/stable +boost/1.69.0@conan/stable +cryptopp/7.0.0@bincrafters/stable +qt/5.12.0@bincrafters/stable + +[generators] +visual_studio + +[options] +libzip:shared=True +libcurl:shared=False +libcurl:with_openssl=False +libcurl:with_winssl=True +boost:shared=False +cryptopp:shared=False +qt:shared=True diff --git a/CCEngineLoader/project-common.props b/CCEngineLoader/project-common.props index 07abe4b..6193a80 100644 --- a/CCEngineLoader/project-common.props +++ b/CCEngineLoader/project-common.props @@ -1,11 +1,7 @@ - - - - - + diff --git a/workspace.bat b/workspace.bat new file mode 100644 index 0000000..5fcf611 --- /dev/null +++ b/workspace.bat @@ -0,0 +1,32 @@ + +setlocal + +set GENERATOR=visual_studio_multi +set CONAN=conan +set ARCH=x86 + +SET SCRIPTDIR=%~dp0 + +mkdir %SCRIPTDIR%\CCEngine\build +cd %SCRIPTDIR%\CCEngine\build +%CONAN% install .. -g %GENERATOR% -s arch=%ARCH% -s build_type=Debug +rem --build=libcurl +%CONAN% install .. -g %GENERATOR% -s arch=%ARCH% -s build_type=Release +rem --build=libcurl + +mkdir %SCRIPTDIR%\CCEngineLoader\build +cd %SCRIPTDIR%\CCEngineLoader\build +%CONAN% install .. -g %GENERATOR% -s arch=%ARCH% -s build_type=Debug +%CONAN% install .. -g %GENERATOR% -s arch=%ARCH% -s build_type=Release + +mkdir %SCRIPTDIR%\..\libLicenseClient\build +cd %SCRIPTDIR%\..\libLicenseClient\build +%CONAN% install .. -g %GENERATOR% -s arch=%ARCH% -s build_type=Debug +%CONAN% install .. -g %GENERATOR% -s arch=%ARCH% -s build_type=Release + +mkdir %SCRIPTDIR%\..\libLicenseClient\test\build +cd %SCRIPTDIR%\..\libLicenseClient\test\build +%CONAN% install .. -g %GENERATOR% -s arch=%ARCH% -s build_type=Debug +%CONAN% install .. -g %GENERATOR% -s arch=%ARCH% -s build_type=Release + +endlocal