Private GIT

Skip to content
Snippets Groups Projects
Commit 1d26e52f authored by Nic Wolfe's avatar Nic Wolfe
Browse files

Fix the updater to work for Win XP and non-english windows (hopefully)

parent c5e43382
No related branches found
No related tags found
No related merge requests found
...@@ -19,16 +19,16 @@ def isProcRunning(pid): ...@@ -19,16 +19,16 @@ def isProcRunning(pid):
p = subprocess.Popen(tasklist_cmd, stdout=subprocess.PIPE) p = subprocess.Popen(tasklist_cmd, stdout=subprocess.PIPE)
out, err = p.communicate() out, err = p.communicate()
for line in out.split('\n'): results = out.split('\r\n')
# Win 7
if 'INFO: No tasks are running which match the specified criteria.' in line: regex = '".*\\.exe","'+str(pid)+'",("[^"]*",?){3}'
return False
# Win XP
elif 'INFO: No tasks running with the specified criteria.' in line:
return False
for cur_line in results:
if re.match(regex, cur_line, re.I):
return True return True
return False
if len(sys.argv) < 3: if len(sys.argv) < 3:
log("Invalid call.") log("Invalid call.")
sys.exit() sys.exit()
...@@ -85,12 +85,12 @@ try: ...@@ -85,12 +85,12 @@ try:
if os.path.isdir(sb_update_dir): if os.path.isdir(sb_update_dir):
shutil.rmtree(sb_update_dir) shutil.rmtree(sb_update_dir)
if log_file:
log_file.close()
# re-launch SB # re-launch SB
p = subprocess.Popen(sb_executable, cwd=os.getcwd()) p = subprocess.Popen(sb_executable, cwd=os.getcwd())
except Exception, e: except Exception, e:
log("Exception while updating: "+str(e)) log("Exception while updating: "+str(e))
raise raise
if log_file:
log_file.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment