mirror of
https://gitlab.os-k.eu/neox/CNIRevelator.git
synced 2023-08-25 14:03:10 +02:00
Finished work on Update System
This commit is contained in:
parent
3113a1486c
commit
a101664f6e
15
src/test.py
Normal file
15
src/test.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import globs
|
||||||
|
import psutil
|
||||||
|
import os
|
||||||
|
|
||||||
|
for process in psutil.process_iter():
|
||||||
|
if process.name() == 'CNIRevelator.exe':
|
||||||
|
print('Process found. Command line: {}'.format(process.cmdline()))
|
||||||
|
if True:
|
||||||
|
print(process.pid)
|
||||||
|
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
print('Terminating process !')
|
||||||
|
#process.terminate()
|
||||||
|
break
|
@ -140,6 +140,7 @@ def batch():
|
|||||||
|
|
||||||
launcherWindow.printmsg('Verifying download...')
|
launcherWindow.printmsg('Verifying download...')
|
||||||
|
|
||||||
|
# CHECKSUM
|
||||||
BUF_SIZE = 65536 # lets read stuff in 64kb chunks!
|
BUF_SIZE = 65536 # lets read stuff in 64kb chunks!
|
||||||
|
|
||||||
sha1 = hashlib.sha1()
|
sha1 = hashlib.sha1()
|
||||||
@ -218,16 +219,18 @@ def umain():
|
|||||||
launcherWindow.printmsg('Fail :{}'.format(e))
|
launcherWindow.printmsg('Fail :{}'.format(e))
|
||||||
try:
|
try:
|
||||||
for process in psutil.process_iter():
|
for process in psutil.process_iter():
|
||||||
logfile.printdbg(str(process.cmdline()))
|
if process.name() == 'CNIRevelator.exe':
|
||||||
# if process.cmdline() == ['CNIRevelator.exe', '']:
|
logfile.printdbg('Process found. Command line: {}'.format(process.cmdline()))
|
||||||
# print('Process found. Terminating it.')
|
if process.pid == os.getpid():
|
||||||
# process.terminate()
|
logfile.printdbg("Don't touch us ! {} = {}".format(process.pid, os.getpid()))
|
||||||
# break
|
else:
|
||||||
else:
|
logfile.printdbg('Terminating process !')
|
||||||
logfile.printerr('Process not found')
|
process.terminate()
|
||||||
|
break
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logfile.printerr(str(e))
|
logfile.printerr(str(e))
|
||||||
launcherWindow.printmsg('Fail :{}'.format(e))
|
launcherWindow.printmsg('Fail :{}'.format(e))
|
||||||
|
launcherWindow.printmsg('Starting...')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user