├── Example ├── data │ └── main.png ├── qpmx.json ├── main.cpp ├── example_de.ts ├── meta │ └── package.xml ├── config.xml └── Example.pro ├── installer ├── translations │ ├── lrelease.sh │ ├── lupdate.sh │ ├── template.ts │ ├── zh.ts │ ├── ja.ts │ ├── ar.ts │ ├── pt.ts │ ├── es.ts │ ├── ru.ts │ ├── it.ts │ ├── fr.ts │ └── de.ts ├── packages │ ├── com.microsoft.vcredist │ │ └── meta │ │ │ ├── install.js │ │ │ └── package.xml │ └── de.skycoder42.advancedsetup │ │ ├── data │ │ └── regSetUninst.bat │ │ └── meta │ │ ├── ShortcutPage.ui │ │ ├── package.xml │ │ ├── LICENSE.txt │ │ ├── install.js │ │ └── UserPage.ui ├── config │ ├── config_template.xml │ └── controller.js ├── build.py └── installer.pri ├── qpm.json ├── get_linuxdeployqt_compat.sh ├── qpmx.json ├── .gitignore ├── deploy ├── deploy.pri └── deploy.py ├── LICENSE ├── qtifw-advanced-setup.pri └── README.md /Example/data/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Skycoder42/QtIFW-Advanced-Setup/HEAD/Example/data/main.png -------------------------------------------------------------------------------- /installer/translations/lrelease.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | lrelease -compress -nounfinished ./*.ts 3 | mv *.qm ../packages/de.skycoder42.advancedsetup/meta/ 4 | -------------------------------------------------------------------------------- /Example/qpmx.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": [ 3 | ], 4 | "license": { 5 | "file": "", 6 | "name": "" 7 | }, 8 | "prcFile": "", 9 | "priFile": "", 10 | "priIncludes": [ 11 | ], 12 | "publishers": { 13 | }, 14 | "source": false 15 | } 16 | -------------------------------------------------------------------------------- /installer/translations/lupdate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | lupdate -locations relative -no-obsolete ../config/controller.js ../packages/de.skycoder42.advancedsetup/meta/install.js ../packages/de.skycoder42.advancedsetup/meta/ShortcutPage.ui ../packages/de.skycoder42.advancedsetup/meta/UserPage.ui ./dummy.js -ts ./template.ts ./de.ts 3 | -------------------------------------------------------------------------------- /Example/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char **argv) 5 | { 6 | QApplication a(argc, argv); 7 | return QMessageBox::information(nullptr, 8 | QCoreApplication::translate("GLOBAL", "Example"), 9 | QCoreApplication::translate("GLOBAL", "Hello World!")); 10 | } 11 | -------------------------------------------------------------------------------- /Example/example_de.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | GLOBAL 6 | 7 | 8 | Example 9 | Beispiel 10 | 11 | 12 | 13 | Hello World! 14 | Hallo Welt! 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /installer/packages/com.microsoft.vcredist/meta/install.js: -------------------------------------------------------------------------------- 1 | function Component(){} 2 | 3 | Component.prototype.createOperations = function() 4 | { 5 | try { 6 | component.createOperations(); 7 | if (installer.value("os") === "win") { 8 | var vcpath = "@TargetDir@/" + vcname(); 9 | //install visual studio redistributables and delete the file right after 10 | component.addElevatedOperation("Execute", vcpath, "/quiet", "/norestart"); 11 | component.addOperation("Delete", vcpath); 12 | } 13 | } catch (e) { 14 | print(e); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Example/meta/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | QtIFW-Advanced Example User Files 4 | An example for a component you can add. 5 | QtIFW-Advanced Beispiel Benutzer-Dateien 6 | Ein Beispiel für eine Komponente, die Sie hinzufügen können. 7 | 1.0.0 8 | 2016-01-01 9 | true 10 | true 11 | 12 | -------------------------------------------------------------------------------- /qpm.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "email": "skycoder42.de@gmx.de", 4 | "name": "Skycoder" 5 | }, 6 | "dependencies": [ 7 | ], 8 | "description": "Create \"Qt Installer Framework\" installers from your project via qmake", 9 | "license": "BSD_3_CLAUSE", 10 | "name": "de.skycoder42.qtifw-advanced-setup", 11 | "pri_filename": "qtifw-advanced-setup.pri", 12 | "repository": { 13 | "type": "GITHUB", 14 | "url": "https://github.com/Skycoder42/QtIFW-Advanced-Setup.git" 15 | }, 16 | "version": { 17 | "fingerprint": "", 18 | "label": "2.1.2", 19 | "revision": "" 20 | }, 21 | "webpage": "https://github.com/Skycoder42/QtIFW-Advanced-Setup" 22 | } 23 | -------------------------------------------------------------------------------- /installer/packages/de.skycoder42.advancedsetup/data/regSetUninst.bat: -------------------------------------------------------------------------------- 1 | :: %1: guid 2 | :: %2: maintanancetool path 3 | :: %3: base_key 4 | :: %4: 0: offline; 1: online 5 | @echo off 6 | 7 | :: check which node has to be updated 8 | reg query "%~3\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\%~1" 9 | IF "%errorlevel%" == "0" ( 10 | set baseKey=WOW6432Node\Microsoft 11 | ) ELSE ( 12 | set baseKey=Microsoft 13 | ) 14 | 15 | :: Update the entry. The way depends on online or offline installer 16 | IF "%~4" == "0" ( 17 | reg add "%~3\SOFTWARE\%baseKey%\Windows\CurrentVersion\Uninstall\%~1" /f /v "NoModify" /t REG_DWORD /d 1 18 | ) ELSE ( 19 | reg add "%~3\SOFTWARE\%baseKey%\Windows\CurrentVersion\Uninstall\%~1" /f /v "UninstallString" /t REG_SZ /d "%~2 uninstallOnly=1" 20 | ) 21 | 22 | :: Self-Delete 23 | del "%~f0" 24 | -------------------------------------------------------------------------------- /get_linuxdeployqt_compat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo this script will install linuxdeployqt into your Qt installation directory. It is required to get linuxdeployqt working with qtifw-advanced-setup 4 | read unused 5 | 6 | echo please enter the path to qmake to be used [$(which qmake)]: 7 | read rqmake 8 | if [ -z "$rqmake" ]; then 9 | rqmake="qmake" 10 | fi 11 | 12 | qt_bins=$("$rqmake" -query QT_INSTALL_BINS) 13 | 14 | cd $(mktemp -d) 15 | git clone https://github.com/probonopd/linuxdeployqt.git -b continuous 16 | cd linuxdeployqt 17 | 18 | "$rqmake" 19 | make qmake_all 20 | make 21 | $1 make install 22 | 23 | if [ $? == 0 ]; then 24 | echo 25 | echo 26 | echo install successfull! 27 | else 28 | echo 29 | echo 30 | echo install failed, propably because of missing permissions. Try to call the script with sudo as first parameter: \"$(basename $0) sudo\" 31 | fi 32 | -------------------------------------------------------------------------------- /Example/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | QtIFW-Advanced Sample 4 | 1.0.0 5 | QtIFW-Advanced Sample Installer 6 | Sykcoder42 7 | https://github.com/Skycoder42/QtIFW-Advanced-Setup 8 | QtIFW-Advanced Sample 9 | QtIFW-Advanced Sample 10 | Example 11 | true 12 | true 13 | 14 | 15 | example.com/download/QtIFW-Advanced Sample 16 | 1 17 | QtIFW-Advanced Sample Online Repository 18 | 19 | 20 | controller.js 21 | 22 | -------------------------------------------------------------------------------- /installer/config/config_template.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1.0.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | true 12 | true 13 | 14 | 21 | controller.js 22 | 23 | -------------------------------------------------------------------------------- /installer/packages/de.skycoder42.advancedsetup/meta/ShortcutPage.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ShortcutPage 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Create Desktop Shortcut 15 | 16 | 17 | 18 | 19 | 20 | Create Desktop &Shortcut 21 | 22 | 23 | true 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /qpmx.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": [ 3 | ], 4 | "license": { 5 | "file": "LICENSE", 6 | "name": "BSD_3_CLAUSE" 7 | }, 8 | "prcFile": "qtifw-advanced-setup.pri", 9 | "priFile": "qtifw-advanced-setup.pri", 10 | "priIncludes": [ 11 | ], 12 | "publishers": { 13 | "qpm": { 14 | "author": { 15 | "email": "skycoder42.de@gmx.de", 16 | "name": "Skycoder" 17 | }, 18 | "description": "Create \"Qt Installer Framework\" installers from your project via qmake", 19 | "name": "de.skycoder42.qtifw-advanced-setup", 20 | "repository": { 21 | "type": "GITHUB", 22 | "url": "https://github.com/Skycoder42/QtIFW-Advanced-Setup.git" 23 | }, 24 | "webpage": "https://github.com/Skycoder42/QtIFW-Advanced-Setup" 25 | } 26 | }, 27 | "source": false 28 | } 29 | -------------------------------------------------------------------------------- /installer/packages/de.skycoder42.advancedsetup/meta/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | QtIFW-Advanced attatchments 4 | A component to provide the advanced installer features 5 | 1.1.0 6 | 2017-05-20 7 | 8 | 9 | ShortcutPage.ui 10 | UserPage.ui 11 | 12 | 13 | ar.qm 14 | de.qm 15 | es.qm 16 | fr.qm 17 | it.qm 18 | ja.qm 19 | pt.qm 20 | ru.qm 21 | zh.qm 22 | 23 | 24 | 25 | 26 | true 27 | true 28 | 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.qm 14 | *.so 15 | *.so.* 16 | *_pch.h.cpp 17 | *_resource.rc 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | *build-* 38 | 39 | # qtcreator generated files 40 | *.pro.user* 41 | 42 | # xemacs temporary files 43 | *.flc 44 | 45 | # Vim temporary files 46 | .*.swp 47 | 48 | # Visual Studio generated files 49 | *.ib_pdb_index 50 | *.idb 51 | *.ilk 52 | *.pdb 53 | *.sln 54 | *.suo 55 | *.vcproj 56 | *vcproj.*.*.user 57 | *.ncb 58 | *.sdf 59 | *.opensdf 60 | *.vcxproj 61 | *vcxproj.* 62 | 63 | # MinGW generated files 64 | *.Debug 65 | *.Release 66 | 67 | # Python byte code 68 | *.pyc 69 | 70 | # Binaries 71 | # -------- 72 | *.dll 73 | *.exe 74 | 75 | # qpm 76 | vendor 77 | -------------------------------------------------------------------------------- /installer/packages/com.microsoft.vcredist/meta/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Microsoft Visual C++ Redistributable 4 | Installs the Visual C++ redistributables 5 | تثبيت فيسوال C ++ ريديستريبوتابلز 6 | Installiert die Visual C ++ - Redistributables 7 | Instala los redistribuibles de Visual C ++ 8 | Installe les redistribuables Visual C ++ 9 | Installa i redistributabili di Visual C ++ 10 | Visual C ++再配布可能ファイルをインストールします。 11 | Microsoft Visual C ++ Redistributable 12 | Устанавливает распространяемые компоненты Visual C ++ 13 | 安装Visual C ++可重新分发 14 | 14.0.24215 15 | -10 16 | 2016-10-23 17 | 18 | true 19 | 20 | -------------------------------------------------------------------------------- /deploy/deploy.pri: -------------------------------------------------------------------------------- 1 | DISTFILES += \ 2 | $$PWD/deploy.py 3 | 4 | isEmpty(qtifw_deploy_target.files) { 5 | !isEmpty(TARGET_EXT): qtifw_deploy_target.files = "$${TARGET}$${TARGET_EXT}" 6 | else:win32: qtifw_deploy_target.files = "$${TARGET}.exe" 7 | else:mac:app_bundle: qtifw_deploy_target.files = "$${TARGET}.app" 8 | else: qtifw_deploy_target.files = "$$TARGET" 9 | } 10 | isEmpty(qtifw_deploy_target.path): qtifw_deploy_target.path = $${target.path} 11 | 12 | !isEmpty(qtifw_deploy_target.path) { 13 | DEPLOY_PATH = $(INSTALL_ROOT)$${qtifw_deploy_target.path} 14 | 15 | linux: QTIFW_DEPLOY_ARGS = linux 16 | else:win32:CONFIG(release, debug|release): QTIFW_DEPLOY_ARGS = win_release 17 | else:win32:CONFIG(debug, debug|release): QTIFW_DEPLOY_ARGS = win_debug 18 | else:mac: QTIFW_DEPLOY_ARGS = mac 19 | else: QTIFW_DEPLOY_ARGS = unknown 20 | 21 | QTIFW_DEPLOY_ARGS += $$shell_quote($$[QT_INSTALL_BINS]) 22 | QTIFW_DEPLOY_ARGS += $$shell_quote($$[QT_INSTALL_PLUGINS]) 23 | QTIFW_DEPLOY_ARGS += $$shell_quote($$[QT_INSTALL_TRANSLATIONS]) 24 | QTIFW_DEPLOY_ARGS += $$shell_quote($$DEPLOY_PATH) 25 | for(file, qtifw_deploy_target.files): QTIFW_DEPLOY_ARGS += $$shell_quote($$file) 26 | !isEmpty(QTIFW_QM_DEPS): QTIFW_DEPLOY_ARGS += "==" $$QTIFW_QM_DEPS 27 | 28 | qtifw_deploy.target = deploy 29 | win32: qtifw_deploy.commands = python 30 | qtifw_deploy.commands += $$shell_quote($$shell_path($$PWD/deploy.py)) $$QTIFW_DEPLOY_ARGS 31 | 32 | QMAKE_EXTRA_TARGETS += qtifw_deploy 33 | } 34 | -------------------------------------------------------------------------------- /Example/Example.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | QT += widgets 3 | 4 | TARGET = Example 5 | 6 | SOURCES += \ 7 | main.cpp 8 | 9 | DISTFILES += \ 10 | config.xml \ 11 | meta/package.xml \ 12 | data/main.png \ 13 | example_de.ts 14 | 15 | TRANSLATIONS += example_de.ts 16 | 17 | # enable the "qtifw" target to automatically make lrelease, install, deploy, installer and qtifw-compress 18 | CONFIG += qtifw_target qtifw_auto_ts 19 | 20 | # make install build products 21 | target.path = /packages/de.skycoder42.qtifw-sample/data 22 | qpmx_ts_target.path = /packages/de.skycoder42.qtifw-sample/data/translations 23 | INSTALLS += target qpmx_ts_target 24 | 25 | # deployment is prepared automatically because target.path is defined: 26 | # qtifw_deploy_target.path = $${target.path} 27 | 28 | # make install installer stuff 29 | # CONFIG += qtifw_install_targets ## is set automatically because of CONFIG += qtifw_target 30 | install_pkg.files += data meta 31 | install_pkg.path = /packages/de.skycoder42.qtifw-sample 32 | install_cfg.files = config.xml 33 | install_cfg.path = /config 34 | INSTALLS += install_pkg install_cfg 35 | # QTIFW_MODE = online_all 36 | 37 | include(../qtifw-advanced-setup.pri) 38 | 39 | !ReleaseBuild:!DebugBuild:!system(qpmx -d $$shell_quote($$_PRO_FILE_PWD_) --qmake-run init $$QPMX_EXTRA_OPTIONS $$shell_quote($$QMAKE_QMAKE) $$shell_quote($$OUT_PWD)): error(qpmx initialization failed. Check the compilation log for details.) 40 | else: include($$OUT_PWD/qpmx_generated.pri) 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Felix Barz 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of QtIFW-Advanced-Setup nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /installer/packages/de.skycoder42.advancedsetup/meta/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Felix Barz 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of QtIFW-Advanced-Setup nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /qtifw-advanced-setup.pri: -------------------------------------------------------------------------------- 1 | !qpmx_static { 2 | qtifw_target: CONFIG *= qtifw_install_targets 3 | 4 | include($$PWD/deploy/deploy.pri) 5 | include($$PWD/installer/installer.pri) 6 | 7 | qtifw_install_compress.target = qtifw-compress 8 | QMAKE_EXTRA_TARGETS += qtifw_install_compress 9 | equals(QTIFW_MODE, repository)|equals(QTIFW_MODE, online_all) { #deploy repository 10 | target_c_rep.target = target_c_rep 11 | QMAKE_EXTRA_TARGETS += target_c_rep 12 | qtifw_install_compress.depends += target_c_rep 13 | 14 | win32: QTIFW_REPO_NAME = ../repository_win.zip 15 | else:mac: QTIFW_REPO_NAME = ../repository_mac.tar.xz 16 | else: QTIFW_REPO_NAME = ../repository_linux.tar.xz 17 | 18 | target_c_rep.commands = cd $$shell_path($(INSTALL_ROOT)/repository) && 19 | win32: target_c_rep.commands += 7z a $$shell_path($$QTIFW_REPO_NAME) .\* 20 | else: target_c_rep.commands += tar cJf $$QTIFW_REPO_NAME ./* 21 | } 22 | 23 | !equals(QTIFW_MODE, repository):mac { #deploy installer binary 24 | target_c_mac.target = target_c_mac 25 | QMAKE_EXTRA_TARGETS += target_c_mac 26 | qtifw_install_compress.depends += target_c_mac 27 | 28 | target_c_mac.commands = cd $(INSTALL_ROOT) && \ 29 | zip -r -9 $$shell_quote($${QTIFW_TARGET}$${QTIFW_TARGET_EXT}.zip) $$shell_quote($${QTIFW_TARGET}$${QTIFW_TARGET_EXT}) 30 | } 31 | 32 | qtifw_target { 33 | qtifw_auto_ts { 34 | install.depends += lrelease 35 | QMAKE_EXTRA_TARGETS += install 36 | } 37 | !qtifw_deploy_no_install: qtifw_deploy.depends += install 38 | qtifw_inst.depends += deploy 39 | qtifw_install_compress.depends += installer 40 | target_c_rep.depends = installer 41 | target_c_mac.depends = installer 42 | 43 | qtifwtarget.target = qtifw 44 | qtifwtarget.depends += installer 45 | !qtifw_no_compress: qtifwtarget.depends += qtifw-compress 46 | 47 | QMAKE_EXTRA_TARGETS += qtifwtarget 48 | 49 | qtifw_build_target.target = qtifw-build 50 | qtifw_build_target.depends += FORCE 51 | qtifw_build_target.commands += $$QMAKE_MKDIR $$shell_quote($$shell_path($$OUT_PWD\qtifw-build)) \ 52 | $$escape_expand(\n\t)@$(MAKE) $$shell_quote(INSTALL_ROOT=$$shell_path($$OUT_PWD/qtifw-build)) qtifw 53 | QMAKE_EXTRA_TARGETS += qtifw_build_target 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /installer/packages/de.skycoder42.advancedsetup/meta/install.js: -------------------------------------------------------------------------------- 1 | function Component() 2 | { 3 | //save the binary name 4 | installer.setValue("BinaryName", installer.value("RunProgram")); 5 | 6 | //check if architecture is supported 7 | if(!testArch()) 8 | return; 9 | 10 | //add custom pages (installer only) 11 | if(installer.isInstaller()) { 12 | installer.addWizardPage(component, "UserPage", QInstaller.TargetDirectory); 13 | if (installer.value("os") === "win")// only windows -> desktop shortcut 14 | installer.addWizardPage(component, "ShortcutPage", QInstaller.ReadyForInstallation); 15 | } 16 | } 17 | 18 | Component.prototype.createOperations = function() 19 | { 20 | //update RunProgram, depending on the os 21 | if (installer.value("os") === "win") { 22 | installer.setValue("RunProgram", "@TargetDir@/@BinaryName@"); 23 | } else if(installer.value("os") === "mac") { 24 | installer.setValue("RunProgram", "@TargetDir@/Contents/MacOS/@BinaryName@"); 25 | } else if(installer.value("os") === "x11") { 26 | installer.setValue("RunProgram", "@TargetDir@/@BinaryName@"); 27 | } 28 | 29 | try { 30 | component.createOperations(); 31 | 32 | if (installer.value("os") === "win") { 33 | //win -> add startmenu shortcuts 34 | component.addOperation("CreateShortcut", "@RunProgram@.exe", "@StartMenuDir@/@Name@.lnk"); 35 | if(installer.isOfflineOnly()) 36 | component.addOperation("CreateShortcut", "@TargetDir@/@MaintenanceToolName@.exe", "@StartMenuDir@/Uninstall.lnk"); 37 | else { 38 | component.addOperation("CreateShortcut", "@TargetDir@/@MaintenanceToolName@.exe", "@StartMenuDir@/@MaintenanceToolName@.lnk"); 39 | component.addOperation("CreateShortcut", "@TargetDir@/@MaintenanceToolName@.exe", "@StartMenuDir@/ManagePackages.lnk", "--manage-packages"); 40 | component.addOperation("CreateShortcut", "@TargetDir@/@MaintenanceToolName@.exe", "@StartMenuDir@/Update.lnk", "--updater"); 41 | component.addOperation("CreateShortcut", "@TargetDir@/@MaintenanceToolName@.exe", "@StartMenuDir@/Uninstall.lnk", "uninstallOnly=1"); 42 | } 43 | 44 | //... and desktop shortcut (if requested) 45 | var pageWidget = gui.pageWidgetByObjectName("DynamicShortcutPage"); 46 | if (pageWidget !== null && pageWidget.shortcutCheckBox.checked) 47 | component.addOperation("CreateShortcut", "@RunProgram@.exe", "@DesktopDir@/@Name@.lnk"); 48 | } else if (installer.value("os") === "x11") { 49 | //x11 -> create .desktop file 50 | component.addOperation("CreateDesktopEntry", 51 | "@BinaryName@.desktop", 52 | "Version=1.1\nType=Application\nTerminal=false\nExec=@RunProgram@\nName=@Name@\nIcon=@TargetDir@/main.png"); 53 | } 54 | } catch (e) { 55 | print(e); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /installer/packages/de.skycoder42.advancedsetup/meta/UserPage.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | UserPage 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Installation Scope 15 | 16 | 17 | 18 | 3 19 | 20 | 21 | 22 | 23 | 24 | 75 25 | true 26 | 27 | 28 | 29 | Install for all users 30 | 31 | 32 | true 33 | 34 | 35 | 36 | 37 | 38 | 39 | The application will be installed for all users on this machine. You require elevated privileges for this installation. If you did not start the installer with elevated rights, this option will not be available. Please restart the installer with elevated rights (Admin on windows, root an linux/mac) to install for all users. 40 | 41 | 42 | true 43 | 44 | 45 | 25 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 75 54 | true 55 | 56 | 57 | 58 | Install just for me 59 | 60 | 61 | 62 | 63 | 64 | 65 | The application will be installed for you only. You should choose a location only you can access for the installation. If you choose one you do not have rights for, you will be prompted to elevate. The installation however will still be for you only. 66 | 67 | 68 | true 69 | 70 | 71 | 25 72 | 73 | 74 | 75 | 76 | 77 | 78 | Qt::Vertical 79 | 80 | 81 | 82 | 20 83 | 40 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /installer/translations/template.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ShortcutPage 6 | 7 | 8 | Create Desktop Shortcut 9 | 10 | 11 | 12 | 13 | Create Desktop &Shortcut 14 | 15 | 16 | 17 | 18 | UserPage 19 | 20 | 21 | Installation Scope 22 | 23 | 24 | 25 | 26 | Install for all users 27 | 28 | 29 | 30 | 31 | The application will be installed for all users on this machine. You require elevated privileges for this installation. If you did not start the installer with elevated rights, this option will not be available. Please restart the installer with elevated rights (Admin on windows, root an linux/mac) to install for all users. 32 | 33 | 34 | 35 | 36 | Install just for me 37 | 38 | 39 | 40 | 41 | The application will be installed for you only. You should choose a location only you can access for the installation. If you choose one you do not have rights for, you will be prompted to elevate. The installation however will still be for you only. 42 | 43 | 44 | 45 | 46 | controller 47 | 48 | 49 | Error 50 | 51 | 52 | 53 | 54 | The installation was done by an admin/root. Please restart %1 with elevated rights. 55 | 56 | 57 | 58 | 59 | dummy 60 | 61 | 62 | Error 63 | 64 | 65 | 66 | 67 | This Program is a 64bit Program. You can't install it on a 32bit machine 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /installer/translations/zh.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ShortcutPage 6 | 7 | 8 | Create Desktop Shortcut 9 | 创建桌面快捷方式 10 | 11 | 12 | 13 | Create Desktop &Shortcut 14 | 创建桌面快捷方式 15 | 16 | 17 | 18 | UserPage 19 | 20 | 21 | Installation Scope 22 | 安装范围 23 | 24 | 25 | 26 | Install for all users 27 | 为所有用户安装 28 | 29 | 30 | 31 | The application will be installed for all users on this machine. You require elevated privileges for this installation. If you did not start the installer with elevated rights, this option will not be available. Please restart the installer with elevated rights (Admin on windows, root an linux/mac) to install for all users. 32 | 该应用程序将安装在此机器上的所有用户。您需要此安装的提升权限。如果您没有启动具有提升权限的安装程序,则此选项将不可用。请重新启动安装程序,以提升权限(Windows上的管理员,root用户/ linux / mac)为所有用户安装。 33 | 34 | 35 | 36 | Install just for me 37 | 只为我安装 38 | 39 | 40 | 41 | The application will be installed for you only. You should choose a location only you can access for the installation. If you choose one you do not have rights for, you will be prompted to elevate. The installation however will still be for you only. 42 | 该应用程序将仅为您安装。您应该选择一个只能访问安装的位置。如果你选择一个你没有权限,你会被提示提升。然而,安装仍然只适用于您。 43 | 44 | 45 | 46 | controller 47 | 48 | 49 | Error 50 | 错误 51 | 52 | 53 | 54 | The installation was done by an admin/root. Please restart %1 with elevated rights. 55 | 安装由admin / root完成。请重新启动带有提升权限的%1。 56 | 57 | 58 | 59 | install 60 | 61 | 62 | Error 63 | 错误 64 | 65 | 66 | 67 | This Program is a 64bit Program. You can't install it on a 32bit machine 68 | 这个程序是一个64位程序。您无法将其安装在32位计算机上 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /installer/translations/ja.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ShortcutPage 6 | 7 | 8 | Create Desktop Shortcut 9 | デスクトップショートカットを作成します 10 | 11 | 12 | 13 | Create Desktop &Shortcut 14 | デスクトップショートカットを作成します 15 | 16 | 17 | 18 | UserPage 19 | 20 | 21 | Installation Scope 22 | インストール範囲 23 | 24 | 25 | 26 | Install for all users 27 | すべてのユーザー用にインストールする 28 | 29 | 30 | 31 | The application will be installed for all users on this machine. You require elevated privileges for this installation. If you did not start the installer with elevated rights, this option will not be available. Please restart the installer with elevated rights (Admin on windows, root an linux/mac) to install for all users. 32 | このマシン上のすべてのユーザーに対してアプリケーションがインストールされます。このインストールには昇格された権限が必要です。権限を昇格してインストーラを起動しなかった場合、このオプションは使用できません。すべてのユーザにインストールするには、権限を昇格したインストーラを再起動してください(Windowsの場合はAdmin、rootの場合はlinux / mac)。 33 | 34 | 35 | 36 | Install just for me 37 | 私だけのためにインストールします 38 | 39 | 40 | 41 | The application will be installed for you only. You should choose a location only you can access for the installation. If you choose one you do not have rights for, you will be prompted to elevate. The installation however will still be for you only. 42 | アプリケーションはあなた専用にインストールされます。インストールのためにアクセスできる場所のみを選択する必要があります。あなたが権利を持っていない人物を選択すると、昇格を促すメッセージが表示されます。しかし、インストールはまだあなたのためだけになります。 43 | 44 | 45 | 46 | controller 47 | 48 | 49 | Error 50 | エラー 51 | 52 | 53 | 54 | The installation was done by an admin/root. Please restart %1 with elevated rights. 55 | インストールはadmin / rootによって行われました。高い権限で %1 を再起動してください。 56 | 57 | 58 | 59 | install 60 | 61 | 62 | Error 63 | エラー 64 | 65 | 66 | 67 | This Program is a 64bit Program. You can't install it on a 32bit machine 68 | このプログラムは64ビットプログラムです。 32ビットマシンにはインストールできません 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /installer/translations/ar.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ShortcutPage 6 | 7 | 8 | Create Desktop Shortcut 9 | إنشاء اختصار سطح المكتب 10 | 11 | 12 | 13 | Create Desktop &Shortcut 14 | إنشاء اختصار سطح المكتب 15 | 16 | 17 | 18 | UserPage 19 | 20 | 21 | Installation Scope 22 | نطاق التثبيت 23 | 24 | 25 | 26 | Install for all users 27 | تثبيت لجميع المستخدمين 28 | 29 | 30 | 31 | The application will be installed for all users on this machine. You require elevated privileges for this installation. If you did not start the installer with elevated rights, this option will not be available. Please restart the installer with elevated rights (Admin on windows, root an linux/mac) to install for all users. 32 | سيتم تثبيت التطبيق لجميع المستخدمين على هذا الجهاز. تحتاج إلى امتيازات مرتفعة لهذا التثبيت. إذا لم تبدأ المثبت مع حقوق مرتفعة، فلن يكون هذا الخيار متاحا. يرجى إعادة تشغيل المثبت مع حقوق مرتفعة (المشرف على ويندوز، الجذر لينكس / ماك) لتثبيت لجميع المستخدمين. 33 | 34 | 35 | 36 | Install just for me 37 | تثبيت فقط بالنسبة لي 38 | 39 | 40 | 41 | The application will be installed for you only. You should choose a location only you can access for the installation. If you choose one you do not have rights for, you will be prompted to elevate. The installation however will still be for you only. 42 | سيتم تثبيت التطبيق بالنسبة لك فقط. يجب عليك اختيار موقع فقط يمكنك الوصول للتثبيت. إذا اخترت واحدة لم يكن لديك حقوق ل، سوف يطلب منك رفع. ومع ذلك فإن التثبيت لا يزال بالنسبة لك فقط. 43 | 44 | 45 | 46 | controller 47 | 48 | 49 | Error 50 | خطأ 51 | 52 | 53 | 54 | The installation was done by an admin/root. Please restart %1 with elevated rights. 55 | تم التثبيت من قبل المشرف / الجذر. الرجاء إعادة تشغيل%1 مع حقوق مرتفعة. 56 | 57 | 58 | 59 | install 60 | 61 | 62 | Error 63 | خطأ 64 | 65 | 66 | 67 | This Program is a 64bit Program. You can't install it on a 32bit machine 68 | هذا البرنامج هو برنامج 64BIT. لا يمكنك تثبيته على جهاز 32BIT 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /installer/build.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import sys 4 | import os 5 | import shutil 6 | import subprocess 7 | import re 8 | import glob 9 | from distutils.dir_util import copy_tree 10 | from enum import Enum 11 | 12 | # constants 13 | outdir = sys.argv[1] 14 | qtifwdir = sys.argv[2] 15 | target = sys.argv[3] 16 | 17 | mode = sys.argv[4] 18 | platform = sys.argv[5] 19 | arch = sys.argv[6] 20 | 21 | cfgdir = os.path.join(outdir, "config") 22 | pkgdir = os.path.join(outdir, "packages") 23 | 24 | subTDir = "" 25 | 26 | def prepend_file_data(filename, data): 27 | with open(filename, "r+") as file: 28 | orig = file.read() 29 | file.seek(0) 30 | file.write(data) 31 | file.write(orig) 32 | 33 | def mac_move_data(): 34 | for app_root in glob.glob(os.path.join(pkgdir, "*", "data", "*.app")): 35 | print("Correcting installation of app", app_root) 36 | cont_dir = os.path.join(os.path.dirname(app_root), "Contents") 37 | if os.path.isdir(cont_dir): 38 | shutil.rmtree(cont_dir) 39 | os.rename(os.path.join(app_root, "Contents"), cont_dir) 40 | os.rmdir(app_root) 41 | 42 | def config_arch(): 43 | #adjust install js 44 | data = "" 45 | if arch == "x64": 46 | data = "function testArch() {\n" 47 | data += "\tif(systemInfo.currentCpuArchitecture.search(\"64\") < 0) {\n" 48 | data += "\t\tQMessageBox.critical(\"de.skycoder42.advanced-setup.not64\", qsTr(\"Error\"), qsTr(\"This Program is a 64bit Program. You can't install it on a 32bit machine\"));\n" 49 | data += "\t\tgui.rejectWithoutPrompt();\n" 50 | data += "\t\treturn false;\n" 51 | data += "\t} else\n" 52 | data += "\t\treturn true;\n" 53 | data += "}\n\n" 54 | else: 55 | data = "function testArch() {\n" 56 | data += "\treturn true;\n" 57 | data += "}\n\n" 58 | prepend_file_data(os.path.join(pkgdir, "de.skycoder42.advancedsetup", "meta", "install.js"), data) 59 | 60 | #adjust vcredist (if existing) 61 | msvc_dir = os.path.join(pkgdir, "com.microsoft.vcredist." + arch) 62 | msvc_data_dir = os.path.join(msvc_dir, "data") 63 | if os.path.isdir(msvc_data_dir): 64 | files = os.listdir(msvc_data_dir) 65 | regex = re.compile(".*vcredist.*" + arch + ".*") 66 | vcfile = "" 67 | for file in files: 68 | if regex.match(file): 69 | vcfile = file 70 | else: 71 | os.remove(os.path.join(msvc_data_dir, file)) 72 | data = "function vcname() {\n" 73 | data += "\t return \"" + vcfile + "\";\n" 74 | data += "}\n\n" 75 | prepend_file_data(os.path.join(msvc_dir, "meta", "install.js"), data) 76 | 77 | def create_offline(): 78 | subprocess.run([ 79 | os.path.join(qtifwdir, "binarycreator"), 80 | "-f", 81 | "-c", 82 | os.path.join(cfgdir, "config.xml"), 83 | "-p", 84 | pkgdir, 85 | os.path.join(outdir, target) 86 | ], check=True) 87 | 88 | def create_online(): 89 | subprocess.run([ 90 | os.path.join(qtifwdir, "binarycreator"), 91 | "-n", 92 | "-c", 93 | os.path.join(cfgdir, "config.xml"), 94 | "-p", 95 | pkgdir, 96 | os.path.join(outdir, target) 97 | ], check=True) 98 | 99 | def create_repo(): 100 | subprocess.run([ 101 | os.path.join(qtifwdir, "repogen"), 102 | "-p", 103 | pkgdir, 104 | os.path.join(outdir, "repository", platform + "_" + arch) 105 | ], check=True) 106 | 107 | # mac: rename root app 108 | if platform == "mac": 109 | mac_move_data() 110 | # prepare & copy files 111 | config_arch() 112 | # generate installer 113 | if mode == "offline": 114 | create_offline() 115 | elif mode == "online": 116 | create_online() 117 | elif mode == "repository": 118 | create_repo() 119 | elif mode == "online_all": 120 | create_repo() 121 | create_online() 122 | else: 123 | raise Exception("Invalid mode specified: " + mode) 124 | -------------------------------------------------------------------------------- /deploy/deploy.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import sys 4 | import errno 5 | import os 6 | import shutil 7 | import glob 8 | import subprocess 9 | import re 10 | from distutils.dir_util import copy_tree 11 | from enum import Enum 12 | 13 | # arguments 14 | platform = sys.argv[1] 15 | bindir = sys.argv[2] 16 | plugindir = sys.argv[3] 17 | translationdir = sys.argv[4] 18 | deppath = sys.argv[5] 19 | try: 20 | tsindex = sys.argv.index("==") 21 | depfiles = sys.argv[6:tsindex] 22 | qmfiles = sys.argv[tsindex+1:] 23 | addts = False 24 | except ValueError: 25 | depfiles = sys.argv[6:] 26 | qmfiles = [] 27 | addts = True 28 | print(depfiles, qmfiles) 29 | 30 | transdir = "" 31 | if platform == "mac": 32 | transdir = os.path.join(deppath, depfiles[0], "Contents", "Resources", "translations") 33 | else: 34 | transdir = os.path.join(deppath, "translations") 35 | 36 | 37 | def rmsilent(path): 38 | if os.path.exists(path): 39 | os.remove(path) 40 | 41 | 42 | def rmtsilent(path): 43 | if os.path.exists(path): 44 | shutil.rmtree(path) 45 | 46 | 47 | def cpplugins(plg_type): 48 | if not os.path.isdir(os.path.join(deppath, "plugins", plg_type)): 49 | shutil.copytree(os.path.join(plugindir, plg_type), os.path.join(deppath, "plugins", plg_type)) 50 | 51 | 52 | def run_deptool(dependency): 53 | preparams = [] 54 | postparams = [] 55 | postcmds = [] 56 | if platform == "linux": 57 | preparams = [os.path.join(bindir, "linuxdeployqt")] 58 | postparams = [] 59 | if not addts: 60 | postparams.append("-no-translations") 61 | 62 | postcmds = [ 63 | lambda: rmsilent(os.path.join(deppath, "AppRun")), 64 | lambda: cpplugins("platformthemes"), 65 | lambda: cpplugins("xcbglintegrations") 66 | ] 67 | elif platform[0:3] == "win": 68 | preparams = [os.path.join(bindir, "windeployqt.exe")] 69 | if platform == "win_debug": 70 | preparams.append("-debug") 71 | elif platform == "win_release": 72 | preparams.append("-release") 73 | else: 74 | raise Exception("Unknown platform type: " + platform) 75 | 76 | if not addts: 77 | preparams.append("-no-translations") 78 | postcmds = [ 79 | lambda: rmsilent(os.path.join(deppath, "vcredist_x86.exe")), 80 | lambda: rmsilent(os.path.join(deppath, "vcredist_x64.exe")), 81 | lambda: rmsilent(os.path.join(deppath, "vc_redist.x86.exe")), 82 | lambda: rmsilent(os.path.join(deppath, "vc_redist.x64.exe")) 83 | ] 84 | elif platform == "mac": 85 | preparams = [os.path.join(bindir, "macdeployqt")] 86 | postparams = [] 87 | else: 88 | raise Exception("Unknown platform type: " + platform) 89 | 90 | subprocess.run(preparams + [os.path.join(deppath, dependency)] + postparams, check=True) 91 | for cmd in postcmds: 92 | cmd() 93 | 94 | 95 | def create_qm(qmbase): 96 | os.makedirs(transdir, exist_ok=True) 97 | for pattern in ["_??.qm", "_??_??.qm"]: 98 | for qmfile in glob.glob(os.path.join(translationdir, qmbase + pattern)): 99 | shutil.copy2(qmfile, transdir) 100 | 101 | 102 | def patch_qtconf(): 103 | if platform == "linux": 104 | return 105 | elif platform[0:3] == "win": 106 | file = open(os.path.join(deppath, "qt.conf"), "w") 107 | file.write("[Paths]\n") 108 | file.write("Prefix=.\n") 109 | file.write("Plugins=.\n") 110 | file.write("Libraries=.\n") 111 | file.close() 112 | elif platform == "mac": 113 | file = open(os.path.join(deppath, depfiles[0], "Contents", "Resources", "qt.conf"), "a") 114 | file.write("Translations=Resources/translations\n") 115 | file.close() 116 | else: 117 | raise Exception("Unknown platform type: " + platform) 118 | 119 | 120 | # run the deployment tools 121 | for dep in depfiles: 122 | run_deptool(dep) 123 | for qmbase in qmfiles: 124 | create_qm(qmbase) 125 | patch_qtconf() 126 | 127 | -------------------------------------------------------------------------------- /installer/translations/pt.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ShortcutPage 6 | 7 | 8 | Create Desktop Shortcut 9 | Criar atalho na área de trabalho 10 | 11 | 12 | 13 | Create Desktop &Shortcut 14 | Criar área de &trabalho e atalho 15 | 16 | 17 | 18 | UserPage 19 | 20 | 21 | Installation Scope 22 | Âmbito da Instalação 23 | 24 | 25 | 26 | Install for all users 27 | Instalar para todos os usuários 28 | 29 | 30 | 31 | The application will be installed for all users on this machine. You require elevated privileges for this installation. If you did not start the installer with elevated rights, this option will not be available. Please restart the installer with elevated rights (Admin on windows, root an linux/mac) to install for all users. 32 | O aplicativo será instalado para todos os usuários nesta máquina. Você precisa de privilégios elevados para esta instalação. Se você não iniciou o instalador com direitos elevados, esta opção não estará disponível. Reinicie o instalador com direitos elevados (Admin no Windows, root um linux / mac) para instalar para todos os usuários. 33 | 34 | 35 | 36 | Install just for me 37 | Instale só para mim 38 | 39 | 40 | 41 | The application will be installed for you only. You should choose a location only you can access for the installation. If you choose one you do not have rights for, you will be prompted to elevate. The installation however will still be for you only. 42 | O aplicativo será instalado somente para você. Você deve escolher um local somente que você pode acessar para a instalação. Se você escolher um que você não tem direitos para, você será solicitado a elevar. A instalação no entanto ainda será para você apenas. 43 | 44 | 45 | 46 | controller 47 | 48 | 49 | Error 50 | Erro 51 | 52 | 53 | 54 | The installation was done by an admin/root. Please restart %1 with elevated rights. 55 | A instalação foi feita por um admin / root. Reinicie %1 com direitos elevados. 56 | 57 | 58 | 59 | install 60 | 61 | 62 | Error 63 | Erro 64 | 65 | 66 | 67 | This Program is a 64bit Program. You can't install it on a 32bit machine 68 | Este programa é um programa de 64 bits. Você não pode instalá-lo em uma máquina de 32 bits 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /installer/translations/es.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ShortcutPage 6 | 7 | 8 | Create Desktop Shortcut 9 | Crear acceso directo del escritorio 10 | 11 | 12 | 13 | Create Desktop &Shortcut 14 | Crear acceso &directo del escritorio 15 | 16 | 17 | 18 | UserPage 19 | 20 | 21 | Installation Scope 22 | Alcance de la instalación 23 | 24 | 25 | 26 | Install for all users 27 | Instalar para todos los usuarios 28 | 29 | 30 | 31 | The application will be installed for all users on this machine. You require elevated privileges for this installation. If you did not start the installer with elevated rights, this option will not be available. Please restart the installer with elevated rights (Admin on windows, root an linux/mac) to install for all users. 32 | La aplicación se instalará para todos los usuarios de esta máquina. Requiere privilegios elevados para esta instalación. Si no ha iniciado el instalador con derechos elevados, esta opción no estará disponible. Reinicie el instalador con derechos elevados (Admin en windows, root un linux / mac) para instalarlo para todos los usuarios. 33 | 34 | 35 | 36 | Install just for me 37 | Instalar sólo para mí 38 | 39 | 40 | 41 | The application will be installed for you only. You should choose a location only you can access for the installation. If you choose one you do not have rights for, you will be prompted to elevate. The installation however will still be for you only. 42 | La aplicación sólo se instalará para usted. Debe elegir una ubicación a la que sólo pueda acceder para la instalación. Si elige uno para el que no tiene derechos, se le pedirá que eleve. Sin embargo, la instalación seguirá siendo sólo para usted. 43 | 44 | 45 | 46 | controller 47 | 48 | 49 | Error 50 | Error 51 | 52 | 53 | 54 | The installation was done by an admin/root. Please restart %1 with elevated rights. 55 | La instalación fue realizada por un admin / root. Reinicie %1 con derechos elevados. 56 | 57 | 58 | 59 | install 60 | 61 | 62 | Error 63 | Error 64 | 65 | 66 | 67 | This Program is a 64bit Program. You can't install it on a 32bit machine 68 | Este programa es un programa de 64 bits. No se puede instalar en una máquina de 32 bits 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /installer/translations/ru.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ShortcutPage 6 | 7 | 8 | Create Desktop Shortcut 9 | Создать ярлык на рабочем столе 10 | 11 | 12 | 13 | Create Desktop &Shortcut 14 | Создать &ярлык на рабочем столе 15 | 16 | 17 | 18 | UserPage 19 | 20 | 21 | Installation Scope 22 | Область установки 23 | 24 | 25 | 26 | Install for all users 27 | Установить для всех пользователей 28 | 29 | 30 | 31 | The application will be installed for all users on this machine. You require elevated privileges for this installation. If you did not start the installer with elevated rights, this option will not be available. Please restart the installer with elevated rights (Admin on windows, root an linux/mac) to install for all users. 32 | Приложение будет установлено для всех пользователей на этом компьютере. Для этой установки требуются повышенные права. Если вы не запустили установщик с повышенными правами, этот параметр будет недоступен. Пожалуйста, перезапустите программу установки с повышенными правами (Admin на windows, root linux / mac), чтобы установить для всех пользователей. 33 | 34 | 35 | 36 | Install just for me 37 | Установите только для меня 38 | 39 | 40 | 41 | The application will be installed for you only. You should choose a location only you can access for the installation. If you choose one you do not have rights for, you will be prompted to elevate. The installation however will still be for you only. 42 | Приложение будет установлено только для вас. Вы должны выбрать место, доступное только для установки. Если вы выберете тот, на который у вас нет прав, вам будет предложено поднять его. Однако установка все равно будет только для вас. 43 | 44 | 45 | 46 | controller 47 | 48 | 49 | Error 50 | ошибка 51 | 52 | 53 | 54 | The installation was done by an admin/root. Please restart %1 with elevated rights. 55 | Установка была выполнена администратором / root. Пожалуйста, перезапустите %1 с повышенными правами. 56 | 57 | 58 | 59 | install 60 | 61 | 62 | Error 63 | ошибка 64 | 65 | 66 | 67 | This Program is a 64bit Program. You can't install it on a 32bit machine 68 | Эта Программа является 64-битной. Вы не можете установить его на 32-битную машину 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /installer/translations/it.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ShortcutPage 6 | 7 | 8 | Create Desktop Shortcut 9 | Crea una scorciatoia sul desktop 10 | 11 | 12 | 13 | Create Desktop &Shortcut 14 | Crea una &scorciatoia sul desktop 15 | 16 | 17 | 18 | UserPage 19 | 20 | 21 | Installation Scope 22 | Campo di installazione 23 | 24 | 25 | 26 | Install for all users 27 | Installa per tutti gli utenti 28 | 29 | 30 | 31 | The application will be installed for all users on this machine. You require elevated privileges for this installation. If you did not start the installer with elevated rights, this option will not be available. Please restart the installer with elevated rights (Admin on windows, root an linux/mac) to install for all users. 32 | L'applicazione verrà installata per tutti gli utenti di questa macchina. Hai bisogno di privilegi elevati per questa installazione. Se non è stato avviato l'installatore con diritti elevati, questa opzione non sarà disponibile. Riavviate l'installatore con diritti elevati (Admin su Windows, radice un linux / mac) da installare per tutti gli utenti. 33 | 34 | 35 | 36 | Install just for me 37 | Installa solo per me 38 | 39 | 40 | 41 | The application will be installed for you only. You should choose a location only you can access for the installation. If you choose one you do not have rights for, you will be prompted to elevate. The installation however will still be for you only. 42 | L'applicazione verrà installata solo per te. Dovresti scegliere una posizione solo per l'installazione. Se si sceglie uno che non si dispone di diritti per, verrà richiesto di elevare. L'installazione comunque rimarrà solo per te. 43 | 44 | 45 | 46 | controller 47 | 48 | 49 | Error 50 | Errore 51 | 52 | 53 | 54 | The installation was done by an admin/root. Please restart %1 with elevated rights. 55 | L'installazione è stata eseguita da un amministratore / root. Riavvia %1 con diritti elevati. 56 | 57 | 58 | 59 | install 60 | 61 | 62 | Error 63 | Errore 64 | 65 | 66 | 67 | This Program is a 64bit Program. You can't install it on a 32bit machine 68 | Questo programma è un programma a 64 bit. Non è possibile installarlo su una macchina a 32 bit 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /installer/translations/fr.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ShortcutPage 6 | 7 | 8 | Create Desktop Shortcut 9 | Créer un raccourci sur le bureau 10 | 11 | 12 | 13 | Create Desktop &Shortcut 14 | Créer un &raccourci sur le bureau 15 | 16 | 17 | 18 | UserPage 19 | 20 | 21 | Installation Scope 22 | Portée de l'installation 23 | 24 | 25 | 26 | Install for all users 27 | Installer pour tous les utilisateurs 28 | 29 | 30 | 31 | The application will be installed for all users on this machine. You require elevated privileges for this installation. If you did not start the installer with elevated rights, this option will not be available. Please restart the installer with elevated rights (Admin on windows, root an linux/mac) to install for all users. 32 | L'application sera installée pour tous les utilisateurs sur cette machine. Vous avez besoin de privilèges élevés pour cette installation. Si vous n'avez pas démarré le programme d'installation avec des droits élevés, cette option ne sera pas disponible. Redémarrez le programme d'installation avec des droits élevés (Admin on windows, root linux / mac) à installer pour tous les utilisateurs. 33 | 34 | 35 | 36 | Install just for me 37 | Installé juste pour moi 38 | 39 | 40 | 41 | The application will be installed for you only. You should choose a location only you can access for the installation. If you choose one you do not have rights for, you will be prompted to elevate. The installation however will still be for you only. 42 | L'application ne sera installée que pour vous. Vous devez choisir un emplacement que vous pouvez accéder pour l'installation. Si vous choisissez un dont vous n'avez pas de droits, vous serez invité à vous élever. Cependant, l'installation ne sera que pour vous. 43 | 44 | 45 | 46 | controller 47 | 48 | 49 | Error 50 | Erreur 51 | 52 | 53 | 54 | The installation was done by an admin/root. Please restart %1 with elevated rights. 55 | L'installation a été effectuée par une admin / root. Veuillez redémarrer %1 avec des droits élevés. 56 | 57 | 58 | 59 | install 60 | 61 | 62 | Error 63 | Erreur 64 | 65 | 66 | 67 | This Program is a 64bit Program. You can't install it on a 32bit machine 68 | Ce programme est un programme de 64 bits. Vous ne pouvez pas l'installer sur une machine à 32 bits 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /installer/installer.pri: -------------------------------------------------------------------------------- 1 | DISTFILES += \ 2 | $$PWD/config/* \ 3 | $$PWD/packages/de.skycoder42.advancedsetup/meta/* \ 4 | $$PWD/packages/de.skycoder42.advancedsetup/data/* \ 5 | $$PWD/packages/com.microsoft.vcredist/meta/* \ 6 | $$PWD/translations/*.ts \ 7 | $$PWD/build.py 8 | 9 | #variable defaults 10 | isEmpty(QTIFW_BIN): QTIFW_BIN = "$$[QT_INSTALL_BINS]/../../../Tools/QtInstallerFramework/3.0/bin/" 11 | isEmpty(QTIFW_MODE): QTIFW_MODE = offline #can be: offline, online, repository, online_all 12 | isEmpty(QTIFW_TARGET): QTIFW_TARGET = "$$TARGET Installer" 13 | isEmpty(QTIFW_TARGET_EXT) { 14 | win32: QTIFW_TARGET_EXT = .exe 15 | else:mac: QTIFW_TARGET_EXT = .app 16 | else: QTIFW_TARGET_EXT = .run 17 | } 18 | 19 | # standard installer script 20 | qtifw_advanced_config.path = /config 21 | qtifw_advanced_config.files += "$$PWD/config/controller.js" 22 | qtifw_install_targets: INSTALLS += qtifw_advanced_config 23 | 24 | # copy setup stuff 25 | qtifw_advanced_pkg.path = /packages 26 | qtifw_advanced_pkg.files += "$$PWD/packages/de.skycoder42.advancedsetup" 27 | qtifw_install_targets: INSTALLS += qtifw_advanced_pkg 28 | 29 | # translations 30 | isEmpty(LRELEASE): qtPrepareTool(LRELEASE, lrelease) 31 | QTIFW_TRANSLATIONS = $$files($$PWD/translations/*.ts) 32 | qtifw_translate.name = $$LRELEASE translate ${QMAKE_FILE_IN} 33 | qtifw_translate.input = QTIFW_TRANSLATIONS 34 | qtifw_translate.variable_out = QTIFW_TRANSLATIONS_QM 35 | qtifw_translate.commands = $$LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT} 36 | qtifw_translate.output = $$OUT_PWD/qtifw-ts/${QMAKE_FILE_BASE}.qm 37 | qtifw_translate.CONFIG += no_link 38 | QMAKE_EXTRA_COMPILERS += qtifw_translate 39 | # and install them 40 | qtifw_advanced_ts_pkg.path = /packages/de.skycoder42.advancedsetup/meta 41 | qtifw_advanced_ts_pkg.depends += compiler_qtifw_translate_make_all 42 | qtifw_advanced_ts_pkg.CONFIG += no_check_exist 43 | for(tsfile, QTIFW_TRANSLATIONS) { 44 | tsBase = $$basename(tsfile) 45 | qtifw_advanced_ts_pkg.files += "$$OUT_PWD/qtifw-ts/$$replace(tsBase, \.ts, .qm)" 46 | } 47 | qtifw_install_targets: INSTALLS += qtifw_advanced_ts_pkg 48 | 49 | # copy windows vcredist 50 | win32:msvc { 51 | isEmpty(QTIFW_VCPATH) { 52 | VCTMP = $$getenv(VCINSTALLDIR) 53 | VCTMP = $$split(VCTMP, ;) 54 | VCTMP = $$first(VCTMP) 55 | isEmpty(VCTMP): warning(Please set the VCINSTALLDIR variable to your vistual studio installation to deploy the vc redistributables!) 56 | else { 57 | VC_KNOWN_PATHS += "Redist/MSVC/*" "redist/*" 58 | contains(QT_ARCH, x86_64): VC_NAME = vcredist_x64.exe 59 | else: VC_NAME = vcredist_x86.exe 60 | for(path, VC_KNOWN_PATHS) { 61 | GFILES = $$files($${VCTMP}/$${path}) 62 | for(gpath, GFILES) { 63 | X_PATH = $${gpath}/$$VC_NAME 64 | isEmpty(QTIFW_VCPATH):exists($$X_PATH): QTIFW_VCPATH = $$X_PATH 65 | } 66 | } 67 | message(Detected QTIFW_VCPATH as $$QTIFW_VCPATH) 68 | } 69 | } 70 | 71 | # only add if vcpath was actually found 72 | !isEmpty(QTIFW_VCPATH) { 73 | contains(QT_ARCH, x86_64): qtifw_redist_pkg_meta.path = /packages/com.microsoft.vcredist.x64 74 | else: qtifw_redist_pkg_meta.path = /packages/com.microsoft.vcredist.x86 75 | qtifw_redist_pkg_meta.files += $$PWD/packages/com.microsoft.vcredist/meta 76 | 77 | qtifw_redist_pkg_data.path = $${qtifw_redist_pkg_meta.path}/data 78 | qtifw_redist_pkg_data.files += $$QTIFW_VCPATH 79 | 80 | qtifw_install_targets: INSTALLS += qtifw_redist_pkg_meta qtifw_redist_pkg_data 81 | } 82 | } 83 | 84 | ## installer target generation 85 | QTIFW_ARGS += $(INSTALL_ROOT) 86 | QTIFW_ARGS += $$shell_quote($$shell_path($$QTIFW_BIN)) 87 | QTIFW_ARGS += $$shell_quote($${QTIFW_TARGET}$${QTIFW_TARGET_EXT}) 88 | QTIFW_ARGS += $$shell_quote($$QTIFW_MODE) 89 | win32: QTIFW_ARGS += win 90 | else:mac: QTIFW_ARGS += mac 91 | else: QTIFW_ARGS += linux 92 | contains(QT_ARCH, x86_64): QTIFW_ARGS += x64 93 | else: QTIFW_ARGS += x86 94 | 95 | qtifw_inst.target = installer 96 | win32: qtifw_inst.commands = python 97 | qtifw_inst.commands += $$shell_quote($$shell_path($$PWD/build.py)) $$QTIFW_ARGS 98 | 99 | QMAKE_EXTRA_TARGETS += qtifw_inst 100 | -------------------------------------------------------------------------------- /installer/translations/de.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ShortcutPage 6 | 7 | 8 | Create Desktop Shortcut 9 | Desktop-Verknüpfung erstellen 10 | 11 | 12 | 13 | Create Desktop &Shortcut 14 | Erstelle eine Desktop-&Verknüpfung 15 | 16 | 17 | 18 | UserPage 19 | 20 | 21 | Installation Scope 22 | Installations-Bereich 23 | 24 | 25 | 26 | Install for all users 27 | Für alle Nutzer Installieren 28 | 29 | 30 | 31 | The application will be installed for all users on this machine. You require elevated privileges for this installation. If you did not start the installer with elevated rights, this option will not be available. Please restart the installer with elevated rights (Admin on windows, root an linux/mac) to install for all users. 32 | <html><head/><body><p>The application will be installed for all users on this machine. You require elevated privileges for this installation. If you did not start the installer with elevated rights, this option will not be available. Please restart the installer with elevated rights (Admin on windows, root an linux/mac) to install for all users.</p></body></html> 33 | Die Anwendung wird für alle Nutzer dieses Computers installiert. Sie benötigen erhöhte Rechte für die Installation. Wenn Sie den Installer nicht mit diesen gesartet haben, so wird diese Option nicht verfügbar sein. Bitte starten sie mit erhöhten Rechten (Admin auf Windows, Root auf Linux/Mac) um für alle Nutzer zu installlieren. 34 | 35 | 36 | 37 | Install just for me 38 | Nur für Mich Installieren 39 | 40 | 41 | 42 | The application will be installed for you only. You should choose a location only you can access for the installation. If you choose one you do not have rights for, you will be prompted to elevate. The installation however will still be for you only. 43 | Die Anwendung wird nur für Sie installiert. Sie sollten einen Zielort auswählen, auf den nur Sie zugreifen können. Wenn Sie einen auswählen, auf den Sie keinen Zugriff haben, werden sie aufgefordert, diesen zu gewähren. Die Installation wird jedoch trotzdem nur für Sie durchgeführt. 44 | 45 | 46 | 47 | controller 48 | 49 | 50 | Error 51 | Error 52 | 53 | 54 | 55 | The installation was done by an admin/root. Please restart %1 with elevated rights. 56 | Die Installation wurde von einem Admin/Root ausgeführt. Bitte starten Sie %1 erneut mit erhöhten Rechten. 57 | 58 | 59 | 60 | dummy 61 | 62 | 63 | Error 64 | Error 65 | 66 | 67 | 68 | This Program is a 64bit Program. You can't install it on a 32bit machine 69 | Dieses Programm ist ein 64bit Programm. Es kann nicht auf einer 32bit Maschine installiert werden 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /installer/config/controller.js: -------------------------------------------------------------------------------- 1 | function Controller() 2 | { 3 | //add query info 4 | var queryString = "osGroup="; 5 | queryString = queryString + installer.value("os"); 6 | queryString = queryString + "&arch="; 7 | queryString = queryString + systemInfo.currentCpuArchitecture; 8 | queryString = queryString + "&os="; 9 | queryString = queryString + systemInfo.productType; 10 | queryString = queryString + "&kernel="; 11 | queryString = queryString + systemInfo.kernelType; 12 | installer.setValue("UrlQueryString", queryString); 13 | 14 | //determine if admin or not 15 | var isAdmin = false; 16 | if (installer.value("os") === "win") { 17 | var testAdmin = installer.execute("cmd", ["/c", "net", "session"]); 18 | if(testAdmin.length > 1 && testAdmin[1] == 0) 19 | isAdmin = true; 20 | } else { 21 | var testAdmin = installer.execute("id", ["-u"]); 22 | if(testAdmin.length > 1 && testAdmin[0] == 0) 23 | isAdmin = true; 24 | } 25 | installer.setValue("isAdmin", isAdmin ? "true" : "false"); 26 | 27 | //only for installation 28 | if(installer.isInstaller()) { 29 | //find the default location, for admin and user for each os 30 | var targetBase = installer.value("TargetDir"); 31 | if (installer.value("os") === "win") { 32 | installer.setValue("UserTargetDir", "@HomeDir@/AppData/Local/" + targetBase); 33 | installer.setValue("AdminTargetDir", "@ApplicationsDir@/" + targetBase); 34 | } else if(installer.value("os") === "mac") { 35 | installer.setValue("UserTargetDir", "@HomeDir@/Applications/" + targetBase + ".app"); 36 | installer.setValue("AdminTargetDir", "@ApplicationsDir@/" + targetBase + ".app"); 37 | } else if(installer.value("os") === "x11") { 38 | installer.setValue("UserTargetDir", "@HomeDir@/" + targetBase); 39 | installer.setValue("AdminTargetDir", "@ApplicationsDir@/" + targetBase); 40 | } 41 | 42 | //store all users and online/offline info 43 | installer.setValue("allUsers", isAdmin ? "true" : "false"); 44 | installer.setValue("isOffline", installer.isOfflineOnly() ? "true" : "false"); 45 | } 46 | 47 | //skip prompt prepare 48 | if(installer.value("skipPrompt") === "1") { 49 | installer.statusChanged.connect(function(status) { 50 | if(status == QInstaller.Success) 51 | gui.clickButton(buttons.CancelButton); 52 | }); 53 | installer.updateFinished.connect(function() { 54 | gui.clickButton(buttons.NextButton); 55 | }); 56 | } 57 | } 58 | 59 | Controller.prototype.IntroductionPageCallback = function() 60 | { 61 | //Maintenance tool 62 | if(!installer.isInstaller()) { 63 | //check if admin neccessarity is given 64 | if(installer.value("allUsers") === "true" && installer.value("isAdmin") === "false") {//TODO check install admin instead 65 | QMessageBox.critical("de.skycoder42.advanced-setup.notAdmin", 66 | qsTr("Error"), 67 | qsTr("The installation was done by an admin/root. Please restart %1 with elevated rights.") 68 | .arg(installer.value("MaintenanceToolName"))); 69 | installer.autoAcceptMessageBoxes(); 70 | gui.clickButton(buttons.CancelButton); 71 | return; 72 | } 73 | 74 | var widget = gui.currentPageWidget(); 75 | if (widget !== null) { 76 | if(installer.value("isOffline") === "true") { 77 | //offline only -> only allow uninstall 78 | widget.findChild("PackageManagerRadioButton").visible = false; 79 | widget.findChild("UpdaterRadioButton").visible = false; 80 | widget.findChild("UninstallerRadioButton").checked = true; 81 | gui.clickButton(buttons.NextButton); 82 | } else { 83 | //Online -> select next step base on the arguments 84 | if (installer.isUninstaller() && installer.value("uninstallOnly") === "1") { 85 | widget.findChild("PackageManagerRadioButton").checked = false; 86 | widget.findChild("UpdaterRadioButton").checked = false; 87 | widget.findChild("UninstallerRadioButton").checked = true; 88 | gui.clickButton(buttons.NextButton); 89 | } else if (installer.isUpdater()) { 90 | widget.findChild("PackageManagerRadioButton").checked = false; 91 | widget.findChild("UpdaterRadioButton").checked = true; 92 | widget.findChild("UninstallerRadioButton").checked = false; 93 | gui.clickButton(buttons.NextButton); 94 | } else if(installer.isPackageManager()) { 95 | widget.findChild("PackageManagerRadioButton").checked = true; 96 | widget.findChild("UpdaterRadioButton").checked = false; 97 | widget.findChild("UninstallerRadioButton").checked = false; 98 | gui.clickButton(buttons.NextButton); 99 | } //else -> normal start 100 | } 101 | } 102 | } 103 | } 104 | 105 | Controller.prototype.DynamicUserPageCallback = function() 106 | { 107 | // load the admin/user-state for the installation 108 | var page = gui.pageWidgetByObjectName("DynamicUserPage"); 109 | if(page !== null) { 110 | if (installer.value("isAdmin") === "true") { 111 | //admin -> allow both 112 | page.allUsersButton.checked = installer.value("allUsers") === "true"; 113 | page.meOnlyButton.checked = installer.value("allUsers") !== "true"; 114 | page.allUsersButton.enabled = true; 115 | page.allUsersLabel.enabled = true; 116 | } else { 117 | //user -> allow as user only 118 | page.meOnlyButton.checked = true; 119 | page.allUsersButton.checked = false; 120 | page.allUsersButton.enabled = false; 121 | page.allUsersLabel.enabled = false; 122 | } 123 | } 124 | } 125 | 126 | Controller.prototype.TargetDirectoryPageCallback = function() 127 | { 128 | var page = gui.pageWidgetByObjectName("DynamicUserPage"); 129 | // update the target directory based on the installation scope 130 | if (page !== null && page.allUsersButton.checked) { 131 | installer.setValue("allUsers", "true"); 132 | installer.setValue("TargetDir", installer.value("AdminTargetDir")); 133 | } else { 134 | installer.setValue("allUsers", "false"); 135 | installer.setValue("TargetDir", installer.value("UserTargetDir")); 136 | } 137 | 138 | // windows -> if x64 -> modify the path to remove (x86) from it 139 | if (installer.value("os") === "win" && 140 | systemInfo.currentCpuArchitecture.search("64") > 0) { 141 | var orgFolder = installer.value("TargetDir"); 142 | var programFiles = installer.environmentVariable("ProgramW6432"); 143 | var localProgFiles = installer.environmentVariable("ProgramFiles"); 144 | installer.setValue("TargetDir", orgFolder.replace(localProgFiles, programFiles)); 145 | } 146 | 147 | var widget = gui.currentPageWidget(); 148 | if (widget !== null)// set path with non-native modifiers 149 | widget.TargetDirectoryLineEdit.text = installer.value("TargetDir").replace("\\", "/"); 150 | } 151 | 152 | Controller.prototype.ComponentSelectionPageCallback = function() { 153 | if(installer.value("skipPrompt") === "1") { 154 | var widget = gui.currentPageWidget(); 155 | widget.selectAll(); 156 | gui.clickButton(buttons.NextButton); 157 | } 158 | } 159 | 160 | Controller.prototype.ReadyForInstallationPageCallback = function() { 161 | if(installer.value("skipPrompt") === "1") 162 | gui.clickButton(buttons.NextButton); 163 | } 164 | 165 | Controller.prototype.FinishedPageCallback = function() 166 | { 167 | //windows -> update the registry entry for the installer to work properly 168 | if (installer.isInstaller() && installer.value("os") === "win") { 169 | var isAllUsers = (installer.value("allUsers") === "true"); 170 | if(!isAllUsers || installer.gainAdminRights()){ 171 | var args = [ 172 | installer.value("ProductUUID"), 173 | "@TargetDir@\\@MaintenanceToolName@.exe", 174 | isAllUsers ? "HKEY_LOCAL_MACHINE" : "HKEY_CURRENT_USER", 175 | installer.isOfflineOnly() ? 0 : 1 176 | ]; 177 | installer.execute("@TargetDir@/regSetUninst.bat", args); 178 | } 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # QtIFW-Advanced-Setup 2 | Create "Qt Installer Framework" installers from your project via qmake 3 | 4 | **Important:** With Version 2.0.0 the api has completly changed. Now the `make install` step is used to prepare all files, so that deployment/installer generation operate on the installed files. Read the documentation carefully to pick up how to change your pro files! (The old code is still existant as the `old` branch or as qpm packages before version 2.0.0) 5 | 6 | ## Features 7 | - Easily creation of installers via qmake 8 | - Windows: Automatic inclusion of msvc libs as installation (if required) 9 | - Extends default installer functionality: 10 | - provide uninstall only for offline installers 11 | - Hide uninstall/... by special command line switch 12 | - Adds local vs global installation 13 | - Global installation requires admin/root and chooses global location 14 | - Local installation uses user directories 15 | - Maintenancetool ensures it's privileged if installed globally 16 | - Windows: Allows to create a desktop shortcut 17 | - Windows: proper registration as "Installed Application" 18 | - Windows: Adds update/modify shortcuts to the windows startmenu directory 19 | - Linux: Automatic desktop file creation 20 | - simple deployment as additional step before creating the installer 21 | - uses the qt deployment tools to deploy your application 22 | - option to include custom and Qt translations 23 | - auto-deploy flag to automate deployment even further 24 | - uses make install for simple file preperations 25 | - Provides the `qtifw` and `qtifw-build` targets to automatically (translate, install, ) deploy, create the installer and compress it 26 | 27 | ## Installation 28 | The package is providet as qpm package, [`de.skycoder42.qtifw-advanced-setup`](https://www.qpm.io/packages/de.skycoder42.qtifw-advanced-setup/index.html). You can install it either via qpmx (preferred) or directly via qpm. 29 | 30 | ### Via qpmx 31 | [qpmx](https://github.com/Skycoder42/qpmx) is a frontend for qpm (and other tools) with additional features, and is the preferred way to install packages. To use it: 32 | 33 | 1. Install qpmx (See [GitHub - Installation](https://github.com/Skycoder42/qpmx#installation)) 34 | 2. Install qpm (See [GitHub - Installing](https://github.com/Cutehacks/qpm/blob/master/README.md#installing), for **windows** see below) 35 | 3. In your projects root directory, run `qpmx install de.skycoder42.qtifw-advanced-setup` 36 | 37 | ### Via qpm 38 | 39 | 1. Install qpm (See [GitHub - Installing](https://github.com/Cutehacks/qpm/blob/master/README.md#installing), for **windows** see below) 40 | 2. In your projects root directory, run `qpm install de.skycoder42.qtifw-advanced-setup` 41 | 3. Include qpm to your project by adding `include(vendor/vendor.pri)` to your `.pro` file 42 | 43 | Check their [GitHub - Usage for App Developers](https://github.com/Cutehacks/qpm/blob/master/README.md#usage-for-app-developers) to learn more about qpm. 44 | 45 | **Important for Windows users:** QPM Version *0.10.0* (the one you can download on the website) is currently broken on windows! It's already fixed in master, but not released yet. Until a newer versions gets released, you can download the latest dev build from here: 46 | - https://storage.googleapis.com/www.qpm.io/download/latest/windows_amd64/qpm.exe 47 | - https://storage.googleapis.com/www.qpm.io/download/latest/windows_386/qpm.exe 48 | 49 | ## Requirements 50 | In order to use QtIFW-Advanced-Setup, you need the following installed: 51 | 52 | - **QtIFW:** ideally as part of your Qt Installation. Use the online installer and find it under `Qt > Tools` 53 | - **Python 3:** A pyhton script is used to generate the installer from the input. Thus, you need to have *Python 3* installed! 54 | - **linuxdeployqt:** If you want to use the deployment feature on linux, you need linuxdeployqt (See following chapter) 55 | 56 | ### Linuxdeployqt 57 | Since Qt does not provide it's own deployment tool for linux, I am using [linuxdeployqt](https://github.com/probonopd/linuxdeployqt) in this package. This tool needs to be placed in the Qt install directory. To simplify this step, you can run the [get_linuxdeployqt_compat.sh](./get_linuxdeployqt_compat.sh) script. The script builds and installs linuxdeployqt into your Qt installation directory. 58 | 59 | This is only a workaround, and while the script will stay, the install method for linuxdeployqt may change over time. 60 | 61 | ## Usage 62 | The idea is: You specify files and directories via your pro-file and run `make ` to deploy, create the installer, or both. 63 | 64 | When using all of the qtifw features, the amount of work you need to do shrinks down to the following: 65 | 66 | 1. Use make install targets to copy all the files you need for your installer to installer build directory 67 | 2. configure the installer generation via qmake variables and configurations 68 | 3. Run the make targets you want to generate the installer and use `INSTALL_ROOT` to specify where to do so 69 | 70 | Generating an installer consists 5 targets that depend on each other. This means you have to run those 5 make targets in order to generate an installer. However, for simplicity, you can enable a single "master target" called 71 | `qtifw` to do all 5 steps via one command. In addition, there is the `qtifw-build` target that automatically sets a subfolder in your build directory as the `INSTALL_ROOT`. The steps as follwos, and are explained in more detail below: 72 | 73 | 1. `lrelease` (optional, disabled by default) 74 | 2. `install` 75 | 3. `deploy` 76 | 4. `installer` 77 | 5. `qtifw-compress` (optional, enabled by default) 78 | 79 | In short: Simply set up your pro file correctly and then run `make qtifw-build` to do all those steps as needed. The [Example project](Example/Example.pro) shows a full example of how to use QtIFW-Advanced-Setup. 80 | 81 | ### Translations (`make lrelease`) 82 | The `lrelease` step is an optional step provided by qpmx that will generate qm files for all the translations specified via the `TRANSLATIONS` qmake variable. See [qpmx - Translations](https://github.com/Skycoder42/qpmx#translations) for more details. 83 | 84 | When using the `qtifw` target, translations are not generated by default. You can enable them by adding `CONFIG += qtifw_auto_ts` to your pro file. 85 | 86 | The example code for the pro file would look like this: 87 | ```pro 88 | TRANSLATIONS += myapp.ts 89 | ``` 90 | 91 | #### Variables 92 | Variable Name | Default value | Description 93 | --------------------|----------------|------------- 94 | TRANSLATIONS | *empty* | The translations to be generated 95 | EXTRA_TRANSLATIONS | *empty* | Additional translations to be generated 96 | 97 | #### Install targets (with target.files automatically filled) 98 | - `qpmx_ts_target`: Install target for `TRANSLATIONS` 99 | - `extra_ts_target`: Install target for `EXTRA_TRANSLATIONS` 100 | 101 | ### Installation (`make install`) 102 | The install targets should be used to prepare the application for deployment/installer creation by placing all 103 | files where they need to be for the installer. The install should look like this: 104 | ``` 105 | /config 106 | /config.xml 107 | /... 108 | /packages 109 | /com.example.my-package 110 | /meta 111 | /package.xml 112 | /install.js 113 | /... 114 | /data 115 | /example.exe 116 | /... 117 | /com.example.another-package 118 | /... 119 | ``` 120 | 121 | The config directory should contain all installer configuration files. The package directory should consist of multiple subdirectories named after the installer package the contain. The internal structure of those package directories is the one QtIFW needs. 122 | 123 | To stay with this example, the following qmake code could be used to create such a setup: 124 | ```pro 125 | # install the config.xml 126 | install_cfg.files = config.xml 127 | install_cfg.path = /config 128 | INSTALLS += install_cfg 129 | 130 | # install the package meta folder 131 | install_pkg.files += meta 132 | install_pkg.path = /packages/com.example.my-package 133 | INSTALLS += install_pkg 134 | 135 | # install the executable 136 | target.path = /packages/com.example.my-package/data 137 | INSTALLS += target 138 | 139 | # optional: install the generated translations 140 | qpmx_ts_target.path = /packages/com.example.my-package/data/translations 141 | INSTALLS += qpmx_ts_target 142 | ``` 143 | 144 | Simply running `make INSTALL_ROOT=... install` will copy all the specified files, plus all the additional stuff that is needed to create an installer. 145 | 146 | **Important:** For this to work you *always* have to specify an install root as parameter to make. All installations as stated above will be put into that directory - meaning forgetting it would install that stuff into your root filesystem! When using the `qtifw-build` target however, you don't have to care about this. 147 | 148 | ### Deployment (`make deploy`) 149 | Deployment is performed on the already install binary, so that all the deployed files are automatcially placed in the installer directories. The deployment target is automatically determined by using the `target.path` to find out where to find the project binary. However, you can also specify the deployment target yourself by setting the `qtifw_deploy_target`. So unless you need to specify additional deploy targets, you typically don't have to setup 150 | anything at all in your pro file for this step! 151 | 152 | #### The `qtifw_deploy_target` target 153 | Target Property | Default value | Description 154 | ----------------|----------------------------|------------- 155 | path | `$${target.path}` | The path to find the binaries to be deployed at 156 | files | `$${TARGET}$${TARGET_EXT}` | The binaries to be deployed. By default this is the main target of your project that you are building. 157 | 158 | ### Installer generation (`make installer`) 159 | This step create the actual QtIFW-Installer and/or repositories out of youre previously installed and deployed files. Just like the previous steps, it uses the `INSTALL_ROOT` to find the `config` and `packages` directories and uses their contents to create the installer. They are created in the very same directory. You can configure how the generation is performed by using the following qmake variables. 160 | 161 | **Important:** When *not* using the `qtifw` or `qtifw-build` mode, you have to explicitly enable the installtion of the additional installer files that are required to create the installer. This is done by adding `CONFIG += qtifw_install_targets` to your pro file. This is not needed if you already have the `CONFIG += qtifw_target` line in your pro file. 162 | 163 | #### Variables 164 | Variable Name | Default value | Description 165 | ---------------------|--------------------------------------------|------------- 166 | QTIFW_BIN | `...` | The directory containing the QtIFW Tools (repogen, binarycreator, etc.). The default value assumes you installed Qt and QtIFW via the online installer and that QtIFW is of version 3.0. Adjust the path if your tools are located elsewhere 167 | QTIFW_MODE | `offline` | The type of installer to create. Can be:
`offline`: Offline installer
`online`: Online installer
`repository`: The remote repository for an online installer
`online_all`: Both, the online installer and remote repository 168 | QTIFW_TARGET | `$$TARGET Installer` | The base name of the installer binary 169 | QTIFW_TARGET_EXT | win:`.exe`
linux:`.run`
mac:`.app` | The extension of the installer binary 170 | QTIFW_VCPATH | _default path to vcredist*.exe_ | Windows only: The path to the vcredist installer to added to the installer. The vcredists are needed if you build with the msvc-compiler 171 | 172 | **Note for Windows Users:** With msvc2015 or older, the vcredist files are somewhat strange and prevent you from delete their copies via anything but the explorer. This means only the first time you create the installer it works fine. After that, you have to delete the build folder yourself via the explorer before you can build the installer again. This issue seems to have disappeared with msvc2017. 173 | 174 | ### Repository compression (`make qtifw-compress`) 175 | The final optional step is to compress the repositories and the installer app bundle for mac. This target does not need any configuration. It will simply create a compressed archive of the repositories and the app bundle on mac for easier deployment. You will need the `tar` and `xz` tools on linux and mac, the `zip` tool on mac and the `7z` tool on windows. 176 | 177 | You can disable this step for the `qtifw` target by adding `CONFIG += qtifw_no_compress` to your pro file. 178 | 179 | ### The high level qtifw targets (`make qtifw` and `make qtifw-build`) 180 | As stated at the beginning of this document, the `qtifw` target is basically a shortcut to run all the above steps via one command. In order to enable this target, you must add `CONFIG += qtifw_target` to your pro file. You can configure how this target behaves via the following configurations. 181 | 182 | The `qtifw-build` is an additional helper that will cann `qtifw` with an automatically determined install root. So instead of running `make INSTALL_ROOT=/path/to/build/qtifw-build qtifw` you can simply use `make qtifw-build`. The path `/path/to/build` is replaced by `$$OUT_PWD` from qmake. 183 | 184 | **Important:** For the classic `qtifw` to work you *always* have to specify an install root as parameter to make. All operations as stated above will be run inside that directory - meaning forgetting it would install that stuff into your root filesystem! When using the `qtifw-build` target however, you don't have to care about this. 185 | 186 | #### CONFIG options 187 | Option | Description 188 | -----------------------------|------------- 189 | `qtifw_target` | Enables the `qtifw` and `qtifw-build` targets and creates the automatic dependencies between the lrelease, install, deploy, installer and qtifw-compress targets. Also, it automatically adds `qtifw_install_targets` to the `CONFIG` as well. 190 | `qtifw_install_targets` | Enables the automatic installation of all internal installer related extra files. This must be defined to create an installer. 191 | `qtifw_auto_ts` | Enables an automatic dependency between `lrelease` and `install`, i.e. `make install` will now automatically call `make lrelease` first 192 | `qtifw_deploy_no_install` | Disables the dependency between `install` and `deploy`. I.e. now the `qtifw` target will *not* automatically run `make install` anymore. This can be useful when integrating with build systems to seperate the install and installer generation steps. 193 | `qtifw_no_compress` | Disables the automatic `qtifw-compress` step, i.e. prevents the compressed archives from beeing generated. --------------------------------------------------------------------------------