Main.py: check if Uninstall.exe exists before importing commandline and other modules

This commit is contained in:
Jose Manuel Delicado 2016-01-20 09:18:27 +01:00
parent c830d4b5b4
commit 08a2eca98d

View File

@ -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')