Correction: Opening the file in 'wb' (write binary) mode will not work, because I read the file. It should be:

spec_file = open('C:\\path\\to\\file.spec', 'r+b')

Also note that spec_file.seek(0) followed by spec_file.write() is only safe because we know for sure the new contents are longer than the old contents. If the new contents were shorter than the old contents, then we would end up with junk at the end of the file.

Also note that msvcp110.dll is the Visual C++ 2012 runtime environment, but it is just for C++ code. C code compiled with the same compiler requires msvcr110.dll.

Zak Fallows

On 2/4/13 12:18 PM, Zak wrote:
Hello David,

Your suspicion is correct, you modify the .spec file. I like to use Python to modify the .spec file:

spec_file = open('C:\\path\\to\\file.spec', 'wb')
spec_contents = spec_file.read()

new_contents = spec_contents.replace(
    'a.binaries',
    """a.binaries + [
        ('msvcp110.dll',
         'C:\\path\\to\\msvcp110.dll',
         'BINARY')]""")

spec_file.seek(0)
spec_file.write(new_contents)
spec_file.close()

I put the code above into a file called make.py. make.py is a little command-line script that automates the build process, just like GNU Make. make.py calls PyInstaller using subprocess.call().

Zak F.

On 2/4/13 8:53 AM, Ram wrote:

How do I tell pyinstaller (using a spec file?) that Visual C++ 2012 redistributables should be bundled with my application? In my Application.exe.manifest, I only see VC90.

Thanks,
--David

--
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyinstaller?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to