From 68889335fc1565d727b91725520e2a4d7bd347ac Mon Sep 17 00:00:00 2001 From: EndrII Date: Sun, 23 Oct 2022 14:53:00 +0300 Subject: [PATCH 1/2] fix call qifw --- src/Deploy/src/Distributions/qif.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Deploy/src/Distributions/qif.cpp b/src/Deploy/src/Distributions/qif.cpp index 947d9cd..493dbf6 100644 --- a/src/Deploy/src/Distributions/qif.cpp +++ b/src/Deploy/src/Distributions/qif.cpp @@ -47,8 +47,14 @@ Envirement QIF::toolKitEnv() const { // SNAP result.addEnv(AppPath + "/../QIF/"); - //Installer + //Installer nad zip +#ifdef Q_OS_LINUX result.addEnvRec(AppPath + "/../../QIF/", 2); +#endif + +#ifdef Q_OS_WIN32 + result.addEnvRec(AppPath + "/../QIF/", 2); +#endif return result; } @@ -60,17 +66,19 @@ QList QIF::runCmd() { QString binarycreator = QuasarAppUtils::Params::getArg("binarycreator"); - if (binarycreator.isEmpty()) - binarycreator = DeployCore::findProcess(toolKitEnv().concatEnv(), base); - if (binarycreator.isEmpty()) { - cmd.command = base; + binarycreator = DeployCore::findProcess(toolKitEnv().concatEnv(), base); } else { auto commandsList = binarycreator.split(' '); cmd.command = commandsList.first(); cmd.arguments = commandsList.mid(1,-1); } + if (binarycreator.isEmpty()) { + cmd.command = base; + cmd.arguments.clear(); + } + auto location = DeployCore::_config->getTargetDir() + "/" + getLocation(); cmd.arguments += QStringList{ From 6bad492402da69ee54f47f3ecb8bee710c64ae99 Mon Sep 17 00:00:00 2001 From: EndrII Date: Sun, 23 Oct 2022 16:07:36 +0300 Subject: [PATCH 2/2] fix static resources --- src/CQtDeployer/main.cpp | 2 ++ src/Deploy/CMakeLists.txt | 4 ++-- src/Deploy/src/Distributions/qif.cpp | 14 ++++++-------- src/Deploy/src/deploy.cpp | 5 +++++ src/Deploy/src/deploy.h | 5 +++++ 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/CQtDeployer/main.cpp b/src/CQtDeployer/main.cpp index b5179ef..faa8717 100644 --- a/src/CQtDeployer/main.cpp +++ b/src/CQtDeployer/main.cpp @@ -26,6 +26,8 @@ int main(int argc, char *argv[]) { Deploy deploy; + deploy.init(); + int code = deploy.run(); if (code) { diff --git a/src/Deploy/CMakeLists.txt b/src/Deploy/CMakeLists.txt index 7fade26..710cdf9 100644 --- a/src/Deploy/CMakeLists.txt +++ b/src/Deploy/CMakeLists.txt @@ -13,7 +13,7 @@ set(CURRENT_PROJECT "${CURRENT_PROJECT_DIR}") add_definitions(-DCQT_DEPLOYER_LIBRARY) -file(GLOB_RECURSE SOURCE_CPP +file(GLOB SOURCE_CPP "src/*.cpp" "src/*.h" @@ -22,7 +22,7 @@ file(GLOB_RECURSE SOURCE_CPP ) -file(GLOB_RECURSE SOURCE_QRC +file(GLOB SOURCE_QRC "*.qrc" "src/*.qrc" ) diff --git a/src/Deploy/src/Distributions/qif.cpp b/src/Deploy/src/Distributions/qif.cpp index 493dbf6..af553cf 100644 --- a/src/Deploy/src/Distributions/qif.cpp +++ b/src/Deploy/src/Distributions/qif.cpp @@ -60,25 +60,23 @@ Envirement QIF::toolKitEnv() const { } QList QIF::runCmd() { - QString base = "binarycreator"; - SystemCommandData cmd; QString binarycreator = QuasarAppUtils::Params::getArg("binarycreator"); if (binarycreator.isEmpty()) { - binarycreator = DeployCore::findProcess(toolKitEnv().concatEnv(), base); + binarycreator = DeployCore::findProcess(toolKitEnv().concatEnv(), "binarycreator"); + if (binarycreator.isEmpty()) { + cmd.command = "binarycreator"; + } else { + cmd.command = binarycreator; + } } else { auto commandsList = binarycreator.split(' '); cmd.command = commandsList.first(); cmd.arguments = commandsList.mid(1,-1); } - if (binarycreator.isEmpty()) { - cmd.command = base; - cmd.arguments.clear(); - } - auto location = DeployCore::_config->getTargetDir() + "/" + getLocation(); cmd.arguments += QStringList{ diff --git a/src/Deploy/src/deploy.cpp b/src/Deploy/src/deploy.cpp index c19ae4c..3529d4e 100644 --- a/src/Deploy/src/deploy.cpp +++ b/src/Deploy/src/deploy.cpp @@ -48,6 +48,11 @@ int Deploy::run() { return Good; } +bool Deploy::init() { + initCQtDeployerResources(); + return true; +} + Deploy::~Deploy() { if (_extracter) { diff --git a/src/Deploy/src/deploy.h b/src/Deploy/src/deploy.h index 8a2c41c..fa2d04b 100644 --- a/src/Deploy/src/deploy.h +++ b/src/Deploy/src/deploy.h @@ -34,6 +34,10 @@ enum exitCodes { }; +inline void initCQtDeployerResources() { + Q_INIT_RESOURCE(DeployResources); +} + class DEPLOYSHARED_EXPORT Deploy { private: @@ -54,6 +58,7 @@ private: public: Deploy(); int run(); + bool init(); ~Deploy(); /**