mirror of
https://github.com/9001/copyparty.git
synced 2025-08-16 16:42:13 -06:00
slightly better pyinstaller loader
This commit is contained in:
parent
95566e8388
commit
7c1d97af3b
|
@ -106,20 +106,19 @@ def meichk():
|
|||
if filt not in sys.executable:
|
||||
filt = os.path.basename(sys.executable)
|
||||
|
||||
pids = []
|
||||
ptn = re.compile(r"^([^\s]+)\s+([0-9]+)")
|
||||
hits = []
|
||||
try:
|
||||
procs = sp.check_output("tasklist").decode("utf-8", "replace")
|
||||
cmd = "tasklist /fo csv".split(" ")
|
||||
procs = sp.check_output(cmd).decode("utf-8", "replace")
|
||||
except:
|
||||
procs = "" # winpe
|
||||
|
||||
for ln in procs.splitlines():
|
||||
m = ptn.match(ln)
|
||||
if m and filt in m.group(1).lower():
|
||||
pids.append(int(m.group(2)))
|
||||
for ln in procs.split("\n"):
|
||||
if filt in ln.split('"')[:2][-1]:
|
||||
hits.append(ln)
|
||||
|
||||
mod = os.path.dirname(os.path.realpath(__file__))
|
||||
if os.path.basename(mod).startswith("_MEI") and len(pids) == 2:
|
||||
if os.path.basename(mod).startswith("_MEI") and len(hits) == 2:
|
||||
meicln(mod)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue