diff options
author | kali <kali@leap.se> | 2021-02-19 12:20:55 +0100 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-02-26 22:40:44 +0100 |
commit | 4a4b6b46f84c28640c711655f4f3c339ccf8fbba (patch) | |
tree | fd17ca92a5366251133b400866e8a5e97891712f /branding/templates/qtinstaller/packages/bitmaskvpn/meta | |
parent | 51308ecd42d4c8d7724a8eaf517294fd9d369cf0 (diff) |
[pkg] improve osx installer
- install into global /Applications
- document how to troubleshoot helper
- uninstall app is visible on top-level folder
- improve detection of running processes for old and new binaries
- Closes: #441
- Closes: #445
- Closes: #435
Diffstat (limited to 'branding/templates/qtinstaller/packages/bitmaskvpn/meta')
-rw-r--r-- | branding/templates/qtinstaller/packages/bitmaskvpn/meta/install.js | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/branding/templates/qtinstaller/packages/bitmaskvpn/meta/install.js b/branding/templates/qtinstaller/packages/bitmaskvpn/meta/install.js index 407ea39..dada918 100644 --- a/branding/templates/qtinstaller/packages/bitmaskvpn/meta/install.js +++ b/branding/templates/qtinstaller/packages/bitmaskvpn/meta/install.js @@ -58,6 +58,9 @@ function Component() { Component.prototype.createOperations = function () { + if (systemInfo.productType === "osx") { + preInstallOSX(); + } // This will actually install the files component.createOperations(); @@ -70,27 +73,13 @@ Component.prototype.createOperations = function () if (systemInfo.productType === "windows") { postInstallWindows(); } else if (systemInfo.productType === "osx") { - preInstallOSX(); + uninstallOSX(); postInstallOSX(); } else { postInstallLinux(); } } -Component.prototype.installationFinished = function() -{ - console.log("DEBUG: running installationFinished"); - if (installer.isInstaller() && installer.status == QInstaller.Success) { - var argList = ["-a", "@TargetDir@/$APPNAME.app"]; - try { - installer.execute("touch", ["/tmp/install-finished"]); - installer.execute("open", argList); - } catch(e) { - console.log(e); - } - } -} - function postInstallWindows() { // TODO - check if we're on Windows10 or older, and use the needed tap-windows installer accordingly. console.log("Installing OpenVPN tap driver"); @@ -111,12 +100,26 @@ function postInstallWindows() { } function preInstallOSX() { - console.log("Pre-installation for OSX"); + console.log("Pre-installation for OSX: check for running bitmask"); + component.addOperation( + "Execute", "{1}", "pgrep", "bitmask-vpn$$", /* $$$$ is escaped by python template: the old app binary was called bitmask-vpn */ + "errormessage=It seems that an old RiseupVPN client is running. Please exit the app and run this installer again.", + ); + component.addOperation( + "Execute", "{1}", "pgrep", "bitmask$$", /* $$$$ is escaped by python template: we don't want to catch bitmask app */ + "errormessage=It seems RiseupVPN, CalyxVPN or LibraryVPN are running. Please exit the app and run this installer again.", + "UNDOEXECUTE", "{1}", "pgrep", "bitmask$$", /* $$$$ is escaped: we dont want bitmask app */ + "errormessage=It seems RiseupVPN, CalyxVPN or LibraryVPN are running. Please exit the app before trying to run the uninstaller again." + ); +} + +function uninstallOSX() { + console.log("Pre-installation for OSX: uninstall previous helpers"); // TODO use installer filepath?? component.addElevatedOperation( "Execute", "{0}", "@TargetDir@/uninstall.py", "pre", - "errormessage=There was an error during the pre-installation script, things might be broken. Please report this error and attach the pre-install.log file." + "errormessage=There was an error during the pre-installation script, things might be broken. Please report this error and attach /tmp/bitmask-uninstall.log" ); } |