From fcbefafa1fc22059d317c72dad9f97e6519b25e6 Mon Sep 17 00:00:00 2001 From: Niklas Claesson Date: Tue, 12 Sep 2017 09:40:16 +0200 Subject: MSI: Improve python detection --- msi/createmsi.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/msi/createmsi.py b/msi/createmsi.py index 921e2ac5b..13b408135 100755 --- a/msi/createmsi.py +++ b/msi/createmsi.py @@ -77,8 +77,16 @@ class PackageGenerator: modules = [os.path.splitext(os.path.split(x)[1])[0] for x in glob(os.path.join('mesonbuild/modules/*'))] modules = ['mesonbuild.modules.' + x for x in modules if not x.startswith('_')] modulestr = ','.join(modules) - subprocess.check_call(['c:\\Python\python.exe', - 'c:\\Python\Scripts\\cxfreeze', + python = 'c:\\Python\python.exe' + if sys.executable: + python = sys.executable + cxfreeze = os.path.join(os.path.dirname(python), "Scripts", "cxfreeze") + if not os.path.isfile(cxfreeze): + print("ERROR: This script requires cx_freeze module") + sys.exit(1) + + subprocess.check_call([python, + cxfreeze, '--target-dir', main_stage, '--include-modules', @@ -214,6 +222,9 @@ class PackageGenerator: wixdir = 'c:\\Program Files\\Wix Toolset v3.11\\bin' if not os.path.isdir(wixdir): wixdir = 'c:\\Program Files (x86)\\Wix Toolset v3.11\\bin' + if not os.path.isdir(wixdir): + print("ERROR: This script requires WIX") + sys.exit(1) subprocess.check_call([os.path.join(wixdir, 'candle'), self.main_xml]) subprocess.check_call([os.path.join(wixdir, 'light'), '-ext', 'WixUIExtension', -- cgit v1.2.3