summaryrefslogtreecommitdiff
path: root/branding/templates/qtinstaller/osx-data/uninstall.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2020-12-02 21:46:06 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-02-08 23:32:12 +0100
commitf5e7a5d2cab5fc3cfca8c5f75e57090cda27c4e1 (patch)
tree256ab35abca7e1995a0fb349167ddf86ca37fa51 /branding/templates/qtinstaller/osx-data/uninstall.py
parentee566492264882b5024876180113d4800a29dbda (diff)
[pkg] add uninstaller to pre-install in osx
Diffstat (limited to 'branding/templates/qtinstaller/osx-data/uninstall.py')
-rwxr-xr-xbranding/templates/qtinstaller/osx-data/uninstall.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/branding/templates/qtinstaller/osx-data/uninstall.py b/branding/templates/qtinstaller/osx-data/uninstall.py
index 7aa8a56..7520321 100755
--- a/branding/templates/qtinstaller/osx-data/uninstall.py
+++ b/branding/templates/qtinstaller/osx-data/uninstall.py
@@ -12,8 +12,9 @@ HELPER_PLIST = "/Library/LaunchDaemons/se.leap.bitmask-helper.plist"
_dir = os.path.dirname(os.path.realpath(__file__))
-def main():
- log = open(os.path.join('/tmp', 'bitmask-uninstall.log'), 'w')
+def main(stage="uninstall"):
+ logfile = "bitmask-{stage}.log".format(stage=stage)
+ log = open(os.path.join('/tmp', logfile), 'w')
log.write('Checking for admin privileges...\n')
_id = os.getuid()
@@ -37,7 +38,7 @@ def main():
log.write("result: %s \n" % str(out))
# all done
- log.write('uninstall script: done\n')
+ log.write(stage + ' script: done\n')
sys.exit(0)
@@ -67,4 +68,7 @@ def _getProcessList():
return _out
if __name__ == "__main__":
- main()
+ stage="uninstall"
+ if len(sys.argv) > 2 and sys.argv[2] == "pre":
+ stage="pre-install"
+ main(stage)