diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2020-07-08 20:43:12 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2020-10-13 19:08:31 +0200 |
commit | 1ae11e5c615c996cbef3db694fc571bfe6524d1d (patch) | |
tree | 6b7ed7d16c0647ce5c86bb2c1b8c6e94972fade1 /installer/packages/riseupvpn/meta/install.js | |
parent | a1216b2e17fb62f73a44ccec3734c6e579e65645 (diff) |
[pkg] boilerplate for qtinstaller framework
Diffstat (limited to 'installer/packages/riseupvpn/meta/install.js')
-rw-r--r-- | installer/packages/riseupvpn/meta/install.js | 51 |
1 files changed, 51 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"); +} |