How to set my app running as administrator?
-
Why the hell such common stuff is so complicated? Spent couple hours in google/youtube and still can't perceive such a goal. Tried to do as in video guide, as far i understand something wrong in .pro file, since it can't assign .rc file:
In my project directory both files are set and seems to be correct:
od.rc file:
#include <Windows.h> ID_ICON ICON DISCARDABLE "Qt.ico" CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "od.exe.manifest"
od.exe.manifest file:
<?xml version=”1.0" encoding=”UTF-8" standalone=”yes”?> <assembly xmlns=”urn:schemas-microsoft-com:asm.v1" manifestVersion=”1.0"> <assemblyIdentity version=”2.0.0.0" processorArchitecture=”X86" name=”OD.exe” type=”win32"></assemblyIdentity> <description>my Description</description> <!-- Identify the application security requirements. --> <trustInfo xmlns=”urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges> <requestedExecutionLevel level=”requireAdministrator” uiAccess=”false”> </requestedPrivileges> </security> </trustInfo> </assembly>
I just don't understand, why such common stuff is such hell in the ass.
-
@Engelard
I don't know the answer to your error (other than guessing you're including a/the manifest more than once), but when VS/MSVC reports those error "numbers" likeCVT1100
did you Google for that, because there are loads of hits? (And don't worry about the second one till you've dealt with the first, because they are likely related.) -
Unless you need it for other things you don't need to add the manifest manually. You can require admin privileges via linker flag:
QMAKE_LFLAGS_WINDOWS += /MANIFESTUAC:"level='requireAdministrator'"
-
@Chris-Kawa said in How to set my app running as administrator?:
QMAKE_LFLAGS_WINDOWS += /MANIFESTUAC:"level='requireAdministrator'"
Damn i know it somehow possible to do that short and easy way. Why no such stuff in google, only through creation those two files and all...