Skip to content

Windows: Binaries should have the application manifest #10515

Closed
@poiru

Description

@poiru

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions