diff --git a/setup.py b/setup.py index 747c4fc20886a867e1ff7c6a1d05327537a5421d_c2V0dXAucHk=..ece490b02a9b4eef512dbdb6e0b97b91f3a6c943_c2V0dXAucHk= 100644 --- a/setup.py +++ b/setup.py @@ -667,16 +667,51 @@ class buildhgexe(build_ext): description = 'compile hg.exe from mercurial/exewrapper.c' - LONG_PATHS_MANIFEST = """ - <?xml version="1.0" encoding="UTF-8" standalone="yes"?> - <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> - <application> - <windowsSettings - xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings"> - <ws2:longPathAware>true</ws2:longPathAware> - </windowsSettings> - </application> - </assembly>""" + LONG_PATHS_MANIFEST = """\ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> + <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> + <security> + <requestedPrivileges> + <requestedExecutionLevel + level="asInvoker" + uiAccess="false" + /> + </requestedPrivileges> + </security> + </trustInfo> + <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> + <application> + <!-- Windows Vista --> + <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> + <!-- Windows 7 --> + <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> + <!-- Windows 8 --> + <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> + <!-- Windows 8.1 --> + <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> + <!-- Windows 10 and Windows 11 --> + <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> + </application> + </compatibility> + <application xmlns="urn:schemas-microsoft-com:asm.v3"> + <windowsSettings + xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings"> + <ws2:longPathAware>true</ws2:longPathAware> + </windowsSettings> + </application> + <dependency> + <dependentAssembly> + <assemblyIdentity type="win32" + name="Microsoft.Windows.Common-Controls" + version="6.0.0.0" + processorArchitecture="*" + publicKeyToken="6595b64144ccf1df" + language="*" /> + </dependentAssembly> + </dependency> +</assembly> +""" def initialize_options(self): build_ext.initialize_options(self) @@ -776,6 +811,6 @@ exefname = self.compiler.executable_filename(self.hgtarget) fdauto, manfname = tempfile.mkstemp(suffix='.hg.exe.manifest') os.close(fdauto) - with open(manfname, 'w') as f: + with open(manfname, 'w', encoding="UTF-8") as f: f.write(self.LONG_PATHS_MANIFEST) log.info("long paths manifest is written to '%s'" % manfname) @@ -780,5 +815,4 @@ f.write(self.LONG_PATHS_MANIFEST) log.info("long paths manifest is written to '%s'" % manfname) - inputresource = '-inputresource:%s;#1' % exefname outputresource = '-outputresource:%s;#1' % exefname log.info("running mt.exe to update hg.exe's manifest in-place") @@ -783,10 +817,9 @@ outputresource = '-outputresource:%s;#1' % exefname log.info("running mt.exe to update hg.exe's manifest in-place") - # supplying both -manifest and -inputresource to mt.exe makes - # it merge the embedded and supplied manifests in the -outputresource + self.spawn( [ self.compiler.mt, '-nologo', '-manifest', manfname, @@ -787,10 +820,9 @@ self.spawn( [ self.compiler.mt, '-nologo', '-manifest', manfname, - inputresource, outputresource, ] )