From 211fc457329b074fd4331aec0c4fc5d765e9023f Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 23 Jul 2020 18:29:53 +0200 Subject: [pkg] post-installer script --- installer/packages/riseupvpn/meta/install.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'installer/packages/riseupvpn/meta/install.js') diff --git a/installer/packages/riseupvpn/meta/install.js b/installer/packages/riseupvpn/meta/install.js index e5174e1..f9c85f2 100644 --- a/installer/packages/riseupvpn/meta/install.js +++ b/installer/packages/riseupvpn/meta/install.js @@ -18,34 +18,36 @@ Component.prototype.createOperations = function () // 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"); + 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"); + 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("TODO: should do linux post-installation"); + 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"); } -- cgit v1.2.3