Commits

Anonymous committed 814ad61

#443 fix processorArchitecture in manifest files for 64bit win

git-svn-id: file:///tmp/pyinstaller-svn/trunk@1719 6d373633-9ee7-468a-befa-14b9e37bb2df

Comments (0)

Files changed (2)

PyInstaller/build.py

             depmanifest = None
         else:
             depmanifest = winmanifest.Manifest(type_="win32", name=specnm,
-                                               processorArchitecture="x86",
+                                               processorArchitecture=winmanifest.processor_architecture(),
                                                version=(1, 0, 0, 0))
             depmanifest.filename = os.path.join(BUILDPATH,
                                                 specnm + ".exe.manifest")
                                                 "assemblies of %r",
                                                 pydep.name, cachedfile)
                                     manifest.dependentAssemblies.append(pydep)
-                                    _depNames.append(pydep.name)
+                                    _depNames.update(pydep.name)
                             if len(manifest.dependentAssemblies) > olen:
                                 try:
                                     manifest.update_resources(os.path.abspath(cachedfile),

PyInstaller/utils/winmanifest.py

 from xml.dom import Node, minidom
 from xml.dom.minidom import Document, Element
 
-from PyInstaller.compat import hashlib
+from PyInstaller.compat import hashlib, architecture
 from PyInstaller import log as logging
 logger = logging.getLogger('PyInstaller.build.winmanifest')
 
             Manifest(type_="win32",
                  name="Microsoft.Windows.Common-Controls",
                  language="*",
-                 processorArchitecture="x86",
+                 processorArchitecture=processor_architecture(),
                  version=(6, 0, 0, 0),
                  publicKeyToken="6595b64144ccf1df")
             )
     return manifest
 
 
+def processor_architecture():
+    """
+    Detect processor architecture for assembly manifest.
+
+    According to:
+    http://msdn.microsoft.com/en-us/library/windows/desktop/aa374219(v=vs.85).aspx
+    item processorArchitecture in assembly manifest is
+
+    'x86' - 32bit Windows
+    'amd64' - 64bit Windows
+    """
+    return 'x86' if architecture() == '32bit' else 'amd64'
+
+
 if __name__ == "__main__":    
     dstpath = sys.argv[1]
     srcpath = sys.argv[2]