-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathlaunch_gw2_with_rpc.py
41 lines (32 loc) · 1.11 KB
/
launch_gw2_with_rpc.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
import ctypes
import os.path
import subprocess
rpc_path = "gw2rpc.exe"
gw2_64_path = "../../Gw2-64.exe"
gw2_path = "../../Gw2.exe"
tasklist = subprocess.check_output(['tasklist'], shell=True)
def Mbox(title, text, style):
return ctypes.windll.user32.MessageBoxW(0, text, title, style)
def check_gw():
if os.path.isfile(gw2_64_path):
if b"Gw2-64.exe" not in tasklist:
subprocess.Popen([gw2_64_path])
print("Started 64")
elif os.path.isfile(gw2_path):
if b"Gw2.exe" not in tasklist:
subprocess.Popen([gw2_path])
print("Started 32")
else:
Mbox('Error', 'Gw2 not found. Please move the RPC files into '
'addons\RPC\ in your GW2 installation folder.', 0)
def check_rpc():
if os.path.isfile(rpc_path):
if b"gw2rpc.exe" not in tasklist:
subprocess.Popen([rpc_path])
print("Started rpc")
else:
Mbox('Error', 'gw2rpc.exe not found. Please move the RPC files into '
'addons\RPC\ in your GW2 installation folder.', 0)
if __name__ == "__main__":
check_gw()
check_rpc()