Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Binaries should have the application manifest #10515

Closed
poiru opened this issue Nov 16, 2013 · 1 comment
Closed

Windows: Binaries should have the application manifest #10515

poiru opened this issue Nov 16, 2013 · 1 comment

Comments

@poiru
Copy link
Contributor

poiru commented Nov 16, 2013

The UAC issue in #10452 is caused by a missing manifest in the binaries. We should include the following in all binaries:

<?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>
</assembly>

In an ideal world, we would allow the user to provide a custom manifest should they wish to require UAC elevation, for example. The VC++ linker has the /MANIFESTUAC option for this.

In a traditional MinGW build, this would be implemented something like this:

windres -i resource.rc -o resource.o
gcc -c main.c -o main.o
gcc -o app.exe main.o resource.o -s -Wl,--subsystem,windows

Where resource.rc would contain something like this (application.manifest would contain the XML stuff above):

#include <Windows.h>

// ...

CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "application.manifest"

I tried looking at how this could be done with Rust, but didn't get too far. Any tips on where to look would be greatly appreciated.

@poiru
Copy link
Contributor Author

poiru commented Nov 16, 2013

Oops, it seems that @vadimcn beat me by two hours. Closing this and posting above to #10512.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant