I think I can help with the manifests.
I wrote a web page on them 
http://jesusnjim.com/code/compilers/mingw.html#manifest

I also have some batch files on that page which automatically make manifests 
for programs, and they work.  you can look at the source of the batch file to 
see how they work.
essentially, 2 things need to be done.
manifest XML windows resources are windows resources like any windows resource 
that are compiled and linked into the executable.  you don't have to use mt.exe 
to do it, you can use mingw-w64 if you want.
you can also do it with cygwin.

a basic cross-platform manifest (9x+) looks like this:
call the following file libgcc_s_sjlj-1.dll.manifest
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
<ms_asmv2:trustInfo xmlns:ms_asmv2="urn:schemas-microsoft-com:asm.v2"> 
<ms_asmv2:security> <ms_asmv2:requestedPrivileges> 
<ms_asmv2:requestedExecutionLevel level="asInvoker"> 
</ms_asmv2:requestedExecutionLevel> </ms_asmv2:requestedPrivileges> 
</ms_asmv2:security> </ms_asmv2:trustInfo>
</assembly>then you make a libgcc_s_sjlj-1.rc file for this resource.
#include "winuser.h"
2 RT_MANIFEST "libgcc_s_sjlj-1.dll.manifest"


the resource file is actually not necessary, but it is recommended.  the 
.manifest file must be in the same directory as the dll (or .exe).
then compile the .rc file:
windres --input=libgcc_s_sjlj-1.rc --input-format=rc 
--output=libgcc_s_sjlj-1.res --output-format=coff

then compile it into your program.

gcc -shared -o libgcc_s_sjlj-1.dll something.clibgcc_s_sjlj-1.res

I have been making windows vista/7/8-compatible executables with mingw-w64 and 
other compilers for quite a while now.
manifests are finicky.  get something wrong and your app will not execute, you 
will get some sort of error from the OS (different kinds, depending on what you 
did).  for instance, you CANNOT add a version number to the above basic 
manifest.  XP will not run it.  but you can do a different layout with assembly 
version numbers for vista+ (unfortunately).  windows 2000/xp users would have 
to suffer.

I suggest that you use the above manifest.  you are allowed the flexibility of 
modifying the 


if you have toinclude msvcrt.dll, then look at this article.
http://cournape.wordpress.com/2008/09/02/how-to-embed-a-manifest-into-a-dll-with-mingw-tools-only/




