summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2020-07-08 20:43:12 +0200
committerRuben Pollan <meskio@sindominio.net>2020-10-13 19:08:31 +0200
commit1ae11e5c615c996cbef3db694fc571bfe6524d1d (patch)
tree6b7ed7d16c0647ce5c86bb2c1b8c6e94972fade1
parenta1216b2e17fb62f73a44ccec3734c6e579e65645 (diff)
[pkg] boilerplate for qtinstaller framework
-rw-r--r--Makefile3
-rw-r--r--bitmask.pro1
-rwxr-xr-xgui/build.sh4
-rw-r--r--gui/handlers.h2
-rw-r--r--installer/.gitignore4
-rw-r--r--installer/bitmask-installer.pro21
-rw-r--r--installer/config/config.xml12
-rw-r--r--installer/packages/riseupvpn/data/README.txt1
-rw-r--r--installer/packages/riseupvpn/meta/install.js51
-rw-r--r--installer/packages/riseupvpn/meta/package.xml11
10 files changed, 106 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 78f2e93..a62f2e2 100644
--- a/Makefile
+++ b/Makefile
@@ -58,6 +58,9 @@ dependsCygwin:
@choco install -y golang python nssm nsis wget 7zip
build:
+ gui/build.sh
+
+build_old:
ifeq (${XBUILD}, yes)
$(MAKE) build_cross_win
$(MAKE) build_cross_osx
diff --git a/bitmask.pro b/bitmask.pro
index 3ab8507..7f4b488 100644
--- a/bitmask.pro
+++ b/bitmask.pro
@@ -9,6 +9,7 @@ QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.14
macx {
LIBS += -framework Security
+ ICON = ./branding/assets/riseup/icon.icns
}
QT += qml quick widgets
diff --git a/gui/build.sh b/gui/build.sh
index 1ded17e..91be4fc 100755
--- a/gui/build.sh
+++ b/gui/build.sh
@@ -20,8 +20,8 @@ fi
if [ "$XBUILD" == "$WIN64" ]
then
# TODO allow to override vars
- QMAKE="`pwd`/../mxe/usr/x86_64-w64-mingw32.static/qt5/bin/qmake"
- PATH="`pwd`/../mxe/usr/bin"/:$PATH
+ QMAKE="`pwd`/../../mxe/usr/x86_64-w64-mingw32.static/qt5/bin/qmake"
+ PATH="`pwd`/../../mxe/usr/bin"/:$PATH
CC=x86_64-w64-mingw32.static-gcc
else
if [ "$QMAKE" == "" ]
diff --git a/gui/handlers.h b/gui/handlers.h
index d746524..c342a97 100644
--- a/gui/handlers.h
+++ b/gui/handlers.h
@@ -12,8 +12,6 @@ class QJsonWatch : public QObject {
Q_OBJECT
- QJsonModel *model;
-
public:
signals:
diff --git a/installer/.gitignore b/installer/.gitignore
new file mode 100644
index 0000000..2fdd01e
--- /dev/null
+++ b/installer/.gitignore
@@ -0,0 +1,4 @@
+.qmake.stash
+Makefile
+packages/riseupvpn/data/riseup-vpn
+RiseupVPN-Installer
diff --git a/installer/bitmask-installer.pro b/installer/bitmask-installer.pro
new file mode 100644
index 0000000..c526283
--- /dev/null
+++ b/installer/bitmask-installer.pro
@@ -0,0 +1,21 @@
+TEMPLATE = aux
+
+CONFIG -= debug_and_release
+
+INSTALLER = RiseupVPN-Installer
+
+INPUT = $$PWD/config/config.xml $$PWD/packages
+inst.input = INPUT
+inst.output = $$INSTALLER
+inst.commands = binarycreator -c $$PWD/config/config.xml -p $$PWD/packages ${QMAKE_FILE_OUT}
+inst.CONFIG += target_predeps no_link combine
+
+QMAKE_EXTRA_COMPILERS += inst
+
+OTHER_FILES += \
+# watch out... it chokes with dashes in the path
+ packages/riseupvpn/meta/package.xml \
+ packages/riseupvpn/meta/install.js \
+ packages/riseupvpn/data/README.txt \
+ packages/riseupvpn/data/riseup-vpn
+
diff --git a/installer/config/config.xml b/installer/config/config.xml
new file mode 100644
index 0000000..ef0e5e8
--- /dev/null
+++ b/installer/config/config.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Installer>
+ <Name>RiseupVPN Installer 1.0</Name>
+ <Title>RiseupVPN Installer</Title>
+ <Version>1.0.0</Version>
+ <TargetDir>@ApplicationsDir@/RiseupVPN</TargetDir>
+ <RemoteRepositories>
+ <Repository>
+ <Url>http://localhost/repository/</Url>
+ </Repository>
+ </RemoteRepositories>
+</Installer>
diff --git a/installer/packages/riseupvpn/data/README.txt b/installer/packages/riseupvpn/data/README.txt
new file mode 100644
index 0000000..616eb29
--- /dev/null
+++ b/installer/packages/riseupvpn/data/README.txt
@@ -0,0 +1 @@
+RiseupVPN README
diff --git a/installer/packages/riseupvpn/meta/install.js b/installer/packages/riseupvpn/meta/install.js
new file mode 100644
index 0000000..e5174e1
--- /dev/null
+++ b/installer/packages/riseupvpn/meta/install.js
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 LEAP
+**
+****************************************************************************/
+
+function Component() {
+}
+
+Component.prototype.createOperations = function ()
+{
+ // This will actually install the files
+ component.createOperations();
+
+ // And now our custom actions.
+ // See https://doc.qt.io/qtinstallerframework/operations.html for reference
+ //
+ // We can also use this to register different components (different architecture for instance)
+ // See https://doc.qt.io/qtinstallerframework/qt-installer-framework-systeminfo-packages-root-meta-installscript-qs.html
+
+ console.log("Post installation. Checking platform...")
+ if (systemInfo.productType === "windows") {
+ console.log("Platform: windows");
+ postInstallWindows();
+ } else if (systemInfo.productType === "osx") {
+ console.log("Platform: osx");
+ postInstallOSX();
+ } else {
+ console.log("Platform: linux");
+ postInstallLinux();
+ }
+}
+
+function postInstallWindows() {
+ component.addOperation("CreateShortcut",
+ "@TargetDir@/README.txt",
+ "@StartMenuDir@/README.lnk",
+ "workingDirectory=@TargetDir@",
+ "iconPath=%SystemRoot%/system32/SHELL32.dll",
+ "iconId=2");
+}
+
+function postInstallOSX() {
+ console.log("TODO: should do osx post-installation");
+}
+
+function postInstallLinux() {
+ console.log("TODO: should do linux post-installation");
+ console.log("Maybe you want to use your package manager instead?");
+ component.addOperation("AppendFile", "/tmp/riseupvpn.log", "this is a test - written from the installer");
+}
diff --git a/installer/packages/riseupvpn/meta/package.xml b/installer/packages/riseupvpn/meta/package.xml
new file mode 100644
index 0000000..4dd7ae9
--- /dev/null
+++ b/installer/packages/riseupvpn/meta/package.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Package>
+ <DisplayName>RiseupVPN</DisplayName>
+ <Description>RiseupVPN</Description>
+ <Version>0.20.6-1</Version>
+ <ReleaseDate>2020-07-01</ReleaseDate>
+ <Default>false</Default>
+ <RequiresAdminRights>true</RequiresAdminRights>
+ <Script>install.js</Script>
+ <ForcedInstallation>true</ForcedInstallation>
+</Package>