mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-30 19:54:35 +00:00
ref #575 "use call for console applications in windows"
This commit is contained in:
parent
7d76f8edeb
commit
9d3608bcf1
@ -112,6 +112,23 @@ QtMajorVersion LibInfo::isDependetOfQt() const {
|
|||||||
return QtMajorVersion::NoQt;
|
return QtMajorVersion::NoQt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool LibInfo::isConsole() const {
|
||||||
|
for (const auto& i : dependncies) {
|
||||||
|
|
||||||
|
QFileInfo info(i);
|
||||||
|
|
||||||
|
QString fileName = info.fileName();
|
||||||
|
if (fileName.contains("Qt4Gui", ONLY_WIN_CASE_INSENSIATIVE) ||
|
||||||
|
fileName.contains("Qt5Gui", ONLY_WIN_CASE_INSENSIATIVE) ||
|
||||||
|
fileName.contains("Qt6Gui", ONLY_WIN_CASE_INSENSIATIVE)) {
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
QString LibInfo::fullPath() const {
|
QString LibInfo::fullPath() const {
|
||||||
return path + "/" + name;
|
return path + "/" + name;
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,9 @@ public:
|
|||||||
WinAPI getWinApi() const;
|
WinAPI getWinApi() const;
|
||||||
void setWinApi(WinAPI winApi);
|
void setWinApi(WinAPI winApi);
|
||||||
QtMajorVersion isDependetOfQt() const;
|
QtMajorVersion isDependetOfQt() const;
|
||||||
|
|
||||||
|
bool isConsole() const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
uint qHash(const LibInfo& info);
|
uint qHash(const LibInfo& info);
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
bool MetaFileManager::createRunScriptWindows(const QString &target) {
|
bool MetaFileManager::createRunScriptWindows(const QString &target) {
|
||||||
|
|
||||||
auto cnf = DeployCore::_config;
|
auto cnf = DeployCore::_config;
|
||||||
|
auto targetinfo = cnf->targets().value(target);
|
||||||
if (!cnf->targets().contains(target)) {
|
if (!targetinfo.isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
auto distro = cnf->getDistro(target);
|
auto distro = cnf->getDistro(target);
|
||||||
@ -37,6 +37,7 @@ bool MetaFileManager::createRunScriptWindows(const QString &target) {
|
|||||||
script.close();
|
script.close();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
auto systemLibsDir = distro.getLibOutDir() + DeployCore::systemLibsFolderName();
|
auto systemLibsDir = distro.getLibOutDir() + DeployCore::systemLibsFolderName();
|
||||||
|
|
||||||
content =
|
content =
|
||||||
@ -46,8 +47,15 @@ bool MetaFileManager::createRunScriptWindows(const QString &target) {
|
|||||||
"SET CQT_PKG_ROOT=%BASE_DIR%\n"
|
"SET CQT_PKG_ROOT=%BASE_DIR%\n"
|
||||||
"SET CQT_RUN_FILE=%BASE_DIR%%5\n"
|
"SET CQT_RUN_FILE=%BASE_DIR%%5\n"
|
||||||
|
|
||||||
"%3\n"
|
"%3\n";
|
||||||
"start \"%0\" %4 \"%BASE_DIR%" + distro.getBinOutDir() + "%1\" %2 \n";
|
|
||||||
|
// Run application as invoke of the console for consle applications
|
||||||
|
// And run gui applciation in the detached mode.
|
||||||
|
if (targetinfo.isConsole()) {
|
||||||
|
content += "call \"%BASE_DIR%" + distro.getBinOutDir() + "%1\" %2 \n";
|
||||||
|
} else {
|
||||||
|
content += "start \"%0\" %4 \"%BASE_DIR%" + distro.getBinOutDir() + "%1\" %2 \n";
|
||||||
|
}
|
||||||
|
|
||||||
content = content.arg(targetInfo.baseName(), targetInfo.fileName(), "%*",
|
content = content.arg(targetInfo.baseName(), targetInfo.fileName(), "%*",
|
||||||
generateCustoScriptBlok(true)); // %0 %1 %2 %3
|
generateCustoScriptBlok(true)); // %0 %1 %2 %3
|
||||||
|
@ -2937,6 +2937,25 @@ void deploytest::testOutDirs() {
|
|||||||
QVERIFY(runScript.contains("SET PATH=%BASE_DIR%\\lolLib\\;%PATH%"));
|
QVERIFY(runScript.contains("SET PATH=%BASE_DIR%\\lolLib\\;%PATH%"));
|
||||||
QVERIFY(runScript.contains("start \"TestQMLWidgets\" /B \"%BASE_DIR%\\lol\\TestQMLWidgets.exe\" %*"));
|
QVERIFY(runScript.contains("start \"TestQMLWidgets\" /B \"%BASE_DIR%\\lol\\TestQMLWidgets.exe\" %*"));
|
||||||
|
|
||||||
|
runTestParams({"-bin", TestBinDir + "TestOnlyC.exe, "clear" ,
|
||||||
|
"-binOut", "/lol",
|
||||||
|
"-libOut", "/lolLib",
|
||||||
|
"-trOut", "/lolTr",
|
||||||
|
"-pluginOut", "/p",
|
||||||
|
"-qmlOut", "/q",
|
||||||
|
"-qmake", qmake
|
||||||
|
}, nullptr);
|
||||||
|
|
||||||
|
file.setFileName( "./" + DISTRO_DIR + "/TestOnlyC.bat");
|
||||||
|
|
||||||
|
QVERIFY(file.open(QIODevice::ReadOnly));
|
||||||
|
|
||||||
|
runScript = file.readAll();
|
||||||
|
file.close();
|
||||||
|
|
||||||
|
qDebug() << "runScript =" << runScript;
|
||||||
|
|
||||||
|
QVERIFY(runScript.contains("call \"%BASE_DIR%\\lol\\TestOnlyC.exe\" %*"));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user