feat(client): improve SDK packaging and registry config
This commit is contained in:
+20
-19
@@ -1,21 +1,22 @@
|
||||
project(MainApp)
|
||||
add_executable(MainApp
|
||||
main.cpp
|
||||
MainWindow.h
|
||||
MainWindow.cpp
|
||||
../Common/ConfigHelper.h
|
||||
)
|
||||
target_include_directories(MainApp
|
||||
PUBLIC ${CMAKE_SOURCE_DIR}/Common
|
||||
PRIVATE ${OPENSSL_INC}
|
||||
)
|
||||
target_link_libraries(MainApp PRIVATE Common Qt5::Core Qt5::Gui Qt5::Widgets)
|
||||
|
||||
if(WIN32)
|
||||
get_target_property(QT_WINDEPLOYQT_EXE Qt5::qmake IMPORTED_LOCATION)
|
||||
get_filename_component(QT_BIN_PATH "${QT_WINDEPLOYQT_EXE}" DIRECTORY)
|
||||
set(WINDEPLOYQT "${QT_BIN_PATH}/windeployqt.exe")
|
||||
add_custom_command(TARGET MainApp POST_BUILD
|
||||
project(MainApp)
|
||||
add_executable(MainApp
|
||||
main.cpp
|
||||
MainWindow.h
|
||||
MainWindow.cpp
|
||||
../Common/ConfigHelper.h
|
||||
${CMAKE_SOURCE_DIR}/i18n/update-client.qrc
|
||||
)
|
||||
target_include_directories(MainApp
|
||||
PUBLIC ${CMAKE_SOURCE_DIR}/Common
|
||||
PRIVATE ${OPENSSL_INC}
|
||||
)
|
||||
target_link_libraries(MainApp PRIVATE Common Qt5::Core Qt5::Gui Qt5::Widgets)
|
||||
|
||||
if(WIN32)
|
||||
get_target_property(QT_WINDEPLOYQT_EXE Qt5::qmake IMPORTED_LOCATION)
|
||||
get_filename_component(QT_BIN_PATH "${QT_WINDEPLOYQT_EXE}" DIRECTORY)
|
||||
set(WINDEPLOYQT "${QT_BIN_PATH}/windeployqt.exe")
|
||||
add_custom_command(TARGET MainApp POST_BUILD
|
||||
COMMAND ${WINDEPLOYQT} $<IF:$<CONFIG:Debug>,--debug,--release> $<TARGET_FILE:MainApp>
|
||||
)
|
||||
)
|
||||
endif()
|
||||
|
||||
+9
-6
@@ -1,11 +1,10 @@
|
||||
#include <Windows.h>
|
||||
#include <QApplication>
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QTextCodec>
|
||||
#include <QMessageBox>
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QSaveFile>
|
||||
#include <QTranslator>
|
||||
#include "MainWindow.h"
|
||||
#include "../Common/ConfigHelper.h"
|
||||
#include "../Common/PolicyHelper.h"
|
||||
@@ -16,10 +15,14 @@
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
SetConsoleOutputCP(936);
|
||||
QTextCodec::setCodecForLocale(QTextCodec::codecForName("GBK"));
|
||||
|
||||
QApplication a(argc, argv);
|
||||
QTranslator translator;
|
||||
if (translator.load(":/i18n/update-client_zh_CN.qm"))
|
||||
a.installTranslator(&translator);
|
||||
|
||||
const int elevatedWriteExitCode = ConfigHelper::runElevatedWriteCommandIfRequested();
|
||||
if (elevatedWriteExitCode >= 0)
|
||||
return elevatedWriteExitCode;
|
||||
|
||||
qDebug() << Qt::endl << "entered main app" << Qt::endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user