From 08a2eca98d9d7fb7c19d7dc2bf79259824aab177 Mon Sep 17 00:00:00 2001 From: Jose Manuel Delicado Date: Wed, 20 Jan 2016 09:18:27 +0100 Subject: [PATCH] Main.py: check if Uninstall.exe exists before importing commandline and other modules --- src/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index b10c623d..708097a2 100644 --- a/src/main.py +++ b/src/main.py @@ -14,6 +14,9 @@ if system == "Windows": sys.stderr = open(os.path.join(os.getenv("temp"), "stderr.log"), "w") import languageHandler import paths +#check if TWBlue is installed (Windows only) +if os.path.exists(paths.app_path(u"Uninstall.exe")): + paths.mode="installed" import commandline import config import sound @@ -32,9 +35,6 @@ if system == "Windows": from update import updater stdout_temp=sys.stdout stderr_temp=sys.stderr -#check if TWBlue is installed - if os.path.exists(paths.app_path(u"Uninstall.exe")): - paths.mode="installed" #if it's a binary version if hasattr(sys, 'frozen'): sys.stderr = open(paths.logs_path("stderr.log"), 'w')