1
0
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:
Adrien Bourmault 2019-07-11 10:30:12 +02:00 committed by GitHub
parent 3113a1486c
commit a101664f6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 7 deletions

15
src/test.py Normal file
View 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

View File

@ -140,6 +140,7 @@ def batch():
launcherWindow.printmsg('Verifying download...')
# CHECKSUM
BUF_SIZE = 65536 # lets read stuff in 64kb chunks!
sha1 = hashlib.sha1()
@ -218,16 +219,18 @@ def umain():
launcherWindow.printmsg('Fail :{}'.format(e))
try:
for process in psutil.process_iter():
logfile.printdbg(str(process.cmdline()))
# if process.cmdline() == ['CNIRevelator.exe', '']:
# print('Process found. Terminating it.')
# process.terminate()
# break
else:
logfile.printerr('Process not found')
if process.name() == 'CNIRevelator.exe':
logfile.printdbg('Process found. Command line: {}'.format(process.cmdline()))
if process.pid == os.getpid():
logfile.printdbg("Don't touch us ! {} = {}".format(process.pid, os.getpid()))
else:
logfile.printdbg('Terminating process !')
process.terminate()
break
except Exception as e:
logfile.printerr(str(e))
launcherWindow.printmsg('Fail :{}'.format(e))
launcherWindow.printmsg('Starting...')
try:
try: