-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstaller.py
50 lines (37 loc) · 1.49 KB
/
installer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import os
import subprocess
import shlex
class RootRequiredError(RuntimeError):
pass
class BinaryExistsException(Exception):
pass
class NotAcceptedException(Exception):
pass
try:
if os.getuid() != 0:
raise RootRequiredError
if os.path.isfile('/var/lib/flatpak/exports/bin/xivomega'):
raise BinaryExistsException
print("*************************************")
print("RUN THIS ONLY IF USING FROM STEAM DECK!")
print("If using from Linux, just run 'sudo ./run.py'")
print("*************************************")
print("Welcome to the installer for XIVOmega")
print("This will install the binary for xivomega on /var/lib/flatpak/exports/bin")
print("This is done to avoid SteamOS wiping the binary when upadting the firmware")
ins = input("Please confirm installation (Y/N):\n")
if ins.lower() == "n":
raise NotAcceptedException
else:
app_path = os.getcwd() + "/run.py"
os.chmod(app_path, 0o777)
subprocess.run(shlex.split("cp " + app_path + " /var/lib/flatpak/exports/bin/xivomega"))
print("Binary successfully installed to /var/lib/flatpak/exports/bin/xivomega")
print("To run program, type 'sudo xivomega'.")
except RootRequiredError:
print("This program requires root permissions - use sudo")
except BinaryExistsException:
print("Binary executable already installed.")
except NotAcceptedException:
print("Installation not accepted. Good Bye")
#/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl