Question

I have an exe that is being absorbed as a ManagedBootstrapApplication.

For graphics reasons, and not for UAC override, I have a app.manifest file in the exe. When I run the exe as a regular program, the effects are present. When I run the bundle, the effects are stripped.

Below is the manifest code I'm adding to the app.manifest. The effect is consistent pixel-for-pixel accuracy when run, rather than being automatically scaled by Windows.

<asmv3:application>
    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
        <dpiAware>true</dpiAware>
    </asmv3:windowsSettings>
</asmv3:application>

Strangely, even in the raw exe, mt -managedassemblyname:raw.exe -out:extracted.manifest doesn't even show this. Similarly, if I put in the usual requireAdministrator UAC escalation JUST TO TEST, the effects of this are apparent (badge over Explorer's icon AND UAC prompt) but just the same, mt.exe does not export this section. Should they be present?

I'm trying to extract it so that I can reapply it manually to the bundle.exe, as I assume I must do. (I plan to do this in the <Target Name="SignBundleEngine"> target)

Thanks!

Was it helpful?

Solution

Even if you could get a custom manifest applied, I'm not sure it would work, due to how the native-code Burn stub (the actual executable) loads a native-code module to host the CLR and, eventually, your managed BA. I suggest calling the SetProcessDpiAwareness function instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top