Merge pull request #133 from QuasarApp/v1.2

V1.2
This commit is contained in:
Andrei Yankovich 2019-06-28 16:45:42 +03:00 committed by GitHub
commit d37c9d7144
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 15 additions and 539 deletions

3
.gitmodules vendored
View File

@ -7,3 +7,6 @@
[submodule "pe"]
path = pe
url = https://github.com/QuasarApp/pe-parse.git
[submodule "installer"]
path = installer
url = git@github.com:QuasarApp/DesktopInstaller.git

View File

@ -7,13 +7,13 @@
TEMPLATE = subdirs
CONFIG += ordered
!android {
SUBDIRS += QuasarAppLib \
Pe \
Deploy \
CQtDeployer \
UnitTests
}
contains(DEFINES, WITHOUT_BASE_TESTS) {
SUBDIRS -= UnitTests
}
@ -31,7 +31,7 @@ CQtDeployer.depends=Deploy
QuasarAppLib.file = $$PWD/QuasarAppLib/QuasarApp.pro
Pe.file = $$PWD/pe/pe-parser-library/pe-parser-library.pro
include('$$PWD/installer/installer.pri')
include('$$PWD/installer/installerCQtDeployer.pri')
include($$PWD/test.pri)
DISTFILES += \

View File

@ -20,7 +20,7 @@ include('$$PWD/../Deploy/Deploy.pri')
include('$$PWD/../pe/pe-parser-library/pe-parser-library.pri')
QT_DIR = $$dirname(QMAKE_QMAKE)/../
QT_DIR = $$[QT_HOST_BINS]/../
DEFINES+=QT_BASE_DIR='\\"$$QT_DIR\\"'
CONFIG += qt console warn_on depend_includepath testcase

1
installer Submodule

@ -0,0 +1 @@
Subproject commit 321f571978467a8103846541bfdeae716e4fa539

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<WizardDefaultWidth>640px</WizardDefaultWidth>
<WizardDefaultHeight>400px</WizardDefaultHeight>
<Name>CQtDeployer</Name>
<Version>1.2.3.1</Version>
<Title>CQtDeployer</Title>
<Publisher>QuasarApp</Publisher>
<StartMenuDir>CQtDeployer</StartMenuDir>
<TargetDir>@HomeDir@/CQtDeployer</TargetDir>
<InstallActionColumnVisible>true</InstallActionColumnVisible>
<RemoveTargetDir>true</RemoveTargetDir>
<ControlScript>controlScript.js</ControlScript>
<MaintenanceToolName>CQtDeployerTool</MaintenanceToolName>
<WizardStyle>Classic</WizardStyle>
<StyleSheet>style.css</StyleSheet>
<Banner>banner.png</Banner>
<Logo>logo.png</Logo>
<RemoteRepositories>
<Repository>
<Url>http://178.124.160.6:3030/CQtDeployer/Linux</Url>
<Enabled>1</Enabled>
<DisplayName>QuasarApp</DisplayName>
</Repository>
</RemoteRepositories>
</Installer>

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<WizardDefaultWidth>640px</WizardDefaultWidth>
<WizardDefaultHeight>400px</WizardDefaultHeight>
<Name>CQtDeployer</Name>
<Version>1.2.3.1</Version>
<Title>CQtDeployer</Title>
<Publisher>QuasarApp</Publisher>
<StartMenuDir>CQtDeployer</StartMenuDir>
<TargetDir>@HomeDir@/CQtDeployer</TargetDir>
<InstallActionColumnVisible>true</InstallActionColumnVisible>
<RemoveTargetDir>true</RemoveTargetDir>
<ControlScript>controlScript.js</ControlScript>
<MaintenanceToolName>CQtDeployerTool</MaintenanceToolName>
<WizardStyle>Classic</WizardStyle>
<StyleSheet>style.css</StyleSheet>
<Banner>banner.png</Banner>
<Logo>logo.png</Logo>
<RemoteRepositories>
<Repository>
<Url>http://178.124.160.6:3030/CQtDeployer/Windows</Url>
<Enabled>1</Enabled>
<DisplayName>QuasarApp</DisplayName>
</Repository>
</RemoteRepositories>
</Installer>

