mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-05-07 06:59:35 +00:00
Merge branch 'v1.4' into qif
This commit is contained in:
commit
20d7df7e2e
@ -53,6 +53,7 @@ SOURCES += \
|
||||
deploy.cpp \
|
||||
deploycore.cpp \
|
||||
envirement.cpp \
|
||||
extra.cpp \
|
||||
extracter.cpp \
|
||||
filemanager.cpp \
|
||||
idistribution.cpp \
|
||||
@ -68,6 +69,7 @@ SOURCES += \
|
||||
qif.cpp \
|
||||
qml.cpp \
|
||||
libinfo.cpp \
|
||||
qtdir.cpp \
|
||||
targetinfo.cpp
|
||||
|
||||
HEADERS += \
|
||||
@ -80,6 +82,7 @@ HEADERS += \
|
||||
deploy_global.h \
|
||||
deploycore.h \
|
||||
envirement.h \
|
||||
extra.h \
|
||||
extracter.h \
|
||||
filemanager.h \
|
||||
idistribution.h \
|
||||
@ -95,6 +98,7 @@ HEADERS += \
|
||||
qif.h \
|
||||
qml.h \
|
||||
libinfo.h \
|
||||
qtdir.h \
|
||||
targetinfo.h
|
||||
|
||||
STATECHARTS +=
|
||||
|
@ -16,6 +16,8 @@
|
||||
#include "pathutils.h"
|
||||
#include "quasarapp.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
bool ConfigParser::parseParams() {
|
||||
|
||||
auto path = QuasarAppUtils::Params::getStrArg("confFile");
|
||||
@ -558,29 +560,44 @@ void ConfigParser::initIgnoreList()
|
||||
_config.ignoreList.addRule(addRuleUnix("libnss"));
|
||||
}
|
||||
|
||||
// envWin.addEnv(recursiveInvairement("C:/Windows", 3), "", "");
|
||||
// ruleWin.prority = ExtraLib;
|
||||
// ruleWin.platform = Win;
|
||||
// ruleWin.enfirement = envWin;
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
auto path = env.value("PATH");
|
||||
auto winPath = findWindowsPath(path);
|
||||
|
||||
// auto addRuleWin = [&ruleWin](const QString & lib) {
|
||||
// ruleWin.label = lib;
|
||||
// return ruleWin;
|
||||
// };
|
||||
envWin.addEnv(recursiveInvairement(winPath + "/System32", 2), "", "");
|
||||
envWin.addEnv(recursiveInvairement(winPath + "/SysWOW64", 2), "", "");
|
||||
|
||||
ruleWin.prority = SystemLib;
|
||||
ruleWin.platform = Win;
|
||||
ruleWin.enfirement = envWin;
|
||||
|
||||
auto addRuleWin = [&ruleWin](const QString & lib) {
|
||||
ruleWin.label = lib;
|
||||
return ruleWin;
|
||||
};
|
||||
|
||||
// win and core libs : see https://en.wikipedia.org/wiki/Microsoft_Windows_library_files
|
||||
_config.ignoreList.addRule(addRuleWin("Hal.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("NTDLL.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("KERNEL32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("GDI32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("USER32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("COMCTL32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("COMDLG32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("WS2_32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("ADVAPI32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("NETAPI32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("OLE32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("SHSCRAP.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("WINMM.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("IMM32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("KernelBase.DLL"));
|
||||
|
||||
// _config.ignoreList.addRule(addRuleWin("kernelBase"));
|
||||
// _config.ignoreList.addRule(addRuleWin("gdi32"));
|
||||
// _config.ignoreList.addRule(addRuleWin("kernel32"));
|
||||
// _config.ignoreList.addRule(addRuleWin("msvcrt"));
|
||||
// _config.ignoreList.addRule(addRuleWin("user32"));
|
||||
}
|
||||
|
||||
void ConfigParser::initIgnoreEnvList() {
|
||||
QStringList ignoreEnvList;
|
||||
|
||||
// remove windows from envirement,
|
||||
ignoreEnvList.push_back(":/Windows");
|
||||
|
||||
if (QuasarAppUtils::Params::isEndable("ignoreEnv")) {
|
||||
auto ignoreList = QuasarAppUtils::Params::getStrArg("ignoreEnv").
|
||||
split(DeployCore::getSeparator(0));
|
||||
@ -696,31 +713,31 @@ bool ConfigParser::setQmake(const QString &value) {
|
||||
|
||||
for (auto &value : list) {
|
||||
if (value.contains("QT_INSTALL_LIBS")) {
|
||||
_config.qtDir.libs = getPathFrmoQmakeLine(value);
|
||||
_config.qtDir.setLibs(getPathFrmoQmakeLine(value));
|
||||
} else if (value.contains("QT_INSTALL_LIBEXECS")) {
|
||||
_config.qtDir.libexecs = getPathFrmoQmakeLine(value);
|
||||
_config.qtDir.setLibexecs(getPathFrmoQmakeLine(value));
|
||||
} else if (value.contains("QT_INSTALL_BINS")) {
|
||||
_config.qtDir.bins = getPathFrmoQmakeLine(value);
|
||||
_config.qtDir.setBins(getPathFrmoQmakeLine(value));
|
||||
} else if (value.contains("QT_INSTALL_PLUGINS")) {
|
||||
_config.qtDir.plugins = getPathFrmoQmakeLine(value);
|
||||
_config.qtDir.setPlugins(getPathFrmoQmakeLine(value));
|
||||
} else if (value.contains("QT_INSTALL_QML")) {
|
||||
_config.qtDir.qmls = getPathFrmoQmakeLine(value);
|
||||
_config.qtDir.setQmls(getPathFrmoQmakeLine(value));
|
||||
} else if (value.contains("QT_INSTALL_TRANSLATIONS")) {
|
||||
_config.qtDir.translations = getPathFrmoQmakeLine(value);
|
||||
_config.qtDir.setTranslations(getPathFrmoQmakeLine(value));
|
||||
} else if (value.contains("QT_INSTALL_DATA")) {
|
||||
_config.qtDir.resources = getPathFrmoQmakeLine(value) + "/resources";
|
||||
_config.qtDir.setResources(getPathFrmoQmakeLine(value) + "/resources");
|
||||
} else if (value.contains("QMAKE_XSPEC")) {
|
||||
auto val = value.split(':').value(1);
|
||||
|
||||
if (val.contains("win32")) {
|
||||
_config.qtDir.qtPlatform = Platform::Win;
|
||||
_config.qtDir.setQtPlatform(Platform::Win);
|
||||
} else {
|
||||
_config.qtDir.qtPlatform = Platform::Unix;
|
||||
_config.qtDir.setQtPlatform(Platform::Unix);
|
||||
}
|
||||
}
|
||||
}
|
||||
_config.envirement.addEnv(_config.qtDir.libs, _config.appDir, _config.getTargetDir());
|
||||
_config.envirement.addEnv(_config.qtDir.bins, _config.appDir, _config.getTargetDir());
|
||||
_config.envirement.addEnv(_config.qtDir.getLibs(), _config.appDir, _config.getTargetDir());
|
||||
_config.envirement.addEnv(_config.qtDir.getBins(), _config.appDir, _config.getTargetDir());
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -733,58 +750,58 @@ bool ConfigParser::setQtDir(const QString &value) {
|
||||
QuasarAppUtils::Params::verboseLog("get qt bin fail!");
|
||||
return false;
|
||||
}
|
||||
_config.qtDir.bins = info.absoluteFilePath() + ("/bin");
|
||||
_config.qtDir.setBins(info.absoluteFilePath() + ("/bin"));
|
||||
|
||||
if (!QFile::exists(info.absoluteFilePath() + ("/lib"))) {
|
||||
QuasarAppUtils::Params::verboseLog("get qt lib fail!");
|
||||
return false;
|
||||
}
|
||||
_config.qtDir.libs = info.absoluteFilePath() + ("/lib");
|
||||
_config.qtDir.setLibs(info.absoluteFilePath() + ("/lib"));
|
||||
|
||||
if (!QFile::exists(info.absoluteFilePath() + ("/qml"))) {
|
||||
QuasarAppUtils::Params::verboseLog("get qt qml fail!");
|
||||
} else {
|
||||
_config.qtDir.qmls = info.absoluteFilePath() + ("/qml");
|
||||
_config.qtDir.setQmls(info.absoluteFilePath() + ("/qml"));
|
||||
}
|
||||
|
||||
if (!QFile::exists(info.absoluteFilePath() + ("/plugins"))) {
|
||||
QuasarAppUtils::Params::verboseLog("get qt plugins fail!");
|
||||
} else {
|
||||
_config.qtDir.plugins = info.absoluteFilePath() + ("/plugins");
|
||||
_config.qtDir.setPlugins(info.absoluteFilePath() + ("/plugins"));
|
||||
}
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
if (!QFile::exists(info.absoluteFilePath() + ("/libexec"))) {
|
||||
QuasarAppUtils::Params::verboseLog("get qt libexec fail!");
|
||||
} else {
|
||||
_config.qtDir.libexecs = info.absoluteFilePath() + ("/libexec");
|
||||
_config.qtDir.setLibexecs(info.absoluteFilePath() + ("/libexec"));
|
||||
}
|
||||
#endif
|
||||
#ifdef Q_OS_WIN
|
||||
_config.qtDir.libexecs = info.absoluteFilePath() + ("/bin");
|
||||
_config.qtDir.setLibexecs(info.absoluteFilePath() + ("/bin"));
|
||||
#endif
|
||||
|
||||
if (!QFile::exists(info.absoluteFilePath() + ("/translations"))) {
|
||||
QuasarAppUtils::Params::verboseLog("get qt translations fail!");
|
||||
} else {
|
||||
_config.qtDir.translations = info.absoluteFilePath() + ("/translations");
|
||||
_config.qtDir.setTranslations(info.absoluteFilePath() + ("/translations"));
|
||||
}
|
||||
|
||||
if (!QFile::exists(info.absoluteFilePath() + ("/resources"))) {
|
||||
QuasarAppUtils::Params::verboseLog("get qt resources fail!");
|
||||
} else {
|
||||
_config.qtDir.resources = info.absoluteFilePath() + ("/resources");
|
||||
_config.qtDir.setResources(info.absoluteFilePath() + ("/resources"));
|
||||
}
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
_config.qtDir.qtPlatform = Platform::Unix;
|
||||
_config.qtDir.setQtPlatform(Platform::Unix);
|
||||
#endif
|
||||
#ifdef Q_OS_WIN
|
||||
_config.qtDir.qtPlatform = Platform::Win;
|
||||
_config.qtDir.setQtPlatform(Platform::Win);
|
||||
#endif
|
||||
|
||||
_config.envirement.addEnv(_config.qtDir.libs, _config.appDir, _config.getTargetDir());
|
||||
_config.envirement.addEnv(_config.qtDir.bins, _config.appDir, _config.getTargetDir());
|
||||
_config.envirement.addEnv(_config.qtDir.getLibs(), _config.appDir, _config.getTargetDir());
|
||||
_config.envirement.addEnv(_config.qtDir.getBins(), _config.appDir, _config.getTargetDir());
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -803,12 +820,12 @@ void ConfigParser::setExtraPath(const QStringList &value) {
|
||||
|
||||
dir.setPath(info.absoluteFilePath());
|
||||
auto extraDirs = getSetDirsRecursive(QDir::fromNativeSeparators(info.absoluteFilePath()), _config.depchLimit);
|
||||
_config.extraPaths.extraPaths.unite(extraDirs);
|
||||
_config.extraPaths.addExtraPaths(extraDirs);
|
||||
|
||||
_config.envirement.addEnv(recursiveInvairement(dir), _config.appDir, _config.getTargetDir());
|
||||
} else if (i.size() > 1) {
|
||||
|
||||
_config.extraPaths.extraPathsMasks.insert(i);
|
||||
_config.extraPaths.addExtraPathsMasks({i});
|
||||
|
||||
QuasarAppUtils::Params::verboseLog(i + " added like a path mask",
|
||||
QuasarAppUtils::Info);
|
||||
@ -823,7 +840,7 @@ void ConfigParser::setExtraPath(const QStringList &value) {
|
||||
void ConfigParser::setExtraNames(const QStringList &value) {
|
||||
for (auto i : value) {
|
||||
if (i.size() > 1) {
|
||||
_config.extraPaths.extraPathsMasks.insert(i);
|
||||
_config.extraPaths.addtExtraNamesMasks({i});
|
||||
|
||||
QuasarAppUtils::Params::verboseLog(i + " added like a file name mask",
|
||||
QuasarAppUtils::Info);
|
||||
@ -883,16 +900,44 @@ QString ConfigParser::recursiveInvairement(const QString &dir, int depch) {
|
||||
return recursiveInvairement(_dir, 0, depch);
|
||||
}
|
||||
|
||||
QString ConfigParser::findWindowsPath(const QString& path) const {
|
||||
auto list = path.split(';');
|
||||
QString win_magic = "windows";
|
||||
|
||||
for (auto i: list ) {
|
||||
int index = i.indexOf(win_magic, 0, Qt::CaseInsensitive);
|
||||
if (index > 0 && i.size() == index + win_magic.size()) {
|
||||
return QDir::fromNativeSeparators(i);
|
||||
}
|
||||
}
|
||||
|
||||
return "C:/" + win_magic;
|
||||
}
|
||||
|
||||
void ConfigParser::initEnvirement() {
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
|
||||
auto path = env.value("PATH");
|
||||
|
||||
_config.envirement.addEnv(env.value("LD_LIBRARY_PATH"), _config.appDir, _config.getTargetDir());
|
||||
_config.envirement.addEnv(env.value("PATH"), _config.appDir, _config.getTargetDir());
|
||||
_config.envirement.addEnv(path, _config.appDir, _config.getTargetDir());
|
||||
|
||||
|
||||
QStringList dirs;
|
||||
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
|
||||
dirs.append(getDirsRecursive("/lib", 5));
|
||||
dirs.append(getDirsRecursive("/usr/lib", 5));
|
||||
#else
|
||||
auto winPath = findWindowsPath(path);
|
||||
dirs.append(getDirsRecursive(winPath + "/System32", 2));
|
||||
dirs.append(getDirsRecursive(winPath + "/SysWOW64", 2));
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
for (auto &&i : dirs) {
|
||||
_config.envirement.addEnv(i, _config.appDir, _config.getTargetDir());
|
||||
@ -974,4 +1019,3 @@ ConfigParser::ConfigParser(FileManager *filemanager, DependenciesScanner* scaner
|
||||
|
||||
QuasarAppUtils::Params::verboseLog("appDir = " + _config.appDir);
|
||||
}
|
||||
|
||||
|
@ -81,6 +81,7 @@ private:
|
||||
|
||||
QString readKeyArray(int separatorLvl, const QJsonArray &array, const QString &confFileDir) const;
|
||||
QJsonValue writeKeyArray(int separatorLvl, const QString ¶meter, const QString &confFileDir) const;
|
||||
QString findWindowsPath(const QString &path) const;
|
||||
public:
|
||||
ConfigParser(FileManager *filemanager, DependenciesScanner *scaner);
|
||||
bool parseParams();
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "dependenciesscanner.h"
|
||||
#include "deploycore.h"
|
||||
#include "quasarapp.h"
|
||||
#include "configparser.h"
|
||||
#include <QList>
|
||||
#include <QDir>
|
||||
#include <QDebug>
|
||||
@ -58,7 +59,10 @@ QMultiMap<LibPriority, LibInfo> DependenciesScanner::getLibsFromEnvirement(
|
||||
|
||||
info.setPriority(priority);
|
||||
|
||||
res.insertMulti(info.getPriority(), info);
|
||||
if (!DeployCore::_config->ignoreList.isIgnore(info)) {
|
||||
res.insertMulti(info.getPriority(), info);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return res;
|
||||
@ -147,7 +151,6 @@ void DependenciesScanner::setEnvironment(const QStringList &env) {
|
||||
QDir::Files| QDir::NoDotAndDotDot);
|
||||
|
||||
for (auto i : list) {
|
||||
|
||||
_EnvLibs.insertMulti(i.fileName().toUpper(), i.absoluteFilePath());
|
||||
}
|
||||
|
||||
|
@ -38,36 +38,3 @@ DistroStruct DeployConfig::getDistroFromPrefix(const QString &prefix) const {
|
||||
|
||||
return prefixes.value("");
|
||||
}
|
||||
|
||||
bool QtDir::isQt(const QString& path) const {
|
||||
|
||||
return
|
||||
(!libs.isEmpty() && path.contains(libs)) ||
|
||||
(!bins.isEmpty() && path.contains(bins)) ||
|
||||
(!libexecs.isEmpty() && path.contains(libexecs)) ||
|
||||
(!plugins.isEmpty() && path.contains(plugins)) ||
|
||||
(!qmls.isEmpty() && path.contains(qmls)) ||
|
||||
(!translations.isEmpty() && path.contains(translations)) ||
|
||||
(!resources.isEmpty() && path.contains(resources));
|
||||
}
|
||||
|
||||
bool Extra::contains(const QString &path) const {
|
||||
QFileInfo info(path);
|
||||
if (extraPaths.contains(info.absolutePath())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (auto i: extraPathsMasks) {
|
||||
if (info.absoluteFilePath().contains(i)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto i: extraNamesMasks) {
|
||||
if (info.fileName().contains(i)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -3,32 +3,11 @@
|
||||
#include "deploy_global.h"
|
||||
|
||||
#include "distromodule.h"
|
||||
#include "extra.h"
|
||||
#include "ignorerule.h"
|
||||
#include "qtdir.h"
|
||||
#include "targetinfo.h"
|
||||
|
||||
struct DEPLOYSHARED_EXPORT QtDir {
|
||||
QString libs;
|
||||
QString bins;
|
||||
QString libexecs;
|
||||
QString plugins;
|
||||
QString qmls;
|
||||
QString translations;
|
||||
QString resources;
|
||||
|
||||
Platform qtPlatform;
|
||||
|
||||
bool isQt(const QString &path) const;
|
||||
};
|
||||
|
||||
struct DEPLOYSHARED_EXPORT Extra {
|
||||
QSet<QString> extraPaths;
|
||||
QSet<QString> extraPathsMasks;
|
||||
QSet<QString> extraNamesMasks;
|
||||
|
||||
bool contains(const QString &path) const;
|
||||
|
||||
};
|
||||
|
||||
class DEPLOYSHARED_EXPORT DeployConfig {
|
||||
|
||||
public:
|
||||
|
@ -6,11 +6,20 @@
|
||||
//#
|
||||
|
||||
#include "envirement.h"
|
||||
#include "pathutils.h"
|
||||
#include "quasarapp.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
|
||||
QSet<QString> Envirement::upper(const QSet<QString>& set) const {
|
||||
QSet<QString> res;
|
||||
for (auto &i : set) {
|
||||
res.insert(PathUtils::fixPath(i));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
QStringList Envirement::deployEnvironment() const
|
||||
{
|
||||
return _deployEnvironment.toList();
|
||||
@ -23,7 +32,7 @@ QStringList Envirement::ignoreEnvList() const
|
||||
|
||||
void Envirement::setIgnoreEnvList(const QStringList &ignoreEnvList)
|
||||
{
|
||||
_ignoreEnvList = ignoreEnvList.toSet();
|
||||
_ignoreEnvList = upper(ignoreEnvList.toSet());
|
||||
}
|
||||
|
||||
void Envirement::addEnv(const QString &dir, const QString &appDir, const QString& targetDir) {
|
||||
@ -45,16 +54,9 @@ void Envirement::addEnv(const QString &dir, const QString &appDir, const QString
|
||||
auto path = QFileInfo(dir).absoluteFilePath();
|
||||
|
||||
for (QString i :_ignoreEnvList) {
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
if (path.contains(i, Qt::CaseInsensitive)) {
|
||||
if (path.contains(i, ONLY_WIN_CASE_INSENSIATIVE)) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if (path.contains(i)) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!appDir.isEmpty() && path.contains(appDir)) {
|
||||
@ -77,16 +79,19 @@ void Envirement::addEnv(const QString &dir, const QString &appDir, const QString
|
||||
return;
|
||||
}
|
||||
|
||||
_deployEnvironment.insert(QDir::fromNativeSeparators(path));
|
||||
_deployEnvironment.insert(PathUtils::fixPath(QDir::fromNativeSeparators(path)));
|
||||
|
||||
}
|
||||
|
||||
bool Envirement::inThisEnvirement(const QString &file) const {
|
||||
QFileInfo info (file);
|
||||
|
||||
if (info.isFile()) {
|
||||
return _deployEnvironment.contains(info.absolutePath());
|
||||
return _deployEnvironment.contains(PathUtils::fixPath(info.absolutePath()));
|
||||
}
|
||||
|
||||
return _deployEnvironment.contains(file);
|
||||
return _deployEnvironment.contains(PathUtils::fixPath(file));
|
||||
|
||||
}
|
||||
|
||||
int Envirement::size() const {
|
||||
|
@ -20,6 +20,7 @@ private:
|
||||
QSet<QString> _ignoreEnvList;
|
||||
QSet<QString> _deployEnvironment;
|
||||
|
||||
QSet<QString> upper(const QSet<QString> &set) const;
|
||||
public:
|
||||
Envirement();
|
||||
QStringList deployEnvironment() const;
|
||||
|
72
Deploy/extra.cpp
Normal file
72
Deploy/extra.cpp
Normal file
@ -0,0 +1,72 @@
|
||||
#include "extra.h"
|
||||
#include "pathutils.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
|
||||
|
||||
QSet<QString> Extra::getExtraPathsMasks() const {
|
||||
return extraPathsMasks;
|
||||
}
|
||||
|
||||
void Extra::setExtraPathsMasks(const QSet<QString> &value) {
|
||||
extraPathsMasks = upper(value);
|
||||
}
|
||||
|
||||
void Extra::addExtraPathsMasks(const QSet<QString> &value) {
|
||||
extraPathsMasks += upper(value);
|
||||
}
|
||||
|
||||
QSet<QString> Extra::getExtraNamesMasks() const {
|
||||
return extraNamesMasks;
|
||||
}
|
||||
|
||||
void Extra::setExtraNamesMasks(const QSet<QString> &value) {
|
||||
extraNamesMasks = upper(value);
|
||||
}
|
||||
|
||||
void Extra::addtExtraNamesMasks(const QSet<QString> &value) {
|
||||
extraNamesMasks += upper(value);
|
||||
}
|
||||
|
||||
QSet<QString> Extra::upper(const QSet<QString>& set) const {
|
||||
QSet<QString> res;
|
||||
for (auto &i : set) {
|
||||
res.insert(PathUtils::fixPath(i));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
QSet<QString> Extra::getExtraPaths() const {
|
||||
return extraPaths;
|
||||
}
|
||||
|
||||
void Extra::setExtraPaths(const QSet<QString> &value) {
|
||||
extraPaths = upper(value);
|
||||
}
|
||||
|
||||
void Extra::addExtraPaths(const QSet<QString> &value) {
|
||||
extraPaths += upper(value);
|
||||
}
|
||||
|
||||
|
||||
bool Extra::contains(const QString &path) const {
|
||||
QFileInfo info(path);
|
||||
if (extraPaths.contains(PathUtils::fixPath(info.absolutePath()))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (auto i: extraPathsMasks) {
|
||||
if (PathUtils::fixPath(info.absoluteFilePath()).contains(i)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto i: extraNamesMasks) {
|
||||
if (PathUtils::fixPath(info.fileName()).contains(i)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
31
Deploy/extra.h
Normal file
31
Deploy/extra.h
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef EXTRA_H
|
||||
#define EXTRA_H
|
||||
#include "deploy_global.h"
|
||||
|
||||
#include <QSet>
|
||||
|
||||
|
||||
class DEPLOYSHARED_EXPORT Extra {
|
||||
QSet<QString> extraPaths;
|
||||
QSet<QString> extraPathsMasks;
|
||||
QSet<QString> extraNamesMasks;
|
||||
|
||||
QSet<QString> upper(const QSet<QString> & ) const;
|
||||
|
||||
public:
|
||||
QSet<QString> getExtraPaths() const;
|
||||
void setExtraPaths(const QSet<QString> &value);
|
||||
void addExtraPaths(const QSet<QString> &value);
|
||||
|
||||
QSet<QString> getExtraPathsMasks() const;
|
||||
void setExtraPathsMasks(const QSet<QString> &value);
|
||||
void addExtraPathsMasks(const QSet<QString> &value);
|
||||
|
||||
QSet<QString> getExtraNamesMasks() const;
|
||||
void setExtraNamesMasks(const QSet<QString> &value);
|
||||
void addtExtraNamesMasks(const QSet<QString> &value);
|
||||
|
||||
bool contains(const QString &path) const;
|
||||
|
||||
};
|
||||
#endif // EXTRA_H
|
@ -22,12 +22,13 @@
|
||||
#include <quasarapp.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <fstream>
|
||||
|
||||
bool Extracter::deployMSVC() {
|
||||
qInfo () << "try deploy msvc";
|
||||
auto msvcInstaller = DeployCore::getVCredist(DeployCore::_config->qtDir.bins);
|
||||
auto msvcInstaller = DeployCore::getVCredist(DeployCore::_config->qtDir.getBins());
|
||||
|
||||
if (msvcInstaller.isEmpty()) {
|
||||
return false;
|
||||
@ -50,8 +51,8 @@ bool Extracter::extractWebEngine() {
|
||||
|
||||
auto prefix = i.key();
|
||||
if (isWebEngine(prefix)) {
|
||||
auto webEngeneBin = DeployCore::_config->qtDir.libexecs;
|
||||
if (DeployCore::_config->qtDir.qtPlatform & Platform::Unix) {
|
||||
auto webEngeneBin = DeployCore::_config->qtDir.getLibexecs();
|
||||
if (DeployCore::_config->qtDir.getQtPlatform() & Platform::Unix) {
|
||||
webEngeneBin += "/QtWebEngineProcess";
|
||||
} else {
|
||||
webEngeneBin += "/QtWebEngineProcess.exe";
|
||||
@ -59,7 +60,7 @@ bool Extracter::extractWebEngine() {
|
||||
|
||||
auto destWebEngine = DeployCore::_config->getTargetDir() + prefix + DeployCore::_config->prefixes[prefix].getBinOutDir();
|
||||
auto resOut = DeployCore::_config->getTargetDir() + prefix + DeployCore::_config->prefixes[prefix].getResOutDir();
|
||||
auto res = DeployCore::_config->qtDir.resources;
|
||||
auto res = DeployCore::_config->qtDir.getResources();
|
||||
|
||||
if (!_fileManager->copyFile(webEngeneBin, destWebEngine)) {
|
||||
return false;
|
||||
@ -112,7 +113,7 @@ void Extracter::copyExtraPlugins(const QString& prefix) {
|
||||
for (auto extraPlugin : DeployCore::_config->extraPlugins) {
|
||||
|
||||
if (!PathUtils::isPath(extraPlugin)) {
|
||||
extraPlugin = DeployCore::_config->qtDir.plugins + "/" + extraPlugin;
|
||||
extraPlugin = DeployCore::_config->qtDir.getPlugins() + "/" + extraPlugin;
|
||||
}
|
||||
|
||||
info.setFile(extraPlugin);
|
||||
@ -171,7 +172,7 @@ void Extracter::extractPlugins() {
|
||||
auto distro = cnf->getDistroFromPrefix(i.key());
|
||||
|
||||
QStringList plugins;
|
||||
pluginsParser.scan(cnf->qtDir.plugins, plugins, _prefixDependencyes[i.key()].qtModules());
|
||||
pluginsParser.scan(cnf->qtDir.getPlugins(), plugins, _prefixDependencyes[i.key()].qtModules());
|
||||
copyPlugins(plugins, i.key());
|
||||
}
|
||||
}
|
||||
@ -260,7 +261,7 @@ bool Extracter::copyTranslations(QStringList list, const QString& prefix) {
|
||||
|
||||
auto cnf = DeployCore::_config;
|
||||
|
||||
QDir dir(cnf->qtDir.translations);
|
||||
QDir dir(cnf->qtDir.getTranslations());
|
||||
if (!dir.exists() || list.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
@ -281,7 +282,7 @@ bool Extracter::copyTranslations(QStringList list, const QString& prefix) {
|
||||
|
||||
if (isWebEngine(prefix)) {
|
||||
auto trOut = targetPath + distro.getTrOutDir();
|
||||
auto tr = DeployCore::_config->qtDir.translations + "/qtwebengine_locales";
|
||||
auto tr = DeployCore::_config->qtDir.getTranslations() + "/qtwebengine_locales";
|
||||
_fileManager->copyFolder(tr, trOut + "/qtwebengine_locales");
|
||||
}
|
||||
|
||||
@ -323,7 +324,7 @@ void Extracter::extractLib(const QString &file,
|
||||
|
||||
for (auto &line : data) {
|
||||
|
||||
if (mask.size() && !line.getName().contains(mask)) {
|
||||
if (mask.size() && !line.getName().contains(mask, ONLY_WIN_CASE_INSENSIATIVE)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -345,7 +346,7 @@ void Extracter::extractLib(const QString &file,
|
||||
|
||||
bool Extracter::extractQmlAll() {
|
||||
|
||||
if (!QFileInfo::exists(DeployCore::_config->qtDir.qmls)) {
|
||||
if (!QFileInfo::exists(DeployCore::_config->qtDir.getQmls())) {
|
||||
qWarning() << "qml dir wrong!";
|
||||
return false;
|
||||
}
|
||||
@ -359,7 +360,7 @@ bool Extracter::extractQmlAll() {
|
||||
|
||||
QStringList listItems;
|
||||
|
||||
if (!_fileManager->copyFolder(cnf->qtDir.qmls, targetPath + distro.getQmlOutDir(),
|
||||
if (!_fileManager->copyFolder(cnf->qtDir.getQmls(), targetPath + distro.getQmlOutDir(),
|
||||
QStringList() << ".so.debug" << "d.dll" << ".pdb",
|
||||
&listItems)) {
|
||||
return false;
|
||||
@ -390,7 +391,7 @@ bool Extracter::extractQmlFromSource(const QString& sourceDir) {
|
||||
|
||||
QuasarAppUtils::Params::verboseLog("extractQmlFromSource " + info.absoluteFilePath());
|
||||
|
||||
if (!QFileInfo::exists(cnf->qtDir.qmls)) {
|
||||
if (!QFileInfo::exists(cnf->qtDir.getQmls())) {
|
||||
qWarning() << "qml dir wrong!";
|
||||
return false;
|
||||
}
|
||||
@ -400,7 +401,7 @@ bool Extracter::extractQmlFromSource(const QString& sourceDir) {
|
||||
QStringList filter;
|
||||
filter << ".so.debug" << "d.dll" << ".pdb";
|
||||
|
||||
QML ownQmlScaner(cnf->qtDir.qmls);
|
||||
QML ownQmlScaner(cnf->qtDir.getQmls());
|
||||
|
||||
if (!ownQmlScaner.scan(plugins, info.absoluteFilePath())) {
|
||||
QuasarAppUtils::Params::verboseLog("qml scaner run failed!");
|
||||
@ -411,7 +412,7 @@ bool Extracter::extractQmlFromSource(const QString& sourceDir) {
|
||||
auto targetPath = cnf->getTargetDir() + i.key();
|
||||
auto distro = cnf->getDistroFromPrefix(i.key());
|
||||
|
||||
if (!_fileManager->copyFolder(cnf->qtDir.qmls,
|
||||
if (!_fileManager->copyFolder(cnf->qtDir.getQmls(),
|
||||
targetPath + distro.getQmlOutDir(),
|
||||
filter , &listItems, &plugins)) {
|
||||
return false;
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "deploycore.h"
|
||||
#include <QProcess>
|
||||
#include <fstream>
|
||||
#include "pathutils.h"
|
||||
|
||||
FileManager::FileManager() {
|
||||
}
|
||||
@ -75,7 +76,7 @@ void FileManager::saveDeploymendFiles(const QString& targetDir) {
|
||||
bool FileManager::strip(const QString &dir) const {
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
Q_UNUSED(dir);
|
||||
Q_UNUSED(dir)
|
||||
return true;
|
||||
#else
|
||||
QFileInfo info(dir);
|
||||
@ -126,7 +127,7 @@ bool FileManager::fileActionPrivate(const QString &file, const QString &target,
|
||||
bool copy = !masks;
|
||||
if (masks) {
|
||||
for (auto mask : *masks) {
|
||||
if (info.absoluteFilePath().contains(mask)) {
|
||||
if (info.absoluteFilePath().contains(mask, ONLY_WIN_CASE_INSENSIATIVE)) {
|
||||
copy = true;
|
||||
break;
|
||||
}
|
||||
@ -208,7 +209,7 @@ bool FileManager::removeFile(const QString &file) {
|
||||
bool FileManager::smartCopyFile(const QString &file, const QString &target, QStringList *mask) {
|
||||
auto config = DeployCore::_config;
|
||||
|
||||
if (file.contains(config->getTargetDir())) {
|
||||
if (file.contains(config->getTargetDir(), ONLY_WIN_CASE_INSENSIATIVE)) {
|
||||
if (!moveFile(file, target, mask)) {
|
||||
QuasarAppUtils::Params::verboseLog(" file not moved! try copy");
|
||||
|
||||
@ -246,7 +247,7 @@ bool FileManager::copyFolder(const QString &from, const QString &to, const QStri
|
||||
|
||||
QString skipFilter = "";
|
||||
for (auto && i: filter) {
|
||||
if (item.fileName().contains(i)) {
|
||||
if (item.fileName().contains(i, ONLY_WIN_CASE_INSENSIATIVE)) {
|
||||
skipFilter = i;
|
||||
break;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ void IgnoreRule::addRule(const IgnoreData &rule) {
|
||||
}
|
||||
|
||||
bool IgnoreRule::check(const LibInfo &info, const QString& ignoreLabel) const {
|
||||
if (info.fullPath().contains(ignoreLabel)) {
|
||||
if (info.fullPath().contains(ignoreLabel, Qt::CaseInsensitive)) {
|
||||
QuasarAppUtils::Params::verboseLog(info.fullPath() + " ignored by filter" + ignoreLabel);
|
||||
return true;
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "libinfo.h"
|
||||
#include "pathutils.h"
|
||||
|
||||
bool operator ==(const LibInfo &left, const LibInfo &right) {
|
||||
return left.fullPath() == right.fullPath();
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <configparser.h>
|
||||
#include "filemanager.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
bool MetaFileManager::createRunScriptWindows(const QString &target) {
|
||||
|
||||
|
@ -88,6 +88,14 @@ bool PathUtils::isAbsalutPath(const QString &path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
QString PathUtils::fixPath(const QString &path) {
|
||||
#ifdef Q_OS_WIN
|
||||
return path.toUpper();
|
||||
#else
|
||||
return path;
|
||||
#endif
|
||||
}
|
||||
|
||||
QString PathUtils::getReleativePath(QString path) {
|
||||
path = toFullPath(path);
|
||||
|
||||
|
@ -5,12 +5,20 @@
|
||||
//# of this license document, but changing it is not allowed.
|
||||
//#
|
||||
|
||||
#include <QString>
|
||||
#include "deploy_global.h"
|
||||
|
||||
|
||||
#ifndef PATHUTILS_H
|
||||
#define PATHUTILS_H
|
||||
|
||||
#include <QString>
|
||||
#include "deploy_global.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#define ONLY_WIN_CASE_INSENSIATIVE Qt::CaseInsensitive
|
||||
#else
|
||||
#define ONLY_WIN_CASE_INSENSIATIVE Qt::CaseSensitive
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief The PathUtils class
|
||||
*
|
||||
@ -69,6 +77,13 @@ public:
|
||||
*/
|
||||
static bool isAbsalutPath(const QString &path);
|
||||
|
||||
/**
|
||||
* @brief fixPath - this method make upper case for all symbols of path on windows os. on linux doing nothing
|
||||
* @param path - a input path
|
||||
* @return return a fixed path
|
||||
*/
|
||||
static QString fixPath(const QString & path);
|
||||
|
||||
};
|
||||
|
||||
#endif // PATHUTILS_H
|
||||
|
@ -52,7 +52,7 @@ bool PE::getDep(peparse::parsed_pe_internal * internal, LibInfo &res) const {
|
||||
}
|
||||
}
|
||||
|
||||
return res.getDependncies().size();
|
||||
return res.getDependncies().size() || !imports.size();
|
||||
}
|
||||
|
||||
PE::PE(): IGetLibInfo () {
|
||||
@ -77,6 +77,7 @@ bool PE::getLibInfo(const QString &lib, LibInfo &info) const {
|
||||
info.setPath(QFileInfo(lib).absolutePath());
|
||||
|
||||
if (!getDep(parsedPeLib->internal, info)) {
|
||||
peparse::DestructParsedPE(parsedPeLib);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
81
Deploy/qtdir.cpp
Normal file
81
Deploy/qtdir.cpp
Normal file
@ -0,0 +1,81 @@
|
||||
#include "pathutils.h"
|
||||
#include "qtdir.h"
|
||||
|
||||
QString QtDir::getLibs() const {
|
||||
return libs;
|
||||
}
|
||||
|
||||
void QtDir::setLibs(const QString &value) {
|
||||
libs = PathUtils::fixPath(value);
|
||||
}
|
||||
|
||||
QString QtDir::getBins() const {
|
||||
return bins;
|
||||
}
|
||||
|
||||
void QtDir::setBins(const QString &value) {
|
||||
bins = PathUtils::fixPath(value);
|
||||
}
|
||||
|
||||
QString QtDir::getLibexecs() const {
|
||||
return libexecs;
|
||||
}
|
||||
|
||||
void QtDir::setLibexecs(const QString &value) {
|
||||
libexecs = PathUtils::fixPath(value);
|
||||
}
|
||||
|
||||
QString QtDir::getPlugins() const {
|
||||
return plugins;
|
||||
}
|
||||
|
||||
void QtDir::setPlugins(const QString &value) {
|
||||
plugins = PathUtils::fixPath(value);
|
||||
}
|
||||
|
||||
QString QtDir::getQmls() const {
|
||||
return qmls;
|
||||
}
|
||||
|
||||
void QtDir::setQmls(const QString &value)
|
||||
{
|
||||
qmls = PathUtils::fixPath(value);
|
||||
}
|
||||
|
||||
QString QtDir::getTranslations() const {
|
||||
return translations;
|
||||
}
|
||||
|
||||
void QtDir::setTranslations(const QString &value) {
|
||||
translations = PathUtils::fixPath(value);
|
||||
}
|
||||
|
||||
QString QtDir::getResources() const{
|
||||
return resources;
|
||||
}
|
||||
|
||||
void QtDir::setResources(const QString &value) {
|
||||
resources = PathUtils::fixPath(value);
|
||||
}
|
||||
|
||||
Platform QtDir::getQtPlatform() const {
|
||||
return qtPlatform;
|
||||
}
|
||||
|
||||
void QtDir::setQtPlatform(const Platform &value) {
|
||||
qtPlatform = value;
|
||||
}
|
||||
|
||||
bool QtDir::isQt(QString path) const {
|
||||
|
||||
path = PathUtils::fixPath(path);
|
||||
|
||||
return
|
||||
(!libs.isEmpty() && path.contains(libs)) ||
|
||||
(!bins.isEmpty() && path.contains(bins)) ||
|
||||
(!libexecs.isEmpty() && path.contains(libexecs)) ||
|
||||
(!plugins.isEmpty() && path.contains(plugins)) ||
|
||||
(!qmls.isEmpty() && path.contains(qmls)) ||
|
||||
(!translations.isEmpty() && path.contains(translations)) ||
|
||||
(!resources.isEmpty() && path.contains(resources));
|
||||
}
|
41
Deploy/qtdir.h
Normal file
41
Deploy/qtdir.h
Normal file
@ -0,0 +1,41 @@
|
||||
#ifndef QTDIR_H
|
||||
#define QTDIR_H
|
||||
|
||||
#include <QDir>
|
||||
#include "deploy_global.h"
|
||||
#include "deploycore.h"
|
||||
|
||||
class DEPLOYSHARED_EXPORT QtDir {
|
||||
QString libs;
|
||||
QString bins;
|
||||
QString libexecs;
|
||||
QString plugins;
|
||||
QString qmls;
|
||||
QString translations;
|
||||
QString resources;
|
||||
|
||||
Platform qtPlatform;
|
||||
|
||||
|
||||
public:
|
||||
QString getLibs() const;
|
||||
void setLibs(const QString &value);
|
||||
QString getBins() const;
|
||||
void setBins(const QString &value);
|
||||
QString getLibexecs() const;
|
||||
void setLibexecs(const QString &value);
|
||||
QString getPlugins() const;
|
||||
void setPlugins(const QString &value);
|
||||
QString getQmls() const;
|
||||
void setQmls(const QString &value);
|
||||
QString getTranslations() const;
|
||||
void setTranslations(const QString &value);
|
||||
QString getResources() const;
|
||||
void setResources(const QString &value);
|
||||
Platform getQtPlatform() const;
|
||||
void setQtPlatform(const Platform &value);
|
||||
bool isQt(QString path) const;
|
||||
|
||||
};
|
||||
|
||||
#endif // QTDIR_H
|
@ -64,9 +64,13 @@ releaseSnap.commands = snapcraft push *.snap # bad patern
|
||||
|
||||
unix:deploy.depends += clearSnap
|
||||
unix:deploy.depends += buildSnap
|
||||
unix:deploy.depends += deploySnap
|
||||
|
||||
unix:deploy.release += releaseSnap
|
||||
!isEmpty( ONLINE ) {
|
||||
|
||||
message(Snap)
|
||||
unix:deploy.depends += deploySnap
|
||||
unix:release.depends += releaseSnap
|
||||
}
|
||||
|
||||
OTHER_FILES += \
|
||||
$$META_DIR/* \
|
||||
|
@ -36,12 +36,28 @@ function systemIntegration() {
|
||||
|
||||
if (!installer.fileExists(homeDir + "/.local/bin")) {
|
||||
|
||||
component.addOperation('Execute', ["mkpath", "-p", homeDir + "/.local/bin"])
|
||||
component.addOperation('Execute', ["mkdir", "-p", homeDir + "/.local/bin"])
|
||||
|
||||
QMessageBox["warning"](qsTr("install in system"), qsTr("Installer"),
|
||||
qsTr("The \"~/local/bin\" folder was not initialized, you may need to reboot to work correctly!"),
|
||||
QMessageBox.Ok);
|
||||
|
||||
var ansver = installer.execute('cat', [homeDir + "/.profile"]);
|
||||
var result;
|
||||
if (ansver.length >= 2) {
|
||||
result = ansver[0];
|
||||
}
|
||||
|
||||
if (!result.includes("/.local/bin")) {
|
||||
|
||||
var script = '\n# set PATH so it includes users private bin if it exists (generated by cqtdeployer installer) \n' +
|
||||
'if [ -d "$HOME/.local/bin" ] ; then \n' +
|
||||
' PATH="$HOME/.local/bin:$PATH" \n' +
|
||||
'fi \n';
|
||||
|
||||
component.addOperation('AppendFile', [homeDir + "/.profile", script])
|
||||
}
|
||||
|
||||
}
|
||||
component.addOperation('Execute', ["ln", "-sf", targetDir + "/" + VERSION + "/cqtdeployer.sh",
|
||||
homeDir + "/.local/bin/cqtdeployer"],
|
||||
|
87
README.md
87
README.md
@ -28,20 +28,38 @@ Key differences of this program:
|
||||
|
||||
See list of all options [here](./doc/Options.md)
|
||||
|
||||
## Build for Linux
|
||||
- install qt and qt QtInstallFrameWork from [qtInstaller](https://www.qt.io/download-qt-installer?hsCtaTracking=9f6a2170-a938-42df-a8e2-a9f0b1d6cdce%7C6cb0de4f-9bb5-4778-ab02-bfb62735f3e5)
|
||||
- qmake -r
|
||||
- make -j$(nproc)
|
||||
- make deploy # this command requires the installed [cqtdeployer](https://github.com/QuasarApp/CQtDeployer/releases)
|
||||
- ./Distro/CQtDeployerInstaller.run
|
||||
|
||||
## Build for Windows
|
||||
- install qt and qt QtInstallFrameWork from [qtInstaller](https://www.qt.io/download-qt-installer?hsCtaTracking=9f6a2170-a938-42df-a8e2-a9f0b1d6cdce%7C6cb0de4f-9bb5-4778-ab02-bfb62735f3e5)
|
||||
- qmake -r
|
||||
- make -j$(nproc)
|
||||
- make deploy # this command requires the installed [cqtdeployer](https://github.com/QuasarApp/CQtDeployer/releases)
|
||||
- ./Distro/CQtDeployerInstaller.exe
|
||||
|
||||
#### Example: cqtdeployer -bin myApp -qmlDir ~/MyAppProject/qml -qmake ~/Qt/5.12.4/gcc_64/bin/qmake clear
|
||||
|
||||
|
||||
## Build for Linux
|
||||
- install qt and qt QtInstallFrameWork from [qt installer](https://www.qt.io/download-qt-installer?hsCtaTracking=9f6a2170-a938-42df-a8e2-a9f0b1d6cdce%7C6cb0de4f9bb77-7bb77-4bb77-4)
|
||||
- git clone https://github.com/QuasarApp/CQtDeployer.git
|
||||
- cd CQtDeployer
|
||||
- git submodule update --init --recursive
|
||||
- qmake -r
|
||||
- Here you must definitely call the qmake that was loaded from the 1st item.
|
||||
- Example: ~/Qt/5.14.0/gcc_64/bin/qmake -r
|
||||
- make -j$(nproc)
|
||||
- make deploy
|
||||
- #this command requires installed [cqtdeployer](https://github.com/QuasarApp/CQtDeployer/releases)
|
||||
- ./Distro/CQtDeployerInstaller.run
|
||||
|
||||
## Build for Windows (CMD)
|
||||
- install qt and qt QtInstallFrameWork from [qt installer](https://www.qt.io/download-qt-installer?hsCtaTracking=9f6a2170-a938-42df-a8e2-a9f0b1d6cdce%7C6cb0de4f9bb77-7bb77-4bb77-4)
|
||||
- git clone https://github.com/QuasarApp/CQtDeployer.git
|
||||
- cd CQtDeployer
|
||||
- git submodule update --init --recursive
|
||||
- SET PATH=C:/Qt/Tools/mingw730_64/bin;%PATH%
|
||||
- It is important to set up the qt environment.
|
||||
- qmake.exe -r
|
||||
- Here you must definitely call the qmake that was loaded from the 1st item.
|
||||
- Example: C:/Qt/5.14.0/mingw73_64/bin/qmake.exe -r
|
||||
- migw32-make.exe -j$(nproc)
|
||||
- migw32-make.exe deploy
|
||||
- #this command requires installed [cqtdeployer](https://github.com/QuasarApp/CQtDeployer/releases)
|
||||
- ./Distro/CQtDeployerInstaller.exe
|
||||
|
||||
## Install
|
||||
You can download the latest version of the application [here](https://github.com/QuasarApp/CQtDeployer/releases).
|
||||
|
||||
@ -88,20 +106,35 @@ Qt CQtDeployer - это приложением для извлечения вс
|
||||
|
||||
Смотрите список всех опций [здесь](./doc/Options.md)
|
||||
|
||||
## Build для Linux
|
||||
- установите qt и qt QtInstallFrameWork из [Установщик qt](https://www.qt.io/download-qt-installer?hsCtaTracking=9f6a2170-a938-42df-a8e2-a9f0b1d6cdce%7C6cb0de4f-9bb5-4778-ab02-bfb62735f3e5)
|
||||
- qmake -r
|
||||
- make -j$(nproc)
|
||||
- make deploy # эта команда требует установленный [cqtdeployer](https://github.com/QuasarApp/CQtDeployer/releases)
|
||||
- ./Distro/CQtDeployerInstaller.run
|
||||
|
||||
## Build для Windows
|
||||
- установите qt и qt QtInstallFrameWork из [Установщик qt](https://www.qt.io/download-qt-installer?hsCtaTracking=9f6a2170-a938-42df-a8e2-a9f0b1d6cdce%7C6cb0de4f-9bb5-4778-ab02-bfb62735f3e5)
|
||||
- qmake -r
|
||||
- make -j$(nproc)
|
||||
- make deploy # эта команда требует установленный [cqtdeployer](https://github.com/QuasarApp/CQtDeployer/releases)
|
||||
- ./Distro/CQtDeployerInstaller.exe
|
||||
|
||||
|
||||
## Build для Linux
|
||||
- установите qt и qt QtInstallFrameWork из [Установщик qt](https://www.qt.io/download-qt-installer?hsCtaTracking=9f6a2170-a938-42df-a8e2-a9f0b1d6cdce%7C6cb0de4f-9bb5-4778-ab02-bfb62735f3e5)
|
||||
- git clone https://github.com/QuasarApp/CQtDeployer.git
|
||||
- cd CQtDeployer
|
||||
- git submodule update --init --recursive
|
||||
- qmake -r
|
||||
- Здесь нужно обязательно вызвать тот qmake, который был загружен из 1го пункта.
|
||||
- Пример: ~/Qt/5.14.0/gcc_64/bin/qmake -r
|
||||
- make -j$(nproc)
|
||||
- make deploy
|
||||
- эта команда требует установленный [cqtdeployer](https://github.com/QuasarApp/CQtDeployer/releases)
|
||||
- ./Distro/CQtDeployerInstaller.run
|
||||
|
||||
## Build для Windows (CMD)
|
||||
- установите qt и qt QtInstallFrameWork из [Установщик qt](https://www.qt.io/download-qt-installer?hsCtaTracking=9f6a2170-a938-42df-a8e2-a9f0b1d6cdce%7C6cb0de4f-9bb5-4778-ab02-bfb62735f3e5)
|
||||
- git clone https://github.com/QuasarApp/CQtDeployer.git
|
||||
- cd CQtDeployer
|
||||
- git submodule update --init --recursive
|
||||
- SET PATH=C:/Qt/Tools/mingw730_64/bin;%PATH%
|
||||
- Здесь важно настроить окружение qt.
|
||||
- qmake.exe -r
|
||||
- Здесь нужно обязательно вызвать тот qmake, который был загружен из 1го пункта.
|
||||
- Пример: C:/Qt/5.14.0/mingw73_64/bin/qmake.exe -r
|
||||
- migw32-make.exe -j$(nproc)
|
||||
- migw32-make.exe deploy
|
||||
- эта команда требует установленный [cqtdeployer](https://github.com/QuasarApp/CQtDeployer/releases)
|
||||
- ./Distro/CQtDeployerInstaller.exe
|
||||
|
||||
### Snap
|
||||
[](https://snapcraft.io/cqtdeployer)
|
||||
|
||||
|
@ -1249,12 +1249,6 @@ void deploytest::testIgnore() {
|
||||
#ifdef Q_OS_UNIX
|
||||
QString bin = TestBinDir + "QtWidgetsProject";
|
||||
QString qmake = TestQtDir + "bin/qmake";
|
||||
comapareTree += utils.createTree(
|
||||
{
|
||||
"./" + DISTRO_DIR + "/lib/libicudata.so",
|
||||
"./" + DISTRO_DIR + "/lib/libicui18n.so",
|
||||
"./" + DISTRO_DIR + "/lib/libicuuc.so"
|
||||
});
|
||||
|
||||
#else
|
||||
QString bin = TestBinDir + "QtWidgetsProject.exe";
|
||||
@ -1286,10 +1280,6 @@ void deploytest::testIgnore() {
|
||||
});
|
||||
|
||||
auto removeTree = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/lib/libQt5VirtualKeyboard.so",
|
||||
});
|
||||
|
||||
auto removeTreePlugins = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/plugins/virtualkeyboard/libqtvirtualkeyboard_hangul.so",
|
||||
"./" + DISTRO_DIR + "/plugins/virtualkeyboard/libqtvirtualkeyboard_openwnn.so",
|
||||
"./" + DISTRO_DIR + "/plugins/virtualkeyboard/libqtvirtualkeyboard_pinyin.so",
|
||||
@ -1309,18 +1299,14 @@ void deploytest::testIgnore() {
|
||||
|
||||
auto removeTree = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/Qt5VirtualKeyboard.dll",
|
||||
});
|
||||
"./" + DISTRO_DIR + "/plugins/platforminputcontexts/qtvirtualkeyboardplugin.dll",
|
||||
"./" + DISTRO_DIR + "/plugins/virtualkeyboard/qtvirtualkeyboard_hangul.dll",
|
||||
"./" + DISTRO_DIR + "/plugins/virtualkeyboard/qtvirtualkeyboard_openwnn.dll",
|
||||
"./" + DISTRO_DIR + "/plugins/virtualkeyboard/qtvirtualkeyboard_pinyin.dll",
|
||||
"./" + DISTRO_DIR + "/plugins/virtualkeyboard/qtvirtualkeyboard_tcime.dll",
|
||||
"./" + DISTRO_DIR + "/plugins/virtualkeyboard/qtvirtualkeyboard_thai.dll"
|
||||
});
|
||||
|
||||
auto removeTreePlugins = utils.createTree({
|
||||
"./" + DISTRO_DIR + "/plugins/virtualkeyboard/qtvirtualkeyboard_hangul.dll",
|
||||
"./" + DISTRO_DIR + "/plugins/virtualkeyboard/qtvirtualkeyboard_openwnn.dll",
|
||||
"./" + DISTRO_DIR + "/plugins/virtualkeyboard/qtvirtualkeyboard_pinyin.dll",
|
||||
"./" + DISTRO_DIR + "/plugins/virtualkeyboard/qtvirtualkeyboard_tcime.dll",
|
||||
"./" + DISTRO_DIR + "/plugins/virtualkeyboard/qtvirtualkeyboard_thai.dll",
|
||||
"./" + DISTRO_DIR + "/plugins/platforminputcontexts/qtvirtualkeyboardplugin.dll",
|
||||
"./" + DISTRO_DIR + "/Qt5VirtualKeyboard.dll",
|
||||
|
||||
});
|
||||
|
||||
#endif
|
||||
|
||||
@ -1329,19 +1315,12 @@ void deploytest::testIgnore() {
|
||||
"-ignoreEnv", TestQtDir + "/lib," + TestQtDir + "/bin" }, &comapareTree);
|
||||
|
||||
|
||||
|
||||
comapareTree = Modules::qtLibs() - removeTree;
|
||||
|
||||
runTestParams({"-bin", bin, "clear" ,
|
||||
"-qmake", qmake,
|
||||
"-ignore", "VirtualKeyboard"}, &comapareTree);
|
||||
|
||||
comapareTree = Modules::qtLibs() - removeTreePlugins;
|
||||
|
||||
runTestParams({"-bin", bin, "clear" ,
|
||||
"-qmake", qmake,
|
||||
"-ignore", "VirtualKeyboard,virtualkeyboard"}, &comapareTree);
|
||||
|
||||
}
|
||||
|
||||
void deploytest::testLibDir() {
|
||||
@ -1523,11 +1502,31 @@ void deploytest::testSystemLib() {
|
||||
QString bin = TestBinDir + "TestOnlyC.exe";
|
||||
auto comapareTree = utils.createTree(
|
||||
{
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.exe",
|
||||
"./" + DISTRO_DIR + "/libgcc_s_seh-1.dll",
|
||||
"./" + DISTRO_DIR + "/libstdc++-6.dll",
|
||||
"./" + DISTRO_DIR + "/libwinpthread-1.dll",
|
||||
"./" + DISTRO_DIR + "/qt.conf"
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.exe",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-console-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-datetime-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-debug-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-errorhandling-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-fibers-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-file-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-handle-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-heap-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-localization-l1-2-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-memory-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-namedpipe-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-processenvironment-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-processthreads-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-profile-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-string-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-synch-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-synch-l1-2-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-sysinfo-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-util-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/libgcc_s_seh-1.dll",
|
||||
"./" + DISTRO_DIR + "/libstdc++-6.dll",
|
||||
"./" + DISTRO_DIR + "/libwinpthread-1.dll",
|
||||
"./" + DISTRO_DIR + "/msvcrt.dll",
|
||||
"./" + DISTRO_DIR + "/qt.conf"
|
||||
});
|
||||
|
||||
#endif
|
||||
@ -1573,6 +1572,99 @@ void deploytest::testSystemLib() {
|
||||
|
||||
QVERIFY(runScript.contains("export LD_PRELOAD="));
|
||||
|
||||
#else
|
||||
QString qmake = TestQtDir + "bin/qmake.exe";
|
||||
bin = TestBinDir + "QtWidgetsProject.exe";
|
||||
|
||||
comapareTree += Modules::qtLibs();
|
||||
|
||||
comapareTree -= utils.createTree(
|
||||
{
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.exe",
|
||||
});
|
||||
|
||||
comapareTree += utils.createTree(
|
||||
{
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-console-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-datetime-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-debug-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-errorhandling-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-fibers-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-file-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-handle-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-heap-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-localization-l1-2-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-memory-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-namedpipe-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-processenvironment-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-processthreads-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-profile-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-string-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-synch-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-synch-l1-2-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-sysinfo-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-util-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/libgcc_s_seh-1.dll",
|
||||
"./" + DISTRO_DIR + "/libstdc++-6.dll",
|
||||
"./" + DISTRO_DIR + "/libwinpthread-1.dll",
|
||||
"./" + DISTRO_DIR + "/msvcrt.dll",
|
||||
"./" + DISTRO_DIR + "/qt.conf",
|
||||
"./" + DISTRO_DIR + "/API-MS-Win-Core-Heap-Obsolete-L1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/API-MS-Win-Core-Kernel32-Private-L1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/API-MS-Win-Core-Kernel32-Private-L1-1-1.dll",
|
||||
"./" + DISTRO_DIR + "/API-MS-Win-Eventing-ClassicProvider-L1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/API-MS-Win-Eventing-Provider-L1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/API-MS-Win-core-file-l2-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/API-MS-Win-core-localization-obsolete-l1-2-0.dll",
|
||||
"./" + DISTRO_DIR + "/API-MS-Win-core-string-l2-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/API-MS-Win-core-string-obsolete-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/API-MS-Win-devices-config-L1-1-1.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-delayload-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-file-l1-2-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-file-l1-2-1.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-interlocked-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-io-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-io-l1-1-1.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-kernel32-legacy-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-kernel32-legacy-l1-1-1.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-memory-l1-1-1.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-privateprofile-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-processthreads-l1-1-1.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-realtime-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-registry-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-rtlsupport-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-shlwapi-legacy-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-shlwapi-obsolete-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-stringansi-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-sysinfo-l1-2-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-threadpool-l1-2-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-threadpool-legacy-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-timezone-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-url-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-version-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-core-wow64-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-crt-math-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-crt-private-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-crt-runtime-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-crt-string-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-crt-time-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-security-base-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/api-ms-win-security-cryptoapi-l1-1-0.dll",
|
||||
"./" + DISTRO_DIR + "/dwmapi.dll",
|
||||
"./" + DISTRO_DIR + "/mpr.dll",
|
||||
"./" + DISTRO_DIR + "/profapi.dll",
|
||||
"./" + DISTRO_DIR + "/rpcrt4.dll",
|
||||
"./" + DISTRO_DIR + "/shell32.dll",
|
||||
"./" + DISTRO_DIR + "/userenv.dll",
|
||||
"./" + DISTRO_DIR + "/uxtheme.dll",
|
||||
"./" + DISTRO_DIR + "/version.dll",
|
||||
"./" + DISTRO_DIR + "/win32u.dll"
|
||||
});
|
||||
|
||||
runTestParams({"-bin", bin, "clear" ,
|
||||
"-qmake", qmake,
|
||||
"deploySystem"
|
||||
}, &comapareTree, true);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
BIN
res/screenshots/Example Run Win10.png
Normal file
BIN
res/screenshots/Example Run Win10.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 8.6 KiB |
BIN
res/screenshots/Help Win10.png
Normal file
BIN
res/screenshots/Help Win10.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 465 KiB |
Before ![]() (image error) Size: 343 KiB After ![]() (image error) Size: 343 KiB ![]() ![]() |
BIN
res/screenshots/Result Win10.png
Normal file
BIN
res/screenshots/Result Win10.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 420 KiB |
Loading…
x
Reference in New Issue
Block a user