summaryrefslogtreecommitdiff
path: root/branding/templates/qtinstaller/packages
diff options
context:
space:
mode:
authorkali <kali@leap.se>2020-09-30 16:25:27 +0200
committerRuben Pollan <meskio@sindominio.net>2020-10-13 19:08:44 +0200
commitef892643df8970aec45dbc3f48eabb95a1ccbf22 (patch)
tree1a20c34cca7b94e69468e471790996fa61909805 /branding/templates/qtinstaller/packages
parent47ac0543b9ed2d4afb8814a19e2f4dc3c30030e1 (diff)
[pkg] osx helper and working qt installer
Diffstat (limited to 'branding/templates/qtinstaller/packages')
-rw-r--r--branding/templates/qtinstaller/packages/bitmaskvpn/.gitignore1
-rw-r--r--branding/templates/qtinstaller/packages/bitmaskvpn/meta/install.js53
-rw-r--r--branding/templates/qtinstaller/packages/bitmaskvpn/meta/package.xml11
3 files changed, 65 insertions, 0 deletions
diff --git a/branding/templates/qtinstaller/packages/bitmaskvpn/.gitignore b/branding/templates/qtinstaller/packages/bitmaskvpn/.gitignore
new file mode 100644
index 0000000..60baa9c
--- /dev/null
+++ b/branding/templates/qtinstaller/packages/bitmaskvpn/.gitignore
@@ -0,0 +1 @@
+data/*
diff --git a/branding/templates/qtinstaller/packages/bitmaskvpn/meta/install.js b/branding/templates/qtinstaller/packages/bitmaskvpn/meta/install.js
new file mode 100644
index 0000000..f9c85f2
--- /dev/null
+++ b/branding/templates/qtinstaller/packages/bitmaskvpn/meta/install.js
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** 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
+
+ if (systemInfo.productType === "windows") {
+ postInstallWindows();
+ } else if (systemInfo.productType === "osx") {
+ postInstallOSX();
+ } else {
+ 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("Post-installation for OSX");
+ // TODO add UNDOEXECUTE for the uninstaller
+ component.addElevatedOperation(
+ "Execute", "{0}",
+ "@TargetDir@/post-install.py",
+ "errormessage=There was an error during the post-installation script, things might be broken. Please report this error and attach the post-install.log file.");
+}
+
+function postInstallLinux() {
+ console.log("Post-installation for GNU/Linux");
+ 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/branding/templates/qtinstaller/packages/bitmaskvpn/meta/package.xml b/branding/templates/qtinstaller/packages/bitmaskvpn/meta/package.xml
new file mode 100644
index 0000000..b910e7f
--- /dev/null
+++ b/branding/templates/qtinstaller/packages/bitmaskvpn/meta/package.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Package>
+ <DisplayName>DemoLibVPN</DisplayName>
+ <Description>DemoLibVPN</Description>
+ <Version>0.20.9-1</Version>
+ <ReleaseDate>2020-10-01</ReleaseDate>
+ <Default>false</Default>
+ <RequiresAdminRights>true</RequiresAdminRights>
+ <Script>install.js</Script>
+ <ForcedInstallation>true</ForcedInstallation>
+</Package>