I cross-compile the application with i586-mingw32msvc under ubuntu.
I'm having difficulty understanding how to embed a manifest file that requires an administrator run level using mingw32.
In my example, I used this hello.c :
int main() { return 0; }
this hello.rc resource hello.rc :
1 Manifest "hello.exe.manifest"
this manifest file hello.exe.manifest :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="hello" type="win32"/> <description>Hello World</description> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges> <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/> </requestedPrivileges> </security> </trustInfo> </assembly>
I will compile my resource file with
i586-mingw32msvc-windres hello.rc hello.o
I will compile my final application with:
i586-mingw32msvc-gcc -O3 -Os -s -o hello.exe hello.c hello.o
SigCheck does not display a manifest file with sigcheck -m hello.exe .
Now, when I run my application under Windows, it does not start UAC (= does not start as an administrator), and when I attach the file hello.exe.manifest in the same folder, it starts UAC (as expected).
What did I miss?
EDIT1: Playing with Resource Hacker I opened the Setup.exe file that I created using NSIS, the only reasonable difference is that Manifest written to Manifest in my hello.exe and Manifest to Setup.exe , although he wrote in hello.rc Manifest. O_o

EDIT2: I changed the Manifest group manually using the Resource Hacker:

Now hello.exe acts fine, starting the UAC alert and working as an administrator. There seems to be an βerrorβ with i586-mingw32msvc-windres . i586-mingw32msvc-windres
c linux windows uac mingw32
pr.nizar
source share