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.
This commit is contained in:
parent
612371dcb3
commit
0bc9c919e8
|
@ -249,6 +249,9 @@ class bdist_wininst (Command):
|
||||||
if self.pre_install_script:
|
if self.pre_install_script:
|
||||||
script_data = open(self.pre_install_script, "r").read()
|
script_data = open(self.pre_install_script, "r").read()
|
||||||
cfgdata = cfgdata + script_data + "\n\0"
|
cfgdata = cfgdata + script_data + "\n\0"
|
||||||
|
else:
|
||||||
|
# empty pre-install script
|
||||||
|
cfgdata = cfgdata + "\0"
|
||||||
file.write(cfgdata)
|
file.write(cfgdata)
|
||||||
header = struct.pack("<iii",
|
header = struct.pack("<iii",
|
||||||
0x1234567A, # tag
|
0x1234567A, # tag
|
||||||
|
@ -261,8 +264,11 @@ class bdist_wininst (Command):
|
||||||
# create_exe()
|
# create_exe()
|
||||||
|
|
||||||
def get_exe_bytes (self):
|
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__)
|
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()
|
return open(filename, "rb").read()
|
||||||
# class bdist_wininst
|
# class bdist_wininst
|
||||||
|
|
Loading…
Reference in New Issue