this was pulled from my batch file, which makes the actual manifests for vista 
and up (doesn't work on XP and below).  it uses variable expansion (%var%).
^ is the escape character in the cmd shell.
there are features which I am experimenting with still.



-----------------------------------this is a 32-bit manifest


    echo -----creating 32-bit vista+ manifest...
    echo ^<?xml version="1.0" encoding="UTF-8" 
standalone="yes"?^>>32\%outfile%.%extension%.manifest
    echo ^<assembly xmlns="urn:schemas-microsoft-com:asm.v1" 
manifestVersion="1.0"^>>>32\%outfile%.%extension%.manifest
    echo     ^<assemblyIdentity>>32\%outfile%.%extension%.manifest
    echo         
version="%manifest_assyver%.!_%outfile%_buildnum!">>32\%outfile%.%extension%.manifest
    echo         
processorArchitecture="%procarch32%">>32\%outfile%.%extension%.manifest
    echo         name="%manifest_assyname%">>32\%outfile%.%extension%.manifest
    echo         type="win32">>32\%outfile%.%extension%.manifest
    echo     /^>>>32\%outfile%.%extension%.manifest
rem     rem -----compatibility mode section added 2/10/2012
rem     echo     ^<compatibility 
xmlns="urn:schemas-microsoft-com:compatibility.v1"^>>>32\%outfile%.%extension%.manifest
rem     echo       ^<application^>>>32\%outfile%.%extension%.manifest
rem     echo             ^<!--The ID below indicates application support for 
Windows Vista --^>>>32\%outfile%.%extension%.manifest
rem     echo             ^<supportedOS 
Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/^>>>32\%outfile%.%extension%.manifest
rem     echo             ^<!--The ID below indicates application support for 
Windows 7 --^>>>32\%outfile%.%extension%.manifest
rem     echo             ^<supportedOS 
Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/^>>>32\%outfile%.%extension%.manifest
rem     echo         ^</application^>>>32\%outfile%.%extension%.manifest
rem     echo     ^</compatibility^>>>32\%outfile%.%extension%.manifest
    echo     
^<description^>%manifest_apptitle%^</description^>>>32\%outfile%.%extension%.manifest
    echo     ^<!-- Identify the application security requirements. 
--^>>>32\%outfile%.%extension%.manifest
    echo     ^<ms_asmv2:trustInfo 
xmlns:ms_asmv2="urn:schemas-microsoft-com:asm.v2"^>>>32\%outfile%.%extension%.manifest
    echo         ^<ms_asmv2:security^>>>32\%outfile%.%extension%.manifest
    echo             
^<ms_asmv2:requestedPrivileges^>>>32\%outfile%.%extension%.manifest
    echo                 ^<ms_asmv2:requestedExecutionLevel 
level="%manifest_executionlevel%" 
uiAccess="%manifest_uiaccess%"^>>>32\%outfile%.%extension%.manifest
    echo                 
^</ms_asmv2:requestedExecutionLevel^>>>32\%outfile%.%extension%.manifest
    echo             
^</ms_asmv2:requestedPrivileges^>>>32\%outfile%.%extension%.manifest
    echo         ^</ms_asmv2:security^>>>32\%outfile%.%extension%.manifest
    echo     ^</ms_asmv2:trustInfo^>>>32\%outfile%.%extension%.manifest
rem     rem -----dependency side-by-side assembly section added 2-11-2012
rem     echo     ^<dependency^>>>32\%outfile%.%extension%.manifest
rem     echo         ^<dependentAssembly^>>>32\%outfile%.%extension%.manifest
rem     echo             ^<assemblyIdentity 
type="win32">>32\%outfile%.%extension%.manifest
rem     echo                     
name="%manifest_assyname%">>32\%outfile%.%extension%.manifest
rem     echo                     
version="%manifest_assyver%">>32\%outfile%.%extension%.manifest
rem     echo                          
processorArchitecture="X86">>32\%outfile%.%extension%.manifest
rem     rem echo                          
publicKeyToken="0000000000000000">>32\%outfile%.%extension%.manifest
rem     echo                     
language="en-US">>32\%outfile%.%extension%.manifest
rem     echo             /^>>>32\%outfile%.%extension%.manifest
rem     echo             ^<file 
name="msvcrt.dll"/^>>>32\%outfile%.%extension%.manifest
rem     echo             ^<file 
name="%gpp64gccdll%"/^>>>32\%outfile%.%extension%.manifest
rem     echo             ^<file 
name="%gpp64cppdll%"/^>>>32\%outfile%.%extension%.manifest
rem     echo         ^</dependentAssembly^>>>32\%outfile%.%extension%.manifest
rem     echo     ^</dependency^>>>32\%outfile%.%extension%.manifest
    echo ^</assembly^>>>32\%outfile%.%extension%.manifest



-----------------------------this is a 64-bit manifest



    echo -----creating 64-bit vista+ manifest...
    echo ^<?xml version="1.0" encoding="UTF-8" 
standalone="yes"?^>>64\%outfile%.%extension%.manifest
    echo ^<assembly xmlns="urn:schemas-microsoft-com:asm.v1" 
manifestVersion="1.0"^>>>64\%outfile%.%extension%.manifest
    echo     ^<assemblyIdentity>>64\%outfile%.%extension%.manifest
    echo         
version="%manifest_assyver%.!_%outfile%_buildnum!">>64\%outfile%.%extension%.manifest
    echo         
processorArchitecture="%procarch64%">>64\%outfile%.%extension%.manifest
    echo         name="%manifest_assyname%">>64\%outfile%.%extension%.manifest
    echo         type="win32">>64\%outfile%.%extension%.manifest
    echo     /^>>>64\%outfile%.%extension%.manifest
rem     rem -----compatibility mode section added 2-11-2012.
rem     echo     ^<compatibility 
xmlns:v1="urn:schemas-microsoft-com:compatibility.v1"^>>>64\%outfile%.%extension%.manifest
rem     echo         ^<application^>>>64\%outfile%.%extension%.manifest
rem     echo             ^<!--The ID below indicates application support for 
Windows Vista --^>>>64\%outfile%.%extension%.manifest
rem     echo             ^<supportedOS 
Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/^>>>64\%outfile%.%extension%.manifest
rem     echo             ^<!--The ID below indicates application support for 
Windows 7 --^>>>64\%outfile%.%extension%.manifest
rem     echo             ^<supportedOS 
Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/^>>>64\%outfile%.%extension%.manifest
rem     echo         ^</application^>>>64\%outfile%.%extension%.manifest
rem     echo     ^</compatibility^>>>64\%outfile%.%extension%.manifest
    echo     
^<description^>%manifest_apptitle%^</description^>>>64\%outfile%.%extension%.manifest
    echo     ^<!-- Identify the application security requirements. 
--^>>>64\%outfile%.%extension%.manifest
    rem -----it was the following trustinfo section which had the urn, I just 
added the namespace.
    echo     ^<ms_asmv2:trustInfo 
xmlns:ms_asmv2="urn:schemas-microsoft-com:asm.v2"^>>>64\%outfile%.%extension%.manifest
    echo         ^<ms_asmv2:security^>>>64\%outfile%.%extension%.manifest
    echo             
^<ms_asmv2:requestedPrivileges^>>>64\%outfile%.%extension%.manifest
    echo                 ^<ms_asmv2:requestedExecutionLevel 
level="%manifest_executionlevel%" 
uiAccess="%manifest_uiaccess%"^>>>64\%outfile%.%extension%.manifest
    echo                 
^</ms_asmv2:requestedExecutionLevel^>>>64\%outfile%.%extension%.manifest
    echo             
^</ms_asmv2:requestedPrivileges^>>>64\%outfile%.%extension%.manifest
    echo         ^</ms_asmv2:security^>>>64\%outfile%.%extension%.manifest
    echo    ^</ms_asmv2:trustInfo^>>>64\%outfile%.%extension%.manifest
rem     rem -----dependency side-by-side assembly section added 2-11-2012
rem     echo    ^<dependency^>>>64\%outfile%.%extension%.manifest
rem     echo        ^<dependentAssembly^>>>64\%outfile%.%extension%.manifest
rem     echo            ^<assemblyIdentity 
type="win32">>64\%outfile%.%extension%.manifest
rem     echo                    
name="%manifest_assyname%">>64\%outfile%.%extension%.manifest
rem     echo                    
version="%manifest_assyver%">>64\%outfile%.%extension%.manifest
rem     echo                         
processorArchitecture="X86">>64\%outfile%.%extension%.manifest
rem     rem echo                         
publicKeyToken="0000000000000000">>64\%outfile%.%extension%.manifest
rem     echo                    
language="en-US">>64\%outfile%.%extension%.manifest
rem     echo            /^>>>64\%outfile%.%extension%.manifest
rem     echo            ^<file 
name="msvcrt.dll"/^>>>64\%outfile%.%extension%.manifest
rem     echo            ^<file 
name="%gpp64gccdll%"/^>>>64\%outfile%.%extension%.manifest
rem     echo            ^<file 
name="%gpp64cppdll%"/^>>>64\%outfile%.%extension%.manifest
rem     echo        ^</dependentAssembly^>>>64\%outfile%.%extension%.manifest
rem     echo    ^</dependency^>>>64\%outfile%.%extension%.manifest
    echo ^</assembly^>>>64\%outfile%.%extension%.manifest





here is the manifest you should use.



    echo -----creating 32-bit 9x+ manifest...  don't change this particular 
block or nothing will work.
    echo ^<?xml version="1.0" encoding="UTF-8" 
standalone="yes"?^>>32\%outfile%.%extension%.manifest
    echo ^<assembly xmlns="urn:schemas-microsoft-com:asm.v1" 
manifestVersion="1.0"^>>>32\%outfile%.%extension%.manifest

rem it works with description on XP, but I don't know about other platforms, so 
I am leaving it out.
rem     echo     
^<description^>%manifest_apptitle%^</description^>>>32\%outfile%.%extension%.manifest

    echo     ^<ms_asmv2:trustInfo 
xmlns:ms_asmv2="urn:schemas-microsoft-com:asm.v2"^>>>32\%outfile%.%extension%.manifest
    echo         ^<ms_asmv2:security^>>>32\%outfile%.%extension%.manifest
    echo             
^<ms_asmv2:requestedPrivileges^>>>32\%outfile%.%extension%.manifest
    echo                 ^<ms_asmv2:requestedExecutionLevel 
level="%manifest_executionlevel%"^>>>32\%outfile%.%extension%.manifest
rem it works on XP, but I don't know about other platforms, so I am leaving it 
out.
rem     echo                 ^<ms_asmv2:requestedExecutionLevel 
level="%manifest_executionlevel%" 
uiAccess="%manifest_uiaccess%"^>>>32\%outfile%.%extension%.manifest
    echo                 
^</ms_asmv2:requestedExecutionLevel^>>>32\%outfile%.%extension%.manifest
    echo             
^</ms_asmv2:requestedPrivileges^>>>32\%outfile%.%extension%.manifest
    echo         ^</ms_asmv2:security^>>>32\%outfile%.%extension%.manifest
    echo     ^</ms_asmv2:trustInfo^>>>32\%outfile%.%extension%.manifest
    echo ^</assembly^>>>32\%outfile%.%extension%.manifest




    echo -----creating 64-bit 9x+ manifest...  don't change this particular 
block or nothing will work.
    echo ^<?xml version="1.0" encoding="UTF-8" 
standalone="yes"?^>>64\%outfile%.%extension%.manifest
    echo ^<assembly xmlns="urn:schemas-microsoft-com:asm.v1" 
manifestVersion="1.0"^>>>64\%outfile%.%extension%.manifest

rem it works with description on XP, but I don't know about other platforms, so 
I am leaving it out.
rem     echo     
^<description^>%manifest_apptitle%^</description^>>>64\%outfile%.%extension%.manifest

    echo     ^<ms_asmv2:trustInfo 
xmlns:ms_asmv2="urn:schemas-microsoft-com:asm.v2"^>>>64\%outfile%.%extension%.manifest
    echo         ^<ms_asmv2:security^>>>64\%outfile%.%extension%.manifest
    echo             
^<ms_asmv2:requestedPrivileges^>>>64\%outfile%.%extension%.manifest
    echo                 ^<ms_asmv2:requestedExecutionLevel 
level="%manifest_executionlevel%"^>>>64\%outfile%.%extension%.manifest
rem it works on XP, but I don't know about other platforms, so I am leaving it 
out.
rem     echo                 ^<ms_asmv2:requestedExecutionLevel 
level="%manifest_executionlevel%" 
uiAccess="%manifest_uiaccess%"^>>>64\%outfile%.%extension%.manifest
    echo                 
^</ms_asmv2:requestedExecutionLevel^>>>64\%outfile%.%extension%.manifest
    echo             
^</ms_asmv2:requestedPrivileges^>>>64\%outfile%.%extension%.manifest
    echo         ^</ms_asmv2:security^>>>64\%outfile%.%extension%.manifest
    echo    ^</ms_asmv2:trustInfo^>>>64\%outfile%.%extension%.manifest
    echo ^</assembly^>>>64\%outfile%.%extension%.manifest





Enjoy...  Jim Michaels







>________________________________
> From: NightStrike <[email protected]>
>To: [email protected] 
>Sent: Tuesday, March 20, 2012 4:38 PM
>Subject: Re: [Mingw-w64-public] Switching versions of libgcc_s_sjlj-1.dll
> 
>On Tue, Mar 20, 2012 at 12:09 AM, Sisyphus <[email protected]> wrote:
>>
>> ----- Original Message -----
>> From: "Mark Dootson" <[email protected]>
>> To: <[email protected]>
>> Sent: Tuesday, March 20, 2012 6:28 PM
>> Subject: Re: [Mingw-w64-public] Switching versions of libgcc_s_sjlj-1.dll
>>
>>
>>> Hi Rob, me again :-)
>>>
>>> On 20/03/2012 02:04, Sisyphus wrote:
>>>
>>>> Better if someone knows of a way to have Strawberry Perl stick to loading
>>>> the correct (4.4.7) libgcc_s_sjlj-1.dll, but still allow these perl dll
>>>> files to load the 4.7.0 libgcc_s_sjlj-1.dll .
>>>
>>> I think this is possible with manifests. I've certainly used manifests
>>> in the past at the application level to point executables at a specific
>>> libgcc_s_sjlj-1.dll so I can have 64 bit and 32 bit executables in the
>>> same path keeping the dependent dll's ( libgcc_s_sjlj-1.dll etc ) in sub
>>> folders. (and for any other reason I don't want multiple
>>> libgcc_s_sjlj-1.dll etc versions on the path).
>>>
>>> I think it is meant to work for assemblies (dll's) too. I'll check it out.
>>
>> I've asked about this on perlmonks, too (where it's really quite OT):
>> http://www.perlmonks.org/index.pl?node_id=960506
>>
>> In response to that post BrowserUk also raised the possibility of using
>> manifests ... which only served to send me scurrying for the nearest
>> sandpile into which I could bury my head ;-)
>>
>> Having posted there, it then occurred to me that I could frame the question
>> in such a way that it wasn't OT here ... which is what I then proceeded to
>> do. (I don't usually go posting willy-nilly all over the place.)
>>
>> If it *can* be done using manifests, then I think that's *the* solution to
>> use. (I do have a 64-bit version of mt.exe, if that's any use. So far, all
>> I've really ascertained is that none of these dll files have a resource
>> section. As regards manifest files themselves, I still haven't really got
>> past the "Huh ?" stage.)
>>
>> Cheers,
>> Rob
>
>
>You could also just upgrade everything to use 4.7.0 :)
>
>------------------------------------------------------------------------------
>This SF email is sponsosred by:
>Try Windows Azure free for 90 days Click Here 
>http://p.sf.net/sfu/sfd2d-msazure
>_______________________________________________
>Mingw-w64-public mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>
>
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to