summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command/bdist_wininst.py
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2004-02-20 19:38:50 (GMT)
committerThomas Heller <theller@ctypes.org>2004-02-20 19:38:50 (GMT)
commit0bc9c919e80f0a1b2815ca98d273251fb344067a (patch)
tree32c9aca42cb72dbd9fba4b67841ade8d38be1655 /Lib/distutils/command/bdist_wininst.py
parent612371dcb3aa9c91a80dc09b36001aee3702f6e1 (diff)
downloadcpython-0bc9c919e80f0a1b2815ca98d273251fb344067a.zip
cpython-0bc9c919e80f0a1b2815ca98d273251fb344067a.tar.gz
cpython-0bc9c919e80f0a1b2815ca98d273251fb344067a.tar.bz2
Use the right wininstXX.exe, depending on
msvccompiler.get_build_version(). Distributions without a pre-install-script didn't work any longer, we must at least provide the terminating NUL character.
Diffstat (limited to 'Lib/distutils/command/bdist_wininst.py')
-rw-r--r--Lib/distutils/command/bdist_wininst.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/distutils/command/bdist_wininst.py b/Lib/distutils/command/bdist_wininst.py
index 76b1762..324ce31 100644
--- a/Lib/distutils/command/bdist_wininst.py
+++ b/Lib/distutils/command/bdist_wininst.py
@@ -249,6 +249,9 @@ class bdist_wininst (Command):
if self.pre_install_script:
script_data = open(self.pre_install_script, "r").read()
cfgdata = cfgdata + script_data + "\n\0"
+ else:
+ # empty pre-install script
+ cfgdata = cfgdata + "\0"
file.write(cfgdata)
header = struct.pack("<iii",
0x1234567A, # tag
@@ -261,8 +264,11 @@ class bdist_wininst (Command):
# create_exe()
def get_exe_bytes (self):
- # wininst.exe is in the same directory as this file
+ from distutils.msvccompiler import get_build_version
+ # wininst-x.y.exe is in the same directory as this file
directory = os.path.dirname(__file__)
- filename = os.path.join(directory, "wininst.exe")
+ # we must use a wininst-x.y.exe built with the same C compiler
+ # used for python. XXX What about mingw, borland, and so on?
+ filename = os.path.join(directory, "wininst-%s.exe" % get_build_version())
return open(filename, "rb").read()
# class bdist_wininst