4
1
mirror of https://github.com/QuasarApp/CQtDeployer.git synced 2025-05-06 14:39:35 +00:00

Merge pull request from QuasarApp/v1.5.4

CQtDeployer 1.5.4
This commit is contained in:
Andrei Yankovich 2021-09-04 18:08:39 +03:00 committed by GitHub
commit 2b8c4bbe0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 356 additions and 104 deletions

@ -60,8 +60,7 @@ bool Deb::deployTemplate(PackageControl &pkg) {
QuasarAppUtils::Params::log("Failed to set permissions", QuasarAppUtils::Warning);
}
outFiles.push_back(DeployCore::_config->getTargetDir() + "/" + info.Name + ".deb");
packageFolders.push_back(local);
inouts.push_back({local, cfg->getTargetDir() + "/" + info.debOut});
}
return true;
@ -117,30 +116,19 @@ QProcessEnvironment Deb::processEnvirement() const {
QList<SystemCommandData> Deb::runCmd() {
QList<SystemCommandData> res;
for (const auto& dir: qAsConst(packageFolders)) {
res.push_back({"dpkg-deb", QStringList{"--build", "--verbose"} << dir});
for (const auto& inout: qAsConst(inouts)) {
res.push_back({"dpkg-deb", QStringList{"--build", "--verbose"} << inout.input << inout.output});
}
return res;
}
QStringList Deb::outPutFiles() const {
return outFiles;
}
bool Deb::cb() const {
const DeployConfig* cfg = DeployCore::_config;
QString from = cfg->getTargetDir() + "/" + getLocation() + "/";
QString to = cfg->getTargetDir() + "/" + getLocation() + "/../";
auto const outputFiles = outPutFiles();
for (const QString& file : outputFiles) {
if(!moveData(from + PathUtils::getName(file), to, "")) {
return false;
}
QStringList result;
for (const auto& inout: qAsConst(inouts)) {
result.push_back(inout.output);
}
return true;
return result;
}
QString Deb::dataLocation(const DistroModule &module) const {

@ -3,6 +3,14 @@
#include "idistribution.h"
/**
* @brief The DebInOut struct contains input and output value of the debian packages.
*/
struct DebInOut {
QString input;
QString output;
};
/**
* @brief The deb class contains methods for create a debian pacakge.
*/
@ -21,7 +29,6 @@ public:
QProcessEnvironment processEnvirement() const override;
QList<SystemCommandData> runCmd() override;
QStringList outPutFiles() const override;
bool cb() const override;
// iDistribution interface
protected:
@ -30,8 +37,7 @@ protected:
QString releativeLocation(const DistroModule &module) const override;
private:
QStringList outFiles;
QStringList packageFolders;
QList<DebInOut> inouts;
};
#endif // DEB_H

@ -198,6 +198,14 @@ bool iDistribution::collectInfo(const DistroModule& pkg,
if (!pkg.installDirDEB().isEmpty())
info.InstallDirDEB = pkg.installDirDEB();
info.debOut = info.Name + ".deb";
if (!pkg.debOut().isEmpty())
info.debOut = pkg.debOut();
info.zipOut = info.Name + ".zip";
if (!pkg.zipOut().isEmpty())
info.zipOut = pkg.zipOut();
info.Prefix = releativeLocation(pkg);
QString cmdArray = "[";
@ -221,7 +229,7 @@ bool iDistribution::collectInfo(const DistroModule& pkg,
bashShortCutsArray += "\"" + targetInfo.getRunScriptFile() + "\"";
}
if (fileinfo.suffix().compare("exe", ONLY_WIN_CASE_INSENSIATIVE) == 0 || fileinfo.suffix().isEmpty()) {
if (fileinfo.suffix().compare("exe", Qt::CaseInsensitive) == 0 || fileinfo.suffix().isEmpty()) {
if (cmdArray.size() > initSize) {
cmdArray += ",";
bashArray += " ";

@ -72,13 +72,20 @@ QList<SystemCommandData> QIF::runCmd() {
cmd.arguments = QStringList{
"-c",
location + "/config/config.xml",
QuasarAppUtils::Params::getArg("qifConfig", location + "/config/config.xml"),
"-p",
location + "/packages/",
"-v",
installerFile()
QuasarAppUtils::Params::getArg("qifPackages", location + "/packages/"),
"-v"
};
QString resources = QuasarAppUtils::Params::getArg("qifResources");
if (resources.size()) {
cmd.arguments.push_back("-r");
cmd.arguments.push_back(resources);
}
cmd.arguments.push_back(installerFile());
return {cmd};
}

@ -19,6 +19,9 @@ struct DEPLOYSHARED_EXPORT TemplateInfo
QString Homepage;
QString Prefix;
QString InstallDirDEB;
QString zipOut;
QString debOut;
QString InstallDeirQIFW() const;
QHash<QString, QString> Custom;

@ -38,7 +38,7 @@ bool ZipArhive::deployTemplate(PackageControl &pkg) {
return false;
}
auto arr = cfg->getTargetDir() + "/" + info.Name + ".zip";
auto arr = cfg->getTargetDir() + "/" + info.zipOut;
if (!zipWorker.compress(local, arr)) {
return false;
}

@ -465,6 +465,12 @@ bool ConfigParser::initDistroStruct() {
auto installDirDeb = QuasarAppUtils::Params::getArg("installDirDeb").
split(DeployCore::getSeparator(0), splitbehavior);
auto debOut = QuasarAppUtils::Params::getArg("debOut").
split(DeployCore::getSeparator(0), splitbehavior);
auto zipOut = QuasarAppUtils::Params::getArg("zipOut").
split(DeployCore::getSeparator(0), splitbehavior);
// init distro stucts for all targets
if (binOut.size() && !parsePackagesPrivate(mainDistro, binOut, &DistroModule::setBinOutDir)) {
packagesErrorLog("binOut");
@ -551,6 +557,16 @@ bool ConfigParser::initDistroStruct() {
return false;
}
if (debOut.size() && !parsePackagesPrivate(mainDistro, debOut, &DistroModule::setDebOut)) {
packagesErrorLog("debOut");
return false;
}
if (zipOut.size() && !parsePackagesPrivate(mainDistro, zipOut, &DistroModule::setZipOut)) {
packagesErrorLog("zipOut");
return false;
}
return true;
}

@ -149,7 +149,7 @@ void DependenciesScanner::recursiveDep(LibInfo &lib, QSet<LibInfo> &res, QSet<QS
if (!scanedLib.isValid()) {
QSet<LibInfo> listDep = {};
if (!lib._name.compare(dep.value()._name, ONLY_WIN_CASE_INSENSIATIVE))
if (!lib._name.compare(dep.value()._name, DeployCore::getCaseSensitivity(lib._name)))
continue;
recursiveDep(*dep, listDep, libStack);

@ -14,12 +14,6 @@
#define DISTRO_DIR QString("DistributionKit")
#ifdef Q_OS_WIN
#define ONLY_WIN_CASE_INSENSIATIVE Qt::CaseInsensitive
#else
#define ONLY_WIN_CASE_INSENSIATIVE Qt::CaseSensitive
#endif
#if defined(DEPLOY_LIBRARY)
# define DEPLOYSHARED_EXPORT Q_DECL_EXPORT
#else

@ -105,12 +105,12 @@ DeployCore::QtModule DeployCore::getQtModule(const QString& path) {
void DeployCore::addQtModule(DeployCore::QtModule &module, const QString &path) {
QuasarAppUtils::Params::log("Current module " + QString::number(module),
QuasarAppUtils::Debug);
QuasarAppUtils::Debug);
auto mod = getQtModule(path);
QuasarAppUtils::Params::log("Add new module from path " + path +
" module value " + QString::number(mod),
QuasarAppUtils::Debug);
" module value " + QString::number(mod),
QuasarAppUtils::Debug);
module = static_cast<DeployCore::QtModule>(
@ -251,15 +251,15 @@ QuasarAppUtils::OptionsDataList DeployCore::avilableOptions() {
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"deb", "-deb"}, "",
"Create the deb package for deployment programm"
" You can specify the path to your own debian template.",
"cqtdeployer -deb path/to/myCustom/DEBIAN."
"Create the deb package for deployment programm"
" You can specify the path to your own debian template.",
"cqtdeployer -deb path/to/myCustom/DEBIAN."
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"deploySystem"}, "",
"Deploys all libraries."
" Not recomendet because there may be conflicts with system libraries"
" (on snap version you need to turn on permission)"
"Deploys all libraries."
" Not recomendet because there may be conflicts with system libraries"
" (on snap version you need to turn on permission)"
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"noQt"}, "",
@ -271,10 +271,10 @@ QuasarAppUtils::OptionsDataList DeployCore::avilableOptions() {
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"getDefaultTemplate"}, "",
"Extracts defaults deb or qif templates."
" All templates extract into targetDirectory."
" For change target directory use the targetDir option.",
"cqtdeployer -bin myExecutable getDefaultTemplate qif deb."
"Extracts defaults deb or qif templates."
" All templates extract into targetDirectory."
" For change target directory use the targetDir option.",
"cqtdeployer -bin myExecutable getDefaultTemplate qif deb."
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"noHashSum"}, "",
@ -302,10 +302,10 @@ QuasarAppUtils::OptionsDataList DeployCore::avilableOptions() {
help.insert(group, {QuasarAppUtils::OptionData{
{"-confFile"}, "{params}",
"The path to the json file with all deployment configurations. Using this file,"
" you can add the necessary options, thereby simplifying the command invocation in the console."
" However, the parameters in Kansol have a higher priority than in the file."
" For more info about this flag see https://github.com/QuasarApp/CQtDeployer/wiki/DeployConfigFileEn"
"The path to the json file with all deployment configurations. Using this file,"
" you can add the necessary options, thereby simplifying the command invocation in the console."
" However, the parameters in Kansol have a higher priority than in the file."
" For more info about this flag see https://github.com/QuasarApp/CQtDeployer/wiki/DeployConfigFileEn"
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"-qmlDir"}, "{params}",
@ -336,8 +336,8 @@ QuasarAppUtils::OptionsDataList DeployCore::avilableOptions() {
{"-extraLibs"}, "{list,params}",
"Sets the mask of the library name for forced copying.",
"\"-extraLib mySql\" - forces to copy all libraries whose names contain mySql to the project folder."
" This option is case-insensitive on Windows and case-sensitive on other platforms."
" This option will only search libraries in system environments similar to **deploySystem**."
" This option is case-insensitive on Windows and case-sensitive on other platforms."
" This option will only search libraries in system environments similar to **deploySystem**."
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"-customScript"}, "{scriptCode}",
@ -350,23 +350,15 @@ QuasarAppUtils::OptionsDataList DeployCore::avilableOptions() {
{"-recursiveDepth"}, "{params}",
"Sets the Depth of recursive search of libs and depth for ignoreEnv option (default 0)"
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"-targetDir"}, "{params}",
"Sets target directory(by default it is the path to the first deployable file)"
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"-installDirDeb"}, "{params}",
"Sets install target directory fordebian package (by default it is /opt path)"
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"-installDirQIFW"}, "{params}",
"Sets install target directory for installers (by default it is /home path)"
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"-runScript"}, "{list,parems}",
"forces cqtdeployer swap default run script to new from the arguments of option."
" This option copy all content from input file and insert all code into runScript.sh or .bat",
"cqtdeployer -runScript \"myTargetMame;path/to/my/myCustomLaunchScript.sh,myTargetSecondMame;path/to/my/mySecondCustomLaunchScript.sh\""
"forces cqtdeployer swap default run script to new from the arguments of option."
" This option copy all content from input file and insert all code into runScript.sh or .bat",
"cqtdeployer -runScript \"myTargetMame;path/to/my/myCustomLaunchScript.sh,myTargetSecondMame;path/to/my/mySecondCustomLaunchScript.sh\""
}});
group = "Part 3 Control of packages options";
@ -374,7 +366,7 @@ QuasarAppUtils::OptionsDataList DeployCore::avilableOptions() {
help.insert(group, {QuasarAppUtils::OptionData{
{"-targetPackage"}, "{package;tar1,package;tar2}",
"Creates a new package and adds 'tar1 and tar2' to it. "
"If you want configure the package that do not have any targets use the allowEmptyPackages option."
"If you want configure the package that do not have any targets use the allowEmptyPackages option."
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"-qmlOut"}, "{package;path,path}",
@ -408,7 +400,7 @@ QuasarAppUtils::OptionsDataList DeployCore::avilableOptions() {
help.insert(group, {QuasarAppUtils::OptionData{
{"-name"}, "{package;val,val}",
"Sets name for a package."
"If this if you do not specify a package, the value will be assigned to the default package ("")"
"If this if you do not specify a package, the value will be assigned to the default package ("")"
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"-description"}, "{package;val,val}",
@ -443,7 +435,7 @@ QuasarAppUtils::OptionsDataList DeployCore::avilableOptions() {
"Adds qm files into the translations folder."
}});
group = "Part 4 Control of packages options";
group = "Part 4 Control of target options";
help.insert(group, {QuasarAppUtils::OptionData{
{"-icon"}, "{target;val,val}",
@ -466,16 +458,16 @@ QuasarAppUtils::OptionsDataList DeployCore::avilableOptions() {
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"-enablePlugins"}, "{package;val1;val2,SingeleVa}",
"Enables additional plugins for distribution."
" By default disabled next plugins: " + PluginsParser::defaultForbidenPlugins().join(',') + " if you want enable"
" it then use '-enablePlugins " + PluginsParser::defaultForbidenPlugins().join(',') + "' option"
"Enables additional plugins for distribution."
" By default disabled next plugins: " + PluginsParser::defaultForbidenPlugins().join(',') + " if you want enable"
" it then use '-enablePlugins " + PluginsParser::defaultForbidenPlugins().join(',') + "' option"
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"-disablePlugins"}, "{package;val1;val2,SingeleVal}",
"Disables plugins for distribution. "
"You can disable any plugin of your Qt build, just see the yourQtFolder/plugins forlder for available plugins."
" Example if you want disable qxcb plugin: -disablePlugins qxcb."
" Note that the name of the plugin is indicated without its extension"
"Disables plugins for distribution. "
"You can disable any plugin of your Qt build, just see the yourQtFolder/plugins forlder for available plugins."
" Example if you want disable qxcb plugin: -disablePlugins qxcb."
" Note that the name of the plugin is indicated without its extension"
}});
group = "Part 6 QtInstallFramework options";
@ -497,6 +489,43 @@ QuasarAppUtils::OptionsDataList DeployCore::avilableOptions() {
{"-qifOut"}, "{nameOfOutputInstallerFile}",
"Sets name of output qifw installer. Note: on Windows, the exe suffix will be added to the installer automatically."
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"-qifConfig"}, "{path/to/config.xml}",
"Sets a custom path to the configure file of the qt ifw installer. By default it is qif/config/config.xml"
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"-qifPackages"}, "{path/to/packagesFodoler}",
"Sets a custom path to the packages directories. By default it is qif/packages"
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"-qifResources"}, "{path/to/resources1.qrc,path/to/resources2.qrc}",
"Sets a custom path to the resources files. By default this option is skipped"
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"-targetDir"}, "{params}",
"Sets target directory(by default it is the path to the first deployable file)"
}});
group = "Part 7 Deb package options";
help.insert(group, {QuasarAppUtils::OptionData{
{"-debOut"}, "{package;nameOfOutputDebFile,nameOfOutputDebFile}",
"Sets name of the output debian file. This option can be work with multiple packages"
}});
help.insert(group, {QuasarAppUtils::OptionData{
{"-installDirDeb"}, "{params}",
"Sets install target directory fordebian package (by default it is /opt path)"
}});
group = "Part 8 zip package options";
help.insert(group, {QuasarAppUtils::OptionData{
{"-zipOut"}, "{package;nameOfOutputZipFile,nameOfOutputZipFile}",
"Sets name of the output zip arrhive. This option can be work with multiple packages"
}});
return help;
}
@ -589,7 +618,7 @@ QString DeployCore::findProcess(const QString &env, const QString& proc) {
auto files = QDir(path).entryInfoList(QDir::NoDotAndDotDot | QDir::Files);
for (const auto& bin : files) {
if (bin.baseName().compare(proc, ONLY_WIN_CASE_INSENSIATIVE) == 0) {
if (bin.baseName().compare(proc, DeployCore::getCaseSensitivity()) == 0) {
return bin.absoluteFilePath();
}
}
@ -605,7 +634,7 @@ QStringList DeployCore::debugExtensions() {
bool DeployCore::isDebugFile(const QString &file) {
auto debug = debugExtensions();
for (const auto& debugEx: debug) {
if (file.contains(debugEx, ONLY_WIN_CASE_INSENSIATIVE)) {
if (file.contains(debugEx, Qt::CaseInsensitive)) {
return true;
}
}
@ -752,11 +781,11 @@ QtMajorVersion DeployCore::isQtLibName(const QString &lib) {
}
QString fileName = info.fileName();
if (fileName.contains("Qt4", ONLY_WIN_CASE_INSENSIATIVE)) {
if (fileName.contains("Qt4", getCaseSensitivity(fileName))) {
isQt = QtMajorVersion::Qt4;
} else if (fileName.contains("Qt5", ONLY_WIN_CASE_INSENSIATIVE)) {
} else if (fileName.contains("Qt5", getCaseSensitivity(fileName))) {
isQt = QtMajorVersion::Qt5;
} else if (fileName.contains("Qt6", ONLY_WIN_CASE_INSENSIATIVE)) {
} else if (fileName.contains("Qt6", getCaseSensitivity(fileName))) {
isQt = QtMajorVersion::Qt6;
}
@ -774,8 +803,8 @@ bool DeployCore::isExtraLib(const QString &lib) {
}
bool DeployCore::isAlienLib(const QString &lib) {
return lib.contains("/opt/", ONLY_WIN_CASE_INSENSIATIVE) ||
lib.contains("/PROGRAM FILES", ONLY_WIN_CASE_INSENSIATIVE);
return lib.contains("/opt/", Qt::CaseSensitive) ||
lib.contains("/PROGRAM FILES", Qt::CaseInsensitive);
}
bool DeployCore::isAllowedLib(const QString &lib) {
@ -920,6 +949,25 @@ QFileInfo DeployCore::findItem(const QString &bin) {
}
return QFileInfo(bin);
}
Qt::CaseSensitivity DeployCore::getCaseSensitivity(const QString &checkedFile) {
if (checkedFile.isEmpty()) {
#ifdef Q_OS_WIN
return Qt::CaseInsensitive;
#else
return Qt::CaseSensitive;
#endif
}
QString sufix = QFileInfo(checkedFile).completeSuffix();
if (sufix.compare("dll", Qt::CaseInsensitive) == 0 ||
sufix.compare("exe", Qt::CaseInsensitive)) {
return Qt::CaseInsensitive;
}
return Qt::CaseSensitive;
};
QString DeployCore::systemLibsFolderName() {

@ -303,6 +303,12 @@ public:
*/
static QFileInfo findItem(const QString &file);
/**
* @brief getCaseSensitivity This method return case sensitivity for a @a checkedFile. Usually return Qt::CaseSensiativy exept windows binaryes files like a dll and exe.
* @param checkedFile This is checked file. By default empty value.
* @return Qt CaseSensitivity value
*/
static Qt::CaseSensitivity getCaseSensitivity(const QString& checkedFile = "");
};
#define internalError() DeployCore::printInternalError(__FUNCTION__, __FILE__, __LINE__)

@ -148,6 +148,22 @@ void DistroModule::setKey(const QString &key) {
_key = key;
}
const QString &DistroModule::zipOut() const {
return _zipOut;
}
void DistroModule::setZipOut(const QString &newZipOut) {
_zipOut = newZipOut;
}
const QString &DistroModule::debOut() const {
return _debOut;
}
void DistroModule::setDebOut(const QString &newDebOut) {
_debOut = newDebOut;
}
QString DistroModule::installDirDEB() const {
if (_installDirDEB.isEmpty())
return "/opt";

@ -77,6 +77,30 @@ public:
QString installDirDEB() const;
void setInstallDirDEB(const QString &newInstallDir);
/**
* @brief debOut This method return output filePath to debian pacakge
* @return output filePath to debian pacakge
*/
const QString &debOut() const;
/**
* @brief setDebOut This method sets new value of debian outpup path.
* @param newDebOut This is new value of the debian output
*/
void setDebOut(const QString &newDebOut);
/**
* @brief debOut This method return output filePath to zip pacakge
* @return output filePath to zip pacakge
*/
const QString &zipOut() const;
/**
* @brief setDebOut This method sets new value of zip outpup path.
* @param newDebOut This is new value of the zip output
*/
void setZipOut(const QString &newZipOut);
protected:
void setKey(const QString &key);
@ -105,7 +129,8 @@ private:
QSet<QString> _tr;
QString _installDirDEB;
QString _debOut;
QString _zipOut;
};

@ -390,7 +390,7 @@ void Extracter::extractLib(const QString &file,
for (const auto &line : data.getAllDep()) {
if (mask.size() && !line.getName().contains(mask, ONLY_WIN_CASE_INSENSIATIVE)) {
if (mask.size() && !line.getName().contains(mask, DeployCore::getCaseSensitivity())) {
continue;
}

@ -178,7 +178,7 @@ bool FileManager::fileActionPrivate(const QString &file, const QString &target,
bool copy = !masks;
if (masks) {
for (const auto &mask : qAsConst(*masks)) {
if (info.absoluteFilePath().contains(mask, ONLY_WIN_CASE_INSENSIATIVE)) {
if (info.absoluteFilePath().contains(mask, DeployCore::getCaseSensitivity())) {
copy = true;
break;
}
@ -263,7 +263,7 @@ bool FileManager::smartCopyFile(const QString &file,
bool ifFileTarget) {
auto config = DeployCore::_config;
if (file.contains(config->getTargetDir(), ONLY_WIN_CASE_INSENSIATIVE)) {
if (file.contains(config->getTargetDir(), DeployCore::getCaseSensitivity())) {
if (!moveFile(file, target, mask)) {
QuasarAppUtils::Params::log("Failed to move the file. Trying to copy it");
@ -309,7 +309,7 @@ bool FileManager::copyFolder(const QString &from,
if (!force) {
QString skipFilter = "";
for (const auto &i: filter) {
if (item.fileName().contains(i, ONLY_WIN_CASE_INSENSIATIVE)) {
if (item.fileName().contains(i, DeployCore::getCaseSensitivity())) {
skipFilter = i;
break;
}
@ -496,7 +496,7 @@ bool FileManager::copyFiles(const QStringList &source,
QString skipFilter = "";
for (const auto &i: filter) {
if (info.fileName().contains(i, ONLY_WIN_CASE_INSENSIATIVE)) {
if (info.fileName().contains(i, DeployCore::getCaseSensitivity())) {
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, ONLY_WIN_CASE_INSENSIATIVE)) {
if (info.fullPath().contains(ignoreLabel, DeployCore::getCaseSensitivity())) {
QuasarAppUtils::Params::log(info.fullPath() + " ignored by filter" + ignoreLabel);
return true;
}

@ -86,11 +86,11 @@ bool QtDir::isQt(QString path) const {
path = PathUtils::fixPath(path);
return
(!libs.isEmpty() && path.contains(libs, ONLY_WIN_CASE_INSENSIATIVE)) ||
(!bins.isEmpty() && path.contains(bins, ONLY_WIN_CASE_INSENSIATIVE)) ||
(!libexecs.isEmpty() && path.contains(libexecs, ONLY_WIN_CASE_INSENSIATIVE)) ||
(!plugins.isEmpty() && path.contains(plugins, ONLY_WIN_CASE_INSENSIATIVE)) ||
(!qmls.isEmpty() && path.contains(qmls, ONLY_WIN_CASE_INSENSIATIVE)) ||
(!translations.isEmpty() && path.contains(translations, ONLY_WIN_CASE_INSENSIATIVE)) ||
(!resources.isEmpty() && path.contains(resources, ONLY_WIN_CASE_INSENSIATIVE));
(!libs.isEmpty() && path.contains(libs, DeployCore::getCaseSensitivity())) ||
(!bins.isEmpty() && path.contains(bins, DeployCore::getCaseSensitivity())) ||
(!libexecs.isEmpty() && path.contains(libexecs, DeployCore::getCaseSensitivity())) ||
(!plugins.isEmpty() && path.contains(plugins, DeployCore::getCaseSensitivity())) ||
(!qmls.isEmpty() && path.contains(qmls, DeployCore::getCaseSensitivity())) ||
(!translations.isEmpty() && path.contains(translations, DeployCore::getCaseSensitivity())) ||
(!resources.isEmpty() && path.contains(resources, DeployCore::getCaseSensitivity()));
}

@ -1,10 +1,10 @@
include($$PWD/InstallerBase.pri);
mkpath( $$PWD/../Distro)
win32:OUT_FILE = CQtDeployerInstaller.exe
unix:OUT_FILE = CQtDeployerInstaller.run
win32:OUT_FILE = CQtDeployer_$$VERSION_Installer_Win64.exe
unix:OUT_FILE = CQtDeployer_$$VERSION_Installer_Linux64.run
win32:OUT_FILE_OFF = CQtDeployerOfflineInstaller.exe
unix:OUT_FILE_OFF = CQtDeployerOfflineInstaller.run
win32:OUT_FILE_OFF = CQtDeployer_$$VERSION_OfflineInstaller_Win64.exe
unix:OUT_FILE_OFF = CQtDeployer_$$VERSION_OfflineInstaller_Linux64.run
DEPLOY_TARGET = $$PWD/../CQtDeployer/build/release

@ -20,7 +20,7 @@ ModulesQt513::~ModulesQt513() {
QSet<QString> ModulesQt513::ignoreFilter(const QSet<QString> &input, const QString &filter) const {
QSet<QString> res;
for (auto& val : input) {
if (!val.contains(filter, ONLY_WIN_CASE_INSENSIATIVE)) {
if (!val.contains(filter, DeployCore::getCaseSensitivity())) {
res.insert(val);
}
}

@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/">
<file>customconfig.xml</file>
</qresource>
</RCC>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>Stylesheet Example</Name>
<Version>1.0.0</Version>
<Title>Stylesheet Example</Title>
<Publisher>Qt-Project</Publisher>
<StartMenuDir>Qt IFW Examples</StartMenuDir>
<TargetDir>@HomeDir@/IfwExamples/stylesheet</TargetDir>
<WizardStyle>Classic</WizardStyle>
<TitleColor>#FFFFFF</TitleColor>
</Installer>

@ -0,0 +1,39 @@
/**************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
**
** $QT_END_LICENSE$
**
**************************************************************************/
function Component()
{
// constructor
installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
}

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<Package>
<DisplayName>Dummy</DisplayName>
<ReleaseDate>2015-09-09</ReleaseDate>
<Version>1.0.1</Version>
<Default>true</Default>
<Script>installscript.qs</Script>
</Package>

@ -190,6 +190,8 @@ private slots:
// note: this test checking in manual mode only.
void testInstallDirsOptions();
void testQIFResources();
void customTest();
};
@ -1529,12 +1531,25 @@ void deploytest::testQifOut() {
QString bin = TestBinDir + "TestOnlyC.exe";
#endif
auto result = utils.createTree({{DISTRO_DIR + "/QIF_OUT.exe"},
{DISTRO_DIR + "/QIF_OUT.exe.md5"}});
#ifdef Q_OS_UNIX
auto result = utils.createTree({{DISTRO_DIR + "/QIF_OUT.exe"}, {DISTRO_DIR + "/QIF_OUT.exe.md5"},
{DISTRO_DIR + "/DEB_OUT.deb"}, {DISTRO_DIR + "/DEB_OUT.deb.md5"},
{DISTRO_DIR + "/ZIP_OUT.zip"}, {DISTRO_DIR + "/ZIP_OUT.zip.md5"}});
// Run deploy installer
runTestParams({"-bin", bin, "clear",
"qif", "-qifOut", "QIF_OUT.exe"}, &result);
"qif", "-qifOut", "QIF_OUT.exe",
"deb", "-debOut", "DEB_OUT.deb",
"zip", "-zipOut", "ZIP_OUT.zip"}, &result);
#else
auto result = utils.createTree({{DISTRO_DIR + "/QIF_OUT.exe"}, {DISTRO_DIR + "/QIF_OUT.exe.md5"},
{DISTRO_DIR + "/ZIP_OUT.zip"}, {DISTRO_DIR + "/ZIP_OUT.zip.md5"}});
// Run deploy installer
runTestParams({"-bin", bin, "clear",
"qif", "-qifOut", "QIF_OUT.exe",
"zip", "-zipOut", "ZIP_OUT.zip"}, &result);
#endif
}
void deploytest::testIgnoreEnvWithLibDir() {
@ -1575,6 +1590,35 @@ void deploytest::testInstallDirsOptions() {
#endif
}
void deploytest::testQIFResources() {
TestUtils utils;
#ifdef Q_OS_UNIX
QString bin = {TestBinDir + "TestOnlyC"};
auto result = utils.createTree({{DISTRO_DIR + "/InstallerTestOnlyC.run"},
{DISTRO_DIR + "/InstallerTestOnlyC.run.md5"}});
#else
QString bin = {TestBinDir + "TestOnlyC.exe"};
auto result = utils.createTree({{DISTRO_DIR + "/InstallerTestOnlyC.exe"},
{DISTRO_DIR + "/InstallerTestOnlyC.exe.md5"}});
#endif
auto templateDir = TestBinDir + "/../../UnitTests/testRes/QIFCustomTemplate";
runTestParams({
"-bin", bin,
"clear",
"qif",
"-qifConfig", templateDir + "/customconfig.xml",
"-qifPackages", templateDir + "/custompackages",
"-qifResources", templateDir + "customRes.qrc"
}, &result
);
}
void deploytest::customTest() {
//runTestParams({"-confFile", "",
// "qifFromSystem"});

@ -152,6 +152,20 @@ cqtdeployer -option1 value1 -option2 list, of, values flag1 flag2 flag3
| -qifBanner [path/to/banner.png]| Sets path to the banner png file. |
| -qifLogo [path/to/logo.png]| Sets path to the logo png file. |
| -qifOut [nameOfOutputInstallerFile] | Sets name of output qifw installer. Note: on Windows, the exe suffix will be added to the installer automatically. |
| -qifConfig [path/to/config.xml] | Sets a custom path to the configure file of the qt ifw installer. By default it is qif/config/config.xml |
| -qifPackages [path/to/packagesFodoler] | Sets a custom path to the packages directories. By default it is qif/packages |
| -qifResources [path/to/resources1.qrc,path/to/resources2.qrc] | Sets a custom path to the resources files. By default this option is skipped |
### Deb package options
| Option | Descriptiion |
|-----------------------------|-----------------------------------------------------------|
| -debOut [package;nameOfOutputDebFile,nameOfOutputDebFile]| Sets name of the output debian file. This option can be work with multiple packages |
### Zip pacakge options
| Option | Descriptiion |
|-----------------------------|-----------------------------------------------------------|
| -debOut [package;nameOfOutputZipFile,nameOfOutputZipFile]| Sets name of the output zip arrhive. This option can be work with multiple packages |
#### Example: cqtdeployer -bin myApp -qmlDir ~/MyAppProject/qml -qmake ~/Qt/5.15.4/gcc_64/bin/qmake clear

@ -148,7 +148,21 @@ cqtdeployer -option1 value1 -option2 list,of,values flag1 flag2 flag3
| -qifBanner [path/to/banner.png]| Устанавливает путь к png-файлу баннера. |
| -qifLogo [path/to/logo.png]| Устанавливает путь к файлу логотипа png. |
| -qifOut [nameOfOutputInstallerFile] | Устанавливает имя выходного установщика qifw. Примечание: для установщика Windows автоматически добавляется суффикс exe. |
| -qifConfig [path/to/config.xml] | Устанавливает пользовательский путь к файлу конфигурации установщика qt ifw. По умолчанию это qif/config/config.xml |
| -qifPackages [path/to/packagesFodoler] | Устанавливает пользовательский путь к каталогам пакетов. По умолчанию это qif/packages |
| -qifResources [path/to/resources1.qrc,path/to/resources2.qrc] | Устанавливает пользовательский путь к файлам ресурсов. По умолчанию эта опция пропущена |
### Deb package options:
| Option | Descriptiion |
|-----------------------------|-----------------------------------------------------------|
| -debOut [package;nameOfOutputDebFile,nameOfOutputDebFile]| Устанавливает имя выходного файла debian. Эта опция может работать с несколькими пакетами |
### Zip pacakge options:
| Option | Descriptiion |
|-----------------------------|-----------------------------------------------------------|
| -debOut [package;nameOfOutputZipFile,nameOfOutputZipFile]| Устанавливает имя выходного zip архива. Эта опция может работать с несколькими пакетами |
#### Пример: cqtdeployer -bin myApp -qmlDir ~/MyAppProject/qml -qmake ~/Qt/5.15.0/gcc_64/bin/qmake clear