mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-27 18:24:33 +00:00
Merge branch 'v1.5.3' into task_421
This commit is contained in:
commit
4618921376
@ -3,7 +3,7 @@
|
||||
APPS=$BASH_ARRAY_APPLICATIONS
|
||||
APPS_SHORTCUTS=$BASH_ARRAY_SHORTCUTS_APPLICATIONS
|
||||
|
||||
TARGET_DIR=/opt/$PREFIX/
|
||||
TARGET_DIR=$CQT_INSTALL_DEB_DIR/$PREFIX/
|
||||
|
||||
#creating shortcut
|
||||
DEST_FILE=
|
||||
@ -21,7 +21,7 @@ function createShortCut {
|
||||
echo "Encoding=UTF-8" >> $DEST_FILE
|
||||
echo "Name=$DEST_NAME" >> $DEST_FILE
|
||||
echo "Type=Application" >> $DEST_FILE
|
||||
echo "Icon=/opt/$ICON" >> $DEST_FILE
|
||||
echo "Icon=$CQT_INSTALL_DEB_DIR/$ICON" >> $DEST_FILE
|
||||
echo "Terminal=false" >> $DEST_FILE
|
||||
echo "Exec=$SRC_FILE" >> $DEST_FILE
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<Title>$NAME</Title>
|
||||
<Publisher>$PUBLISHER</Publisher>
|
||||
<StartMenuDir>$NAME</StartMenuDir>
|
||||
<TargetDir>@HomeDir@/$NAME</TargetDir>
|
||||
<TargetDir>$CQT_INSTALL_DIR/$NAME</TargetDir>
|
||||
<InstallActionColumnVisible>true</InstallActionColumnVisible>
|
||||
<RemoveTargetDir>true</RemoveTargetDir>
|
||||
<ControlScript>controlScript.qs</ControlScript>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<Title>$NAME</Title>
|
||||
<Publisher>$PUBLISHER</Publisher>
|
||||
<StartMenuDir>$NAME</StartMenuDir>
|
||||
<TargetDir>@HomeDir@/$NAME</TargetDir>
|
||||
<TargetDir>$CQT_INSTALL_DIR/$NAME</TargetDir>
|
||||
<InstallActionColumnVisible>true</InstallActionColumnVisible>
|
||||
<RemoveTargetDir>true</RemoveTargetDir>
|
||||
<ControlScript>controlScript.qs</ControlScript>
|
||||
|
@ -144,8 +144,7 @@ bool Deb::cb() const {
|
||||
}
|
||||
|
||||
QString Deb::dataLocation(const DistroModule &module) const {
|
||||
return location(module) + "/opt/" + releativeLocation(module);
|
||||
|
||||
return location(module) + module.installDirDEB() + "/" + releativeLocation(module);
|
||||
}
|
||||
|
||||
QString Deb::location(const DistroModule &module) const {
|
||||
|
@ -74,6 +74,8 @@ bool iDistribution::unpackFile(const QFileInfo &resource,
|
||||
inputText.replace("$PUBLISHER", info.Publisher);
|
||||
inputText.replace("$HOMEPAGE", info.Homepage);
|
||||
inputText.replace("$PREFIX", info.Prefix);
|
||||
inputText.replace("$CQT_INSTALL_DIR", info.InstallDeirQIFW());
|
||||
inputText.replace("$CQT_INSTALL_DEB_DIR", info.InstallDirDEB);
|
||||
|
||||
|
||||
for (auto it = info.Custom.cbegin(); it != info.Custom.cend(); ++it) {
|
||||
@ -192,6 +194,10 @@ bool iDistribution::collectInfo(const DistroModule& pkg,
|
||||
if (!pkg.homePage().isEmpty())
|
||||
info.Homepage = pkg.homePage();
|
||||
|
||||
info.InstallDirDEB = "/opt";
|
||||
if (!pkg.installDirDEB().isEmpty())
|
||||
info.InstallDirDEB = pkg.installDirDEB();
|
||||
|
||||
info.Prefix = releativeLocation(pkg);
|
||||
|
||||
QString cmdArray = "[";
|
||||
|
@ -1 +1,6 @@
|
||||
#include "templateinfo.h"
|
||||
#include "quasarapp.h"
|
||||
|
||||
QString TemplateInfo::InstallDeirQIFW() const {
|
||||
return QuasarAppUtils::Params::getArg("installDirQIFW", "@HomeDir@");
|
||||
}
|
||||
|
@ -5,6 +5,9 @@
|
||||
#include <QHash>
|
||||
#include <deploy_global.h>
|
||||
|
||||
/**
|
||||
* @brief The TemplateInfo struct This structure contains information about distribution packages.
|
||||
*/
|
||||
struct DEPLOYSHARED_EXPORT TemplateInfo
|
||||
{
|
||||
QString Name;
|
||||
@ -15,6 +18,8 @@ struct DEPLOYSHARED_EXPORT TemplateInfo
|
||||
QString Publisher;
|
||||
QString Homepage;
|
||||
QString Prefix;
|
||||
QString InstallDirDEB;
|
||||
QString InstallDeirQIFW() const;
|
||||
|
||||
QHash<QString, QString> Custom;
|
||||
|
||||
|
@ -462,6 +462,9 @@ bool ConfigParser::initDistroStruct() {
|
||||
auto trData = QuasarAppUtils::Params::getArg("tr").
|
||||
split(DeployCore::getSeparator(0), splitbehavior);
|
||||
|
||||
auto installDirDeb = QuasarAppUtils::Params::getArg("installDirDeb").
|
||||
split(DeployCore::getSeparator(0), splitbehavior);
|
||||
|
||||
// init distro stucts for all targets
|
||||
if (binOut.size() && !parsePackagesPrivate(mainDistro, binOut, &DistroModule::setBinOutDir)) {
|
||||
packagesErrorLog("binOut");
|
||||
@ -543,6 +546,11 @@ bool ConfigParser::initDistroStruct() {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (installDirDeb.size() && !parsePackagesPrivate(mainDistro, installDirDeb, &DistroModule::setInstallDirDEB)) {
|
||||
packagesErrorLog("installDirDeb");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -694,7 +702,9 @@ bool ConfigParser::parseDeployMode(bool checkBin) {
|
||||
return false;
|
||||
}
|
||||
|
||||
initExtraPath();
|
||||
if (!initExtraPath()) {
|
||||
return false;
|
||||
}
|
||||
initExtraNames();
|
||||
initPlugins();
|
||||
|
||||
@ -1293,7 +1303,7 @@ bool ConfigParser::setQtDir(const QString &value) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void ConfigParser::initExtraPath() {
|
||||
bool ConfigParser::initExtraPath() {
|
||||
auto listLibDir = QuasarAppUtils::Params::getArg("libDir").
|
||||
split(DeployCore::getSeparator(0));
|
||||
|
||||
@ -1308,6 +1318,16 @@ void ConfigParser::initExtraPath() {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (_config.envirement.isIgnore(info.absoluteFilePath())) {
|
||||
QuasarAppUtils::Params::log(QString("Failed to set libDir path!"
|
||||
" The %0 path will be ignored because"
|
||||
" this path is child path of the targetDir path"
|
||||
" or manually added into ignore environment.").
|
||||
arg(info.absoluteFilePath()),
|
||||
QuasarAppUtils::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
dir.setPath(info.absoluteFilePath());
|
||||
auto extraDirs = getSetDirsRecursive(QDir::fromNativeSeparators(info.absoluteFilePath()), _config.depchLimit);
|
||||
_config.extraPaths.addExtraPaths(extraDirs);
|
||||
@ -1325,6 +1345,8 @@ void ConfigParser::initExtraPath() {
|
||||
QuasarAppUtils::Debug);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ConfigParser::initExtraNames() {
|
||||
|
@ -83,7 +83,7 @@ private:
|
||||
bool setQmake(const QString &value);
|
||||
bool setQtDir(const QString &value);
|
||||
|
||||
void initExtraPath();
|
||||
bool initExtraPath();
|
||||
void initExtraNames();
|
||||
|
||||
bool initPlugins();
|
||||
|
@ -148,6 +148,17 @@ void DistroModule::setKey(const QString &key) {
|
||||
_key = key;
|
||||
}
|
||||
|
||||
QString DistroModule::installDirDEB() const {
|
||||
if (_installDirDEB.isEmpty())
|
||||
return "/opt";
|
||||
|
||||
return _installDirDEB;
|
||||
}
|
||||
|
||||
void DistroModule::setInstallDirDEB(const QString &newInstallDir) {
|
||||
_installDirDEB = newInstallDir;
|
||||
}
|
||||
|
||||
QSet<QString> DistroModule::tr() const {
|
||||
return _tr;
|
||||
}
|
||||
|
@ -74,6 +74,9 @@ public:
|
||||
void setTr(const QSet<QString> &tr);
|
||||
void addTr(const QString &tr);
|
||||
|
||||
QString installDirDEB() const;
|
||||
void setInstallDirDEB(const QString &newInstallDir);
|
||||
|
||||
protected:
|
||||
void setKey(const QString &key);
|
||||
|
||||
@ -101,6 +104,8 @@ private:
|
||||
// extra translations
|
||||
QSet<QString> _tr;
|
||||
|
||||
QString _installDirDEB;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
@ -65,7 +65,9 @@ void Envirement::addEnv(const QStringList &listDirs) {
|
||||
for (const auto& i : listDirs) {
|
||||
auto path = PathUtils::fixPath(QFileInfo(i).absoluteFilePath());
|
||||
|
||||
if (_ignoreEnvList && _ignoreEnvList->inThisEnvirement(i)) {
|
||||
if (isIgnore(i)) {
|
||||
QuasarAppUtils::Params::log(QString("The %0 path is ignored and not added to a search list!!").arg(i),
|
||||
QuasarAppUtils::Debug);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -85,6 +87,10 @@ void Envirement::addEnv(const QStringList &listDirs) {
|
||||
}
|
||||
}
|
||||
|
||||
bool Envirement::isIgnore(const QString &path) const {
|
||||
return _ignoreEnvList && _ignoreEnvList->inThisEnvirement(path);
|
||||
}
|
||||
|
||||
void Envirement::clear() {
|
||||
if (_ignoreEnvList)
|
||||
delete _ignoreEnvList;
|
||||
|
@ -34,6 +34,13 @@ public:
|
||||
void addEnv(const QString &dir);
|
||||
void addEnv(const QStringList &listDirs);
|
||||
|
||||
/**
|
||||
* @brief isIgnore This method return true if the @a path is contains in ignore list else return false.
|
||||
* @brief path This is path to of the system enviroment that will be checked to ignore.
|
||||
* @return true if the @a path is contains in ignore list else return false.
|
||||
*/
|
||||
bool isIgnore(const QString& path) const;
|
||||
|
||||
void clear();
|
||||
|
||||
// return true if file exits in this envirement
|
||||
|
@ -87,19 +87,12 @@ function systemIntegration() {
|
||||
console.log("hometDir " + homeDir)
|
||||
|
||||
if (systemInfo.kernelType === "winnt") {
|
||||
component.addOperation('EnvironmentVariable',
|
||||
[
|
||||
"cqtdeployer",
|
||||
targetDir + "\\" + VERSION + "\\cqtdeployer.bat"
|
||||
]
|
||||
)
|
||||
|
||||
component.addOperation('EnvironmentVariable',
|
||||
[
|
||||
"cqtDir",
|
||||
targetDir + "\\" + VERSION + "\\"
|
||||
]
|
||||
)
|
||||
component.addOperation('Execute', ["SETX", "cqtdeployer", targetDir + "\\" + VERSION + "\\cqtdeployer.bat"],
|
||||
"UNDOEXECUTE", ["SETX", "cqtdeployer", ""])
|
||||
component.addOperation('Execute', ["SETX", "cqtDir", targetDir + "\\" + VERSION + "\\"],
|
||||
"UNDOEXECUTE", ["SETX", "cqtDir", ""])
|
||||
|
||||
|
||||
let PATH = installer.environmentVariable("PATH");
|
||||
const cqtDir = installer.environmentVariable("cqtDir");
|
||||
|
@ -20,6 +20,7 @@ Key differences of this program:
|
||||
* Fast create installers : Upon completion of the deployment, you will receive a self-contained installer of your distribution.
|
||||
|
||||
## Supported platforms:
|
||||
|
||||
* <img src="https://user-images.githubusercontent.com/12465465/67766480-929b5000-fa5f-11e9-8ae7-377d9ddb7c65.png" height="100">
|
||||
* <img src="https://upload.wikimedia.org/wikipedia/commons/8/8d/Windows_darkblue_2012.svg" height="100">
|
||||
|
||||
|
@ -185,6 +185,10 @@ private slots:
|
||||
void testDisableShortcuts();
|
||||
void testDisableRunScripts();
|
||||
void testQifOut();
|
||||
void testIgnoreEnvWithLibDir();
|
||||
|
||||
// note: this test checking in manual mode only.
|
||||
void testInstallDirsOptions();
|
||||
|
||||
void customTest();
|
||||
};
|
||||
@ -1533,6 +1537,44 @@ void deploytest::testQifOut() {
|
||||
"qif", "-qifOut", "QIF_OUT.exe"}, &result);
|
||||
}
|
||||
|
||||
void deploytest::testIgnoreEnvWithLibDir() {
|
||||
#ifdef Q_OS_UNIX
|
||||
QString bin = TestBinDir + "TestOnlyC";
|
||||
#else
|
||||
QString bin = TestBinDir + "TestOnlyC.exe";
|
||||
#endif
|
||||
|
||||
QVERIFY(QDir().mkdir("libDirtest"));
|
||||
|
||||
// Run deploy installer
|
||||
runTestParams({"-bin", bin, "clear",
|
||||
"-targetDir", "./libDirtest",
|
||||
"-libDir", "./libDirtest"}, nullptr, false, false,
|
||||
exitCodes::PrepareError);
|
||||
|
||||
QVERIFY(QDir().rmdir("libDirtest"));
|
||||
}
|
||||
|
||||
void deploytest::testInstallDirsOptions() {
|
||||
#ifdef QT_DEBUG
|
||||
#ifdef Q_OS_UNIX
|
||||
QStringList binMulti = {TestBinDir + "TestOnlyC" , TestBinDir + "TestCPPOnly"};
|
||||
|
||||
#else
|
||||
QStringList binMulti = {TestBinDir + "TestOnlyC.exe" , TestBinDir + "TestCPPOnly.exe"};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
runTestParams({"-bin", binMulti.join(","), "clear",
|
||||
"qif", "deb",
|
||||
"-targetPackage", "pkg;TestCPPOnly",
|
||||
"-installDirDeb", "pkg;/var",
|
||||
"-installDirQIFW", "/opt"});
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void deploytest::customTest() {
|
||||
//runTestParams({"-confFile", "",
|
||||
// "qifFromSystem"});
|
||||
|
@ -99,7 +99,9 @@ cqtdeployer -option1 value1 -option2 list, of, values flag1 flag2 flag3
|
||||
| -extraPlugin [list,params]| Sets an additional path to extraPlugin of an app |
|
||||
| -recursiveDepth [params] | Sets the Depth of recursive search of libs and ignoreEnv (default 0) |
|
||||
| -targetDir [params] | Sets target directory(by default it is the path to the first deployable file)|
|
||||
| -verbose [0-3] | Shows debug log |
|
||||
| -installDirDeb [params] | Sets install target directory fordebian package (by default it is /opt path) |
|
||||
| -installDirQIFW [params] | Sets install target directory for installers (by default it is /home path) |
|
||||
| -verbose [0-3] | Shows debug log. By default it is 2 |
|
||||
|
||||
### Controll of packages options
|
||||
|
||||
|
@ -94,7 +94,9 @@ cqtdeployer -option1 value1 -option2 list,of,values flag1 flag2 flag3
|
||||
| -extraPlugin [list,params] | Устанавливает дополнительный путь для extraPlugin приложения|
|
||||
| -recursiveDepth [params] | Устанавливает глубину поиска библиотек и глубину игнорирования окружения для ignoreEnv (по умолчанию 0) |
|
||||
| -targetDir [params] | Устанавливает целевой каталог (по умолчанию это путь к первому развертываемому файлу)|
|
||||
| -verbose [0-3] | Показывает дебаг лога |
|
||||
| -installDirDeb [параметры] | Устанавливает целевой каталог для установки пакета Debian (по умолчанию это /opt путь) |
|
||||
| -installDirQIFW [параметры]| Устанавливает целевой каталог установки для инсталляторов (по умолчанию это путь /home) |
|
||||
| -verbose [0-3] | Показывает дебаг лог. По умолчанию равен 2 |
|
||||
|
||||
### Параметры управлениями пакетами:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user