diff options
author | Niklas Claesson <niklas.claesson@cosylab.com> | 2017-09-12 09:40:16 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-09-12 20:31:02 +0300 |
commit | fcbefafa1fc22059d317c72dad9f97e6519b25e6 (patch) | |
tree | 482a2210ec075f9f31452d35f7f38158dee96eff | |
parent | e5e060a6b7c18a2853c98f1775a6116c0c01f63e (diff) | |
download | meson-fcbefafa1fc22059d317c72dad9f97e6519b25e6.zip meson-fcbefafa1fc22059d317c72dad9f97e6519b25e6.tar.gz meson-fcbefafa1fc22059d317c72dad9f97e6519b25e6.tar.bz2 |
MSI: Improve python detection
-rwxr-xr-x | msi/createmsi.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/msi/createmsi.py b/msi/createmsi.py index 921e2ac..13b4081 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', |