Antony,
if there's an official Microsoft tool to embed a manifest within an
executable, you should be able to run it onto the frozen executable
without problems. If you want to modify PyInstaller once for all for
this, you can run the same tool onto the bootloader executables (within
the support/loader directory). Of course, you will need to do the same
anytime you upgrade PyInstaller.
Otherwise, if you feel like contributing, you could leverage the
existing PyInstaller code that modifies an executable resource to add a
custom icon, so that it is able to also change the manifest, and
integrate this within the standard build flow. Let me know if you need
some guidance with this.
--
Giovanni Bajo
Develer S.r.l.
http://www.develer.com
> Thank you for the quick response.
> Microsoft recommends using mt.exe to embed the manifest file into the
> binary.
> I tried it, and found that it renders the python binary unusable! In
> other words, the frozen python exe does not execute.
I see. Probably, mt.exe strips data attacched to the executable.
> 1) You have suggested updating the bootloader exes in support/loader
> directory. I see many exes there, and presume them tobe debug console,
> and windows and release console and windows. Apart from this, the exes
> are named run_6*.exe and run_7*.exe.
> Could you please let me know which are the ones used by pyinstaller?
> And why exes with 6 and 7 numbers in their names?
They're for different Python versions. "6" means "Visual C++ 6", which
means Python 2.3 and below. "7" means "Visual C++ 7" which means Python
2.4 and above.
> 2) I'll explore the possibility of leveraging the existing icon change
> code, so that one could change the manifest as well.
OK let me know if you need any help with this.
> I thought that leveraging the icon code is a better solution, and made
> changes accordingly:
Can you please put this into the issue tracker, so it will not get lost.
Mind leaving your name, so we can credit this to you. Thanks.
> Please let me know whether these changes are ok.
If they work, it's fine :-)
--
Schönen Gruß - Regards
Hartmut Goebel
Goebel Consult
Spezialist für IT-Sicherheit in komplexen Umgebungen
http://www.goebel-consult.de
> My frozen exe, which is 991KB in size, becomes 48KB after I run it
> through mt.exe!
Yes: probably mt.exe strips data attached to the executable.
I don't like the magic of checking for a specific file in the current
directory. A better approach is to add a new argument to ELFEXE, which
is the filename of the manifest to be added (or None - default - if
none); then, at the correct point, just embed the manifest if asked to do.
After this, you need a simple modification to Makespec.py to add a new
command line argument, and generate a .spec file with the specified
manifest. This makes it easier for people to embed manifests into the
executable.
To do these modifications, you can just look at the way icons are
handled and do the same for the manifest.
I would also appreciate a patch to the manual (doc/manual.txt) that
specifies the new option and how to use it.
Sure, that's fine.
One thing: how do people usually write manifests? Are they generated by
Visual Studio? Do they hand-code them? Do they use wizards?