diff --git a/src/globals.py b/src/globals.py index f3388f2..ad977f7 100644 --- a/src/globals.py +++ b/src/globals.py @@ -1 +1 @@ -VERSION = "v0.4.0" +VERSION = "v0.4.1" diff --git a/src/system/update.py b/src/system/update.py index 2b15898..9d3eae2 100644 --- a/src/system/update.py +++ b/src/system/update.py @@ -1,6 +1,7 @@ import subprocess import sys import re +import os import tempfile import requests import hashlib @@ -53,7 +54,12 @@ def update(release: GitRelease, asset: GitReleaseAsset): with open(p, "wb") as f: f.write(r.content) - if platform != "win32": + + if platform == "win32": + subprocess.Popen([p], creationflags=subprocess.CREATE_NEW_CONSOLE) + sys.exit(0) + else: subprocess.run(["chmod", "+x", p], shell=False) + os.execl(p, p) - subprocess.run([p], shell=sys.platform == "win32") + raise RuntimeError("This state should not be possible.")