mirror of
https://github.com/QuasarApp/Snake.git
synced 2025-04-27 02:04:41 +00:00
test NewInstaller
This commit is contained in:
parent
551df579a1
commit
fe737d44f6
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -5,3 +5,6 @@
|
||||
[submodule "SnakeServer/Qt-Secret"]
|
||||
path = SnakeServer/Qt-Secret
|
||||
url = git@github.com:QuasarApp/Qt-Secret.git
|
||||
[submodule "installer"]
|
||||
path = installer
|
||||
url = git@github.com:QuasarApp/DesktopInstaller.git
|
||||
|
1
installer
Submodule
1
installer
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit b92686a46340eca95d49d183d04a3f6586f491ba
|
Binary file not shown.
Before Width: | Height: | Size: 2.4 KiB |
@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Installer>
|
||||
<WizardDefaultWidth>640px</WizardDefaultWidth>
|
||||
<WizardDefaultHeight>400px</WizardDefaultHeight>
|
||||
<Name>Snake</Name>
|
||||
<Version>1.0.0</Version>
|
||||
<Title>Snake</Title>
|
||||
<Publisher>SKB</Publisher>
|
||||
<StartMenuDir>Snake</StartMenuDir>
|
||||
<TargetDir>@HomeDir@/Snake</TargetDir>
|
||||
<CreateLocalRepository>true</CreateLocalRepository>
|
||||
<InstallActionColumnVisible>true</InstallActionColumnVisible>
|
||||
<RemoveTargetDir>true</RemoveTargetDir>
|
||||
<ControlScript>controlScript.js</ControlScript>
|
||||
<MaintenanceToolName>Uninstall</MaintenanceToolName>
|
||||
<WizardStyle>Classic</WizardStyle>
|
||||
<StyleSheet>style.css</StyleSheet>
|
||||
<Banner>banner.png</Banner>
|
||||
<Logo>logo.png</Logo>
|
||||
<RunProgram>@TargetDir@/snake.sh</RunProgram>
|
||||
|
||||
<RemoteRepositories>
|
||||
<Repository>
|
||||
<Url>http://178.124.160.6:3030/Snake/Linux</Url>
|
||||
<Enabled>1</Enabled>
|
||||
<DisplayName>QuasarApp</DisplayName>
|
||||
</Repository>
|
||||
</RemoteRepositories>
|
||||
</Installer>
|
@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Installer>
|
||||
<WizardDefaultWidth>640px</WizardDefaultWidth>
|
||||
<WizardDefaultHeight>400px</WizardDefaultHeight>
|
||||
<Name>Snake</Name>
|
||||
<Version>1.0.0</Version>
|
||||
<Title>Snake</Title>
|
||||
<Publisher>SKB</Publisher>
|
||||
<StartMenuDir>Snake</StartMenuDir>
|
||||
<TargetDir>@HomeDir@/Snake</TargetDir>
|
||||
<CreateLocalRepository>true</CreateLocalRepository>
|
||||
<InstallActionColumnVisible>true</InstallActionColumnVisible>
|
||||
<RemoveTargetDir>true</RemoveTargetDir>
|
||||
<ControlScript>controlScript.js</ControlScript>
|
||||
<MaintenanceToolName>Uninstall</MaintenanceToolName>
|
||||
<WizardStyle>Classic</WizardStyle>
|
||||
<StyleSheet>style.css</StyleSheet>
|
||||
<Banner>banner.png</Banner>
|
||||
<Logo>logo.png</Logo>
|
||||
<RunProgram>@TargetDir@/snake.exe</RunProgram>
|
||||
|
||||
<RemoteRepositories>
|
||||
<Repository>
|
||||
<Url>http://178.124.160.6:3030/Snake/Windows</Url>
|
||||
<Enabled>1</Enabled>
|
||||
<DisplayName>QuasarApp</DisplayName>
|
||||
</Repository>
|
||||
</RemoteRepositories>
|
||||
</Installer>
|
@ -1,35 +0,0 @@
|
||||
function Controller()
|
||||
{
|
||||
generateTr();
|
||||
|
||||
installer.setMessageBoxAutomaticAnswer("OverwriteTargetDirectory", QMessageBox.Yes);
|
||||
installer.uninstallationFinished.connect(this, Controller.prototype.uninstallationFinished);
|
||||
installer.installationFinished.connect(this, Controller.prototype.installationFinished);
|
||||
runProgramm();
|
||||
}
|
||||
|
||||
function generateTr() {
|
||||
console.log("generate tr start ")
|
||||
|
||||
installer.setValue("Name", qsTr("Snake"));
|
||||
installer.setValue("Title", qsTr("Install Snake"));
|
||||
}
|
||||
|
||||
function runProgramm() {
|
||||
if (systemInfo.kernelType === "winnt") {
|
||||
installer.setValue("RunProgram", "@TargetDir@/snake.exe")
|
||||
} else {
|
||||
installer.setValue("RunProgram", "@TargetDir@/snake.sh")
|
||||
}
|
||||
}
|
||||
|
||||
Controller.prototype.uninstallationFinished = function()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
Controller.prototype.installationFinished = function()
|
||||
{
|
||||
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 32 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.4 KiB |
@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>controlScript</name>
|
||||
<message>
|
||||
<location filename="controlScript.js" line="14"/>
|
||||
<source>Snake</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="controlScript.js" line="15"/>
|
||||
<source>Install Snake</source>
|
||||
<oldsource>Install Noisier</oldsource>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
@ -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;
|
||||
}
|
@ -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
|
||||
|
@ -1,196 +0,0 @@
|
||||
QT_DIR = $$[QT_HOST_BINS]
|
||||
|
||||
QMAKE_BIN = $$QT_DIR/qmake
|
||||
win32:QMAKE_BIN = $$QT_DIR/qmake.exe
|
||||
|
||||
message(QT_DIR = $$QT_DIR)
|
||||
|
||||
QML_DIR = $$PWD/../Snake/
|
||||
DEPLOY_TARGET = $$PWD/../Snake/build/release
|
||||
DEPLOY_SERVER = $$PWD/../SnakeServer/Daemon/build/release,$$PWD/../SnakeServer/Terminal/build/release
|
||||
|
||||
ANDROID_BUILD_DIR = $$PWD/../android-build
|
||||
|
||||
win32:LUPDATE = $$QT_DIR/lupdate.exe
|
||||
win32:LRELEASE = $$QT_DIR/lrelease.exe
|
||||
|
||||
win32:DEPLOYER = %cqtdeployer%
|
||||
|
||||
win32:OUT_FILE = SnakeInstaller.exe
|
||||
|
||||
contains(QMAKE_HOST.os, Linux):{
|
||||
LUPDATE = $$QT_DIR/lupdate
|
||||
LRELEASE = $$QT_DIR/lrelease
|
||||
QMAKE_BIN = $$QT_DIR/qmake
|
||||
|
||||
DEPLOYER = cqtdeployer
|
||||
|
||||
OUT_FILE = SnakeInstaller
|
||||
|
||||
}
|
||||
|
||||
android {
|
||||
DEPLOYER = $$QT_DIR/androiddeployqt
|
||||
}
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
INSTALL_SERVER_DIR = ~/SnakeServer
|
||||
|
||||
IGNORE_ENV=$$PWD/../Distro/,$$PWD/../deployTests,$$PWD/packages/Snake/data/
|
||||
BASE_DEPLOY_FLAGS = clear -qmake $$QMAKE_BIN -libDir $$PWD/../ -recursiveDepth 5 -ignoreEnv $$IGNORE_ENV
|
||||
BASE_DEPLOY_FLAGS_SERVER = $$BASE_DEPLOY_FLAGS -targetDir $$INSTALL_SERVER_DIR
|
||||
BASE_DEPLOY_FLAGS_SNAKE = $$BASE_DEPLOY_FLAGS -targetDir $$PWD/packages/Snake/data
|
||||
|
||||
deploy_dep.commands += $$DEPLOYER -bin $$DEPLOY_TARGET -qmlDir $$QML_DIR $$BASE_DEPLOY_FLAGS_SNAKE
|
||||
|
||||
install_dep.commands = make INSTALL_ROOT=$$ANDROID_BUILD_DIR install
|
||||
|
||||
mkpath( $$PWD/../Distro)
|
||||
|
||||
win32:CONFIG_FILE = $$PWD/config/configWin.xml
|
||||
unix:CONFIG_FILE = $$PWD/config/configLinux.xml
|
||||
|
||||
deploy.commands = $$EXEC \
|
||||
-c $$CONFIG_FILE \
|
||||
-p $$PWD/packages \
|
||||
$$PWD/../Distro/$$OUT_FILE
|
||||
|
||||
deploy.depends = deploy_dep
|
||||
|
||||
win32:ONLINE_REPO_DIR = $$ONLINE/Snake/Windows
|
||||
unix:ONLINE_REPO_DIR = $$ONLINE/Snake/Linux
|
||||
|
||||
create_repo.commands = $$REPOGEN \
|
||||
--update-new-components \
|
||||
-p $$PWD/packages \
|
||||
$$ONLINE_REPO_DIR
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
android {
|
||||
|
||||
INPUT_ANDROID = --input $$PWD/../Snake/android-libsnake.so-deployment-settings.json
|
||||
OUTPUT_ANDROID = --output $$ANDROID_BUILD_DIR
|
||||
A_PL = --android-platform android-29
|
||||
JDK = --jdk /usr
|
||||
|
||||
GRADLE = --gradle
|
||||
|
||||
deploy_dep.commands = $$DEPLOYER $$INPUT_ANDROID $$OUTPUT_ANDROID $$A_PL $$JDK $$GRADLE
|
||||
deploy_dep.depends = install_dep
|
||||
|
||||
deploy.commands = cp $$ANDROID_BUILD_DIR/build/outputs/apk/* $$PWD/../Distro
|
||||
}
|
||||
|
||||
OTHER_FILES += \
|
||||
$$PWD/config/*.xml \
|
||||
$$PWD/config/*.js \
|
||||
$$PWD/config/*.ts \
|
||||
$$PWD/config/*.css \
|
||||
$$PWD/packages/Installer/meta/* \
|
||||
$$PWD/packages/Installer/data/app.check \
|
||||
$$PWD/packages/Snake/meta/* \
|
||||
|
||||
installSnake.commands = $$DEPLOYER -bin $$DEPLOY_SERVER $$BASE_DEPLOY_FLAGS_SERVER
|
||||
|
||||
createLinks.commands = ln -sf $$INSTALL_SERVER_DIR/Terminal.sh ~/.local/bin/snake-term && \
|
||||
ln -sf $$INSTALL_SERVER_DIR/SnakeServer-daemon.sh ~/.local/bin/snake-d
|
||||
|
||||
|
||||
runDaemon.commands = snake-d daemon
|
||||
|
||||
unix:!android:release.depends += installSnake
|
||||
unix:!android:release.depends += createLinks
|
||||
|
||||
|
||||
QMAKE_EXTRA_TARGETS += \
|
||||
installSnake \
|
||||
createLinks \
|
||||
runDaemon \
|
||||
deploy_dep \
|
||||
install_dep \
|
||||
deploy \
|
||||
create_repo \
|
||||
release \
|
@ -1 +0,0 @@
|
||||
Noisier
|
Binary file not shown.
Before Width: | Height: | Size: 32 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.4 KiB |
@ -1,25 +0,0 @@
|
||||
// Constructor
|
||||
function Component()
|
||||
{
|
||||
generateTr();
|
||||
}
|
||||
|
||||
function generateTr() {
|
||||
console.log("generate tr start ")
|
||||
|
||||
component.setValue("DisplayName", qsTr("Installer"));
|
||||
component.setValue("Description", qsTr("This package contains information of installer"));
|
||||
}
|
||||
|
||||
function nativeSeparator() {
|
||||
if (installer.value("os") === "win") {
|
||||
return '\\';
|
||||
}
|
||||
return '/'
|
||||
}
|
||||
|
||||
function isNoEmpty(dir){
|
||||
var libsArray = installer.findPath("*", [dir]);
|
||||
return Boolean(libsArray.length);
|
||||
}
|
||||
|
@ -1,14 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<Package>
|
||||
<DisplayName>from script</DisplayName>
|
||||
<Description>from script</Description>
|
||||
<Version>1.0.0</Version>
|
||||
<Default>true</Default>
|
||||
<ForcedInstallation>true</ForcedInstallation>
|
||||
<Script>installscript.js</Script>
|
||||
<ReleaseDate>2018-08-25</ReleaseDate>
|
||||
<SortingPriority>201</SortingPriority>
|
||||
<Translations>
|
||||
<Translation>ru.qm</Translation>
|
||||
</Translations>
|
||||
</Package>
|
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>installscript</name>
|
||||
<message>
|
||||
<location filename="installscript.js" line="10"/>
|
||||
<source>Installer</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="installscript.js" line="11"/>
|
||||
<source>This package contains information of installer</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
@ -1,67 +0,0 @@
|
||||
function Component()
|
||||
{
|
||||
generateTr();
|
||||
}
|
||||
|
||||
function generateTr() {
|
||||
component.setValue("DisplayName", qsTr("Snake"));
|
||||
component.setValue("Description", qsTr("This package contains Snake"));
|
||||
}
|
||||
|
||||
|
||||
Component.prototype.createOperations = function()
|
||||
{
|
||||
// call default implementation to actually install README.txt!
|
||||
component.createOperations();
|
||||
|
||||
if (!component.isUninstalled()) {
|
||||
console.log("remove icons!!!");
|
||||
|
||||
if (systemInfo.kernelType === "winnt") {
|
||||
console.log("create icons!!! on Windows");
|
||||
component.addOperation("Delete",
|
||||
"@DesktopDir@/@Name@.lnk");
|
||||
}
|
||||
|
||||
console.log("remove icons!!!");
|
||||
|
||||
if (systemInfo.kernelType === "linux") {
|
||||
|
||||
console.log("create icons!!! on LINUX");
|
||||
component.addOperation("Delete",
|
||||
"@HomeDir@/.local/share/applications/@Name@.desktop");
|
||||
component.addOperation("Delete",
|
||||
"@HomeDir@/Desktop/@Name@.desktop");
|
||||
|
||||
console.log("remove icons!!! on LINUX done");
|
||||
}
|
||||
|
||||
} else {
|
||||
console.log("create icons!!!");
|
||||
|
||||
if (systemInfo.kernelType === "winnt") {
|
||||
|
||||
console.log("create icons!!! on Windows");
|
||||
component.addOperation("CreateShortcut",
|
||||
"@TargetDir@/snake.exe",
|
||||
"@DesktopDir@/@Name@.lnk");
|
||||
}
|
||||
|
||||
console.log("create icons!!!");
|
||||
|
||||
if (systemInfo.kernelType === "linux") {
|
||||
console.log("create icons!!! on LINUX");
|
||||
component.addOperation("CreateDesktopEntry",
|
||||
"@HomeDir@/.local/share/applications/@Name@.desktop",
|
||||
"Version=@Version@\n
|
||||
Type=Application\n
|
||||
Terminal=false\n
|
||||
Exec=@TargetDir@/snake.sh\n
|
||||
Name=@Name@\n
|
||||
Icon=@TargetDir@/logo.png\n
|
||||
Name[en_US]=@Name@");
|
||||
|
||||
console.log("create icons!!! on LINUX done");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<Package>
|
||||
<DisplayName>Snake</DisplayName>
|
||||
<Description>Snake</Description>
|
||||
<Version>1.0.0.1</Version>
|
||||
<Default>true</Default>
|
||||
<ForcedInstallation>false</ForcedInstallation>
|
||||
<Script>installscript.js</Script>
|
||||
<ReleaseDate>2018-08-25</ReleaseDate>
|
||||
<SortingPriority>200</SortingPriority>
|
||||
<Translations>
|
||||
<Translation>ru.qm</Translation>
|
||||
</Translations>
|
||||
</Package>
|
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>installscript</name>
|
||||
<message>
|
||||
<location filename="installscript.js" line="7"/>
|
||||
<source>Snake</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="installscript.js" line="8"/>
|
||||
<source>This package contains Snake</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
Loading…
x
Reference in New Issue
Block a user