summarylogtreecommitdiffstats
path: root/xdroid-installer.py
diff options
context:
space:
mode:
authorSamLukeYes2020-06-23 17:01:37 +0800
committerSamLukeYes2020-06-23 17:01:37 +0800
commit898e4f000196613d022823b7431c7af197b752ab (patch)
tree8ee1b446da05aa744ee78222a2b06459f65884a9 /xdroid-installer.py
parent796233bcaf7c6285dac0f6f6d89f34bbbe7e3c05 (diff)
downloadaur-898e4f000196613d022823b7431c7af197b752ab.tar.gz
update 4.0078-1
Diffstat (limited to 'xdroid-installer.py')
-rw-r--r--xdroid-installer.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/xdroid-installer.py b/xdroid-installer.py
new file mode 100644
index 000000000000..ed7ee6abbab5
--- /dev/null
+++ b/xdroid-installer.py
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+
+import os, sys
+
+try:
+ import easygui as eg
+ dialogs = True
+except:
+ dialogs = False
+
+uninstaller = '/opt/xdroid/remove-xdroid-launcher'
+
+def install():
+ sys.exit(os.system('tar -xzvf /opt/xdroid-installer/xdroid.tar.gz -C /tmp \
+ && /tmp/xDroidInstall-x86_64/install.sh'))
+
+if os.getuid == 0:
+ err = "Don't run this installer as root!"
+ if dialogs:
+ eg.msgbox(err, "Error!")
+ sys.exit(1)
+ else:
+ raise OSError(err)
+
+if os.path.isfile(uninstaller):
+
+ if dialogs:
+ option = eg.choicebox("Do you want to reinstall or uninstall xDroid?", "xDroid Installer",
+ choices=["Reinstall", "Uninstall"])
+ else:
+ option = "Uninstall"
+
+ if option == "Reinstall":
+ install()
+ else:
+ os.system(uninstaller)
+
+else:
+ install() \ No newline at end of file