From 1ae11e5c615c996cbef3db694fc571bfe6524d1d Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Wed, 8 Jul 2020 20:43:12 +0200 Subject: [pkg] boilerplate for qtinstaller framework --- installer/packages/riseupvpn/meta/install.js | 51 +++++++++++++++++++++++++++ installer/packages/riseupvpn/meta/package.xml | 11 ++++++ 2 files changed, 62 insertions(+) create mode 100644 installer/packages/riseupvpn/meta/install.js create mode 100644 installer/packages/riseupvpn/meta/package.xml (limited to 'installer/packages/riseupvpn/meta') 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 @@ + + + RiseupVPN + RiseupVPN + 0.20.6-1 + 2020-07-01 + false + true + + true + -- cgit v1.2.3