diff options
author | kali <kali@leap.se> | 2020-10-02 21:31:04 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2020-10-13 19:08:47 +0200 |
commit | 8d27403228b0782e135d5c5d5d97ec54785cfae3 (patch) | |
tree | f0e535a06ebc6ecb65acf557ebfcc8fae5ed922b /branding/templates/qtinstaller/packages | |
parent | 0a432c12feb280b72ed17714bbd3a9d518c9308a (diff) |
[pkg] osx uninstall, autolaunch
Diffstat (limited to 'branding/templates/qtinstaller/packages')
-rw-r--r-- | branding/templates/qtinstaller/packages/bitmaskvpn/meta/install.js | 39 |
1 files changed, 30 insertions, 9 deletions
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() { |