summaryrefslogtreecommitdiff
path: root/installer/packages/riseupvpn/meta
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 /installer/packages/riseupvpn/meta
parenta1216b2e17fb62f73a44ccec3734c6e579e65645 (diff)
[pkg] boilerplate for qtinstaller framework
Diffstat (limited to 'installer/packages/riseupvpn/meta')
-rw-r--r--installer/packages/riseupvpn/meta/install.js51
-rw-r--r--installer/packages/riseupvpn/meta/package.xml11
2 files changed, 62 insertions, 0 deletions
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>