From 8d27403228b0782e135d5c5d5d97ec54785cfae3 Mon Sep 17 00:00:00 2001 From: kali Date: Fri, 2 Oct 2020 21:31:04 +0200 Subject: [pkg] osx uninstall, autolaunch --- .../packages/bitmaskvpn/meta/install.js | 39 +++++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'branding/templates/qtinstaller/packages') diff --git a/branding/templates/qtinstaller/packages/bitmaskvpn/meta/install.js b/branding/templates/qtinstaller/packages/bitmaskvpn/meta/install.js index f9c85f2..0bcaeef 100644 --- a/branding/templates/qtinstaller/packages/bitmaskvpn/meta/install.js +++ b/branding/templates/qtinstaller/packages/bitmaskvpn/meta/install.js @@ -27,23 +27,44 @@ Component.prototype.createOperations = function () } } +Component.prototype.installationFinished = function() +{ + console.log("DEBUG: running installationFinished"); + if (installer.isInstaller() && installer.status == QInstaller.Success) { + var argList = ["-a", "@TargetDir@/DemoLibVPN.app"]; + try { + installer.execute("touch", ["/tmp/install-finished"]); + installer.execute("open", argList); + } catch(e) { + console.log(e); + } + } +} + function postInstallWindows() { - component.addOperation( - "CreateShortcut", - "@TargetDir@/README.txt", - "@StartMenuDir@/README.lnk", - "workingDirectory=@TargetDir@", - "iconPath=%SystemRoot%/system32/SHELL32.dll", - "iconId=2"); + component.addElevatedOperation("Execute", "@TargetDir@/helper.exe", "install", "UNDOEXECUTE", "@TargetDir@/helper.exe", "remove"); + component.addElevatedOperation("Execute", "@TargetDir@/helper.exe", "start", "UNDOEXECUTE", "@TargetDir@/helper.exe", "stop"); + console.log("Adding shortcut entries"); + component.addElevatedOperation("Mkdir", "@StartMenuDir@"); + component.addElevatedOperation("CreateShortcut", "@TargetDir@/demolib-vpn.exe", "@StartMenuDir@/DemoLibVPN.lnk", "workingDirectory=@TargetDir@", "iconPath=@TargetDir@/icon.ico", "description=Start DemoLibVPN"); + + // TODO I think this one is not being created because the path doesn't exist yet. We might want to do this by hooking on the installation finished signal instead. + component.addElevatedOperation( + "CreateShortcut", + "@TargetDir@/Uninstall-DemoLibVPN.exe", + "@StartMenuDir@/Uninstall.lnk" + ); } function postInstallOSX() { 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."); + "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.", + "UNDOEXECUTE", + "@TargetDir@/uninstall.py" + ); } function postInstallLinux() { -- cgit v1.2.3