View File

@ -1,79 +0,0 @@
function Controller()
{
generateTr();
installer.setMessageBoxAutomaticAnswer("OverwriteTargetDirectory", QMessageBox.Yes);
installer.uninstallationFinished.connect(this, Controller.prototype.uninstallationFinished);
installer.installationFinished.connect(this, Controller.prototype.installationFinished);
}
function generateTr() {
console.log("generate tr start ")
installer.setValue("Name", qsTr("CQtDeployer"));
installer.setValue("Title", qsTr("Install CQtDeployer"));
}
Controller.prototype.uninstallationFinished = function()
{
homeDir = installer.value("HomeDir", "");
console.log("hometDir " + homeDir)
if (systemInfo.kernelType === "winnt") {
if (!installer.gainAdminRights()) {
QMessageBox["warning"](qsTr("install in system"), qsTr("Installer"),
qsTr("To uninstall cqtdeployer on your system, you need administrator rights!. "), QMessageBox.Ok);
return;
}
installer.execute("DELETE", ["C:\Windows\system32\cqtdeployer.exe"])
installer.dropAdminRights();
} else {
installer.execute("rm", ["-f", homeDir + "/.local/bin/cqtdeployer"])
}
}
Controller.prototype.installationFinished = function()
{
targetDir = installer.value("TargetDir", "");
homeDir = installer.value("HomeDir", "");
console.log("targetDir " + targetDir)
console.log("hometDir " + homeDir)
if (systemInfo.kernelType === "winnt") {
installer.execute("SETX", [ "cqtdeployer", targetDir + "/cqtdeployer.exe"])
QMessageBox["information"](qsTr("install in system"), qsTr("Installer"),
qsTr("CQtDeployer successfully installed on your computer to use the call \"%cqtdeployer%\"."),
QMessageBox.Ok);
} else {
if (!installer.fileExists(homeDir + "/.local/bin")) {
installer.execute("mkpath", ["-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);
}
installer.execute("ln", ["-sf", targetDir + "/cqtdeployer.sh",
homeDir + "/.local/bin/cqtdeployer"])
QMessageBox["information"](qsTr("install in system"), qsTr("Installer"),
qsTr("CQtDeployer successfully installed on your computer to use the call \"cqtdeployer\"."),
QMessageBox.Ok);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

View File

@ -1,67 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ru_RU">
<context>
<name>controlScript</name>
<message>
<location filename="controlScript.js" line="13"/>
<source>CQtDeployer</source>
<translation>CQtDeployer</translation>
</message>
<message>
<location filename="controlScript.js" line="14"/>
<source>Install CQtDeployer</source>
<oldsource>Install Snake</oldsource>
<translation>Установка CQtDeployer</translation>
</message>
<message>
<location filename="controlScript.js" line="25"/>
<location filename="controlScript.js" line="55"/>
<location filename="controlScript.js" line="64"/>
<location filename="controlScript.js" line="73"/>
<source>install in system</source>
<translation>Установка в систему</translation>
</message>
<message>
<location filename="controlScript.js" line="25"/>
<location filename="controlScript.js" line="55"/>
<location filename="controlScript.js" line="64"/>
<location filename="controlScript.js" line="73"/>
<source>Installer</source>
<translation>Установщик</translation>
</message>
<message>
<location filename="controlScript.js" line="26"/>
<source>To uninstall cqtdeployer on your system, you need administrator rights!. </source>
<translation>Чтобы удалить cqtdeployer в вашей системе, вам нужны права администратора !. </translation>
</message>
<message>
<location filename="controlScript.js" line="65"/>
<source>The &quot;~/local/bin&quot; folder was not initialized, you may need to reboot to work correctly!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>To install cqtdeployer on your system, you need administrator rights!. </source>
<translation type="vanished">Чтобы установить cqtdeployer в вашей системе, вам нужны права администратора!. </translation>
</message>
<message>
<source>The installation was successful, but cqtdeployer will not be available from the console. </source>
<translation type="vanished">Установка прошла успешно, но cqtdeployer не будет доступен из консоли. </translation>
</message>
<message>
<location filename="controlScript.js" line="56"/>
<source>CQtDeployer successfully installed on your computer to use the call &quot;%cqtdeployer%&quot;.</source>
<oldsource>To take advantage of this program you will need to enter the full path to it. </oldsource>
<translation type="unfinished">Чтобы воспользоваться этой программой, вам нужно будет ввести полный путь к ней. </translation>
</message>
<message>
<source>Example: </source>
<translation type="vanished">Пример: </translation>
</message>
<message>
<location filename="controlScript.js" line="74"/>
<source>CQtDeployer successfully installed on your computer to use the call &quot;cqtdeployer&quot;.</source>
<translation>CQtDeployer успешно установлен на вашем компьютере, чтобы запустить напишите &quot;cqtdeployer&quot; в консоли.</translation>
</message>
</context>
</TS>

View File

@ -1,62 +0,0 @@
.QWidget {
background-color: rgb(255, 255, 255);
min-width: 640px;
}
.QLabel {
color: #000000;
}
.QPushButton {
background-color: transparent;
border: 2px solid #ffffff;
border-radius: 3px;
height: 30px;
min-width: 100px;
padding: 0 15px;
}
.QPushButton:pressed,
.QPushButton:checked {
background-color: #2ed3ed;
}
.QPushButton:focus {
background-color: #aaf2ff;
}
.QPushButton:hover {
border: 2px solid #2ed3ed;
}
.QProgressBar {
background: #b1dbcc;
border: 1px solid #cdcdcd;
border-radius: 2px;
padding: 0;
margin: 0;
color: #ffffff;
height: 30px;
text-align: center;
}
.QProgressBar::chunk {
background: #16dbcc;
border-radius: 2px;
margin: 0;
}
.QProgressBar:hover {
border-color: #2ed3ed;
}
.QLineEdit {
background-color: transparent;
border-color: #cdcdcd;
height: 30px;
}
.QLineEdit:hover {
border-color: #2ed3ed;
}

View File

@ -1,33 +0,0 @@
!isEmpty(INSTALL_REFIX_PRI_INCLUDED):error("install_prefix.pri already included")
INSTALL_REFIX_PRI_INCLUDED = 1
unix:libfiletype=*.so*
win32:libfiletype=*.dll
unix:runfiletype=*
win32:runfiletype=*.exe
isEmpty(PREFIX_BIN) {
isEmpty(PREFIX) {
PREFIX_BIN = $$PWD/distro
} else {
unix:PREFIX_BIN = $$PREFIX/bin
win32:PREFIX_BIN = $$PREFIX
}
}
isEmpty(PREFIX_LIB) {
isEmpty(PREFIX) {
PREFIX_LIB = $$PWD/distro
} else {
unix:PREFIX_LIB = $$PREFIX/lib
win32:PREFIX_LIB = $$PREFIX
}
}
target_bin.path = $$PREFIX_BIN
target_bin.CONFIG += no_check_exist
target_lib.path = $$PREFIX_LIB
target_lib.CONFIG += no_check_exist
INSTALLS += target_bin target_lib

View File

@ -1,158 +0,0 @@
QT_DIR = $$dirname(QMAKE_QMAKE)
#QML_DIR = $$PWD/../Snake/
DEPLOY_TARGET = $$PWD/../CQtDeployer/build/release
win32:LUPDATE = $$QT_DIR/lupdate.exe
win32:LRELEASE = $$QT_DIR/lrelease.exe
win32:DEPLOYER = %cqtdeployer%
win32:OUT_FILE = CQtDeployerInstaller.exe
contains(QMAKE_HOST.os, Linux):{
LUPDATE = $$QT_DIR/lupdate
LRELEASE = $$QT_DIR/lrelease
DEPLOYER = cqtdeployer
OUT_FILE = CQtDeployerInstaller
}
BINARY_LIST
REPO_LIST
sopprted_versions = 3.1 3.0 2.0
for(val, sopprted_versions) {
exists( $$QT_DIR/../../../Tools/QtInstallerFramework/$$val/bin/ ) {
message( "QtInstallerFramework v$$val: yes" )
BINARY_LIST += $$QT_DIR/../../../Tools/QtInstallerFramework/$$val/bin/binarycreator
REPO_LIST += $$QT_DIR/../../../Tools/QtInstallerFramework/$$val/bin/repogen
}
}
isEmpty (BINARY_LIST) {
error( "QtInstallerFramework not found!" )
}
win32:EXEC=$$first(BINARY_LIST).exe
win32:REPOGEN=$$first(REPO_LIST).exe
contains(QMAKE_HOST.os, Linux):{
unix:EXEC=$$first(BINARY_LIST)
win32:EXEC=wine $$first(BINARY_LIST).exe
REPOGEN=$$first(REPO_LIST)
}
message( selected $$EXEC and $$REPOGEN)
SUPPORT_LANGS = ru
defineReplace(findFiles) {
patern = $$1
path = $$2
all_files = $$files(*$${patern}, true)
win32:all_files ~= s|\\\\|/|g
win32:path ~= s|\\\\|/|g
for(file, all_files) {
result += $$find(file, $$path)
}
return($$result)
}
XML_FILES = $$files(*.xml, true)
for(LANG, SUPPORT_LANGS) {
for(XML, XML_FILES) {
FILE_PATH = $$dirname(XML)
JS_FILES = $$findFiles(".js", $$FILE_PATH)
UI_FILES = $$findFiles(".ui", $$FILE_PATH)
commands += "$$LUPDATE $$JS_FILES $$UI_FILES -ts $$FILE_PATH/$${LANG}.ts"
TS_FILES += $$FILE_PATH/$${LANG}.ts
}
for(TS, TS_FILES) {
commands += "$$LRELEASE $$TS"
}
}
for(command, commands) {
system($$command)|error("Failed to run: $$command")
}
BASE_DEPLOY_FLAGS = clear -qmake $$QMAKE_QMAKE -libDir $$PWD/../ -recursiveDepth 4
BASE_DEPLOY_FLAGS_SNAKE = $$BASE_DEPLOY_FLAGS -targetDir $$PWD/packages/cqtdeployer/data
deploy_dep.commands += $$DEPLOYER -bin $$DEPLOY_TARGET $$BASE_DEPLOY_FLAGS_SNAKE
mkpath( $$PWD/../Distro)
win32:CONFIG_FILE = $$PWD/config/configWin.xml
unix:CONFIG_FILE = $$PWD/config/configLinux.xml
deploy.commands = $$EXEC \
--offline-only \
-c $$CONFIG_FILE \
-p $$PWD/packages \
$$PWD/../Distro/$$OUT_FILE
deploy.depends = deploy_dep
win32:ONLINE_REPO_DIR = $$ONLINE/CQtDeployer/Windows
unix:ONLINE_REPO_DIR = $$ONLINE/CQtDeployer/Linux
create_repo.commands = $$REPOGEN \
--update-new-components \
-p $$PWD/packages \
$$ONLINE_REPO_DIR
chmodSnap.commands = chmod 777 -R $$PWD/packages/cqtdeployer/data
unix:release.depends += chmodSnap
message( ONLINE_REPO_DIR $$ONLINE_REPO_DIR)
!isEmpty( ONLINE ) {
message(online)
release.depends = create_repo
deploy.commands = $$EXEC \
--online-only \
-c $$CONFIG_FILE \
-p $$PWD/packages \
$$PWD/../Distro/$$OUT_FILE
}
releaseSnap.commands = rm *.snap -rdf && chmod 777 -R $$PWD/../prime && snapcraft && snapcraft push *.snap # bad patern
buildSnap.commands = snapcraft
clearSnap.commands = rm parts prime stage *.snap -rdf
unix:release.depends += clearSnap
unix:release.depends += buildSnap
unix:release.depends += releaseSnap
OTHER_FILES += \
$$PWD/config/*.* \
$$PWD/packages/cqtdeployer/meta/* \
QMAKE_EXTRA_TARGETS += \
deploy_dep \
deploy \
create_repo \
release \
clearSnap \
releaseSnap \
buildSnap \
chmodSnap

View File

@ -1,17 +0,0 @@
function Component()
{
generateTr();
}
function generateTr() {
component.setValue("DisplayName", qsTr("CQtDeployer"));
component.setValue("Description", qsTr("This package contains CQtDeployer"));
}
Component.prototype.createOperations = function()
{
// // call default implementation to actually install README.txt!
component.createOperations();
}

View File

@ -1,14 +0,0 @@
<?xml version="1.0"?>
<Package>
<DisplayName>CQtDeployer</DisplayName>
<Description>CQtDeployer</Description>
<Version>1.2.3.1</Version>
<Default>true</Default>
<ForcedInstallation>false</ForcedInstallation>
<Script>installscript.js</Script>
<ReleaseDate>2019-05-14</ReleaseDate>
<SortingPriority>200</SortingPriority>
<Translations>
<Translation>ru.qm</Translation>
</Translations>
</Package>

View File

@ -1,50 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ru_RU">
<context>
<name>installscript</name>
<message>
<location filename="installscript.js" line="7"/>
<source>CQtDeployer</source>
<translation>CQtDeployer</translation>
</message>
<message>
<location filename="installscript.js" line="8"/>
<source>This package contains CQtDeployer</source>
<oldsource>This package contains Snake</oldsource>
<translation>Этот пакет содержит CQtDeployer</translation>
</message>
<message>
<source>install in system</source>
<translation type="vanished">Установка в систему</translation>
</message>
<message>
<source>Installer</source>
<translation type="vanished">Установщик</translation>
</message>
<message>
<source>To uninstall cqtdeployer on your system, you need administrator rights!. </source>
<translation type="vanished">Чтобы удалить cqtdeployer в вашей системе, вам нужны права администратора !. </translation>
</message>
<message>
<source>To install cqtdeployer on your system, you need administrator rights!. </source>
<translation type="vanished">Чтобы установить cqtdeployer в вашей системе, вам нужны права администратора!. </translation>
</message>
<message>
<source>The installation was successful, but cqtdeployer will not be available from the console. </source>
<translation type="vanished">Установка прошла успешно, но cqtdeployer не будет доступен из консоли. </translation>
</message>
<message>
<source>To take advantage of this program you will need to enter the full path to it. </source>
<translation type="vanished">Чтобы воспользоваться этой программой, вам нужно будет ввести полный путь к ней. </translation>
</message>
<message>
<source>Example: </source>
<translation type="vanished">Пример: </translation>
</message>
<message>
<source>CQtDeployer successfully installed on your computer to use the call &quot;cqtdeployer&quot;.</source>
<translation type="vanished">CQtDeployer успешно установлен на вашем компьютере, чтобы использоваться введите в консоле &quot;cqtdeployer&quot;.</translation>
</message>
</context>
</TS>

BIN
res/icon (snapAlpha).png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -1,7 +1,13 @@
unix:exec = $$PWD/UnitTests/build/release/UnitTests
win32:exec = $$PWD/UnitTests/build/release/UnitTests.exe
deployTest.commands = cqtdeployer -bin $$exec clear -qmake $$QMAKE_QMAKE -targetDir $$PWD/deployTests -libDir $$PWD -recursiveDepth 4
QT_DIR= $$[QT_HOST_BINS]
win32:QMAKE_BIN= $$QT_DIR/qmake.exe
contains(QMAKE_HOST.os, Linux):{
QMAKE_BIN= $$QT_DIR/qmake
}
deployTest.commands = cqtdeployer -bin $$exec clear -qmake $$QMAKE_BIN -targetDir $$PWD/deployTests -libDir $$PWD -recursiveDepth 4
test.depends = deployTest
unix:test.commands = $$PWD/deployTests/UnitTests.sh