How to mark application to require admin privilegies to run?

Windows specific questions.
izero
Posts: 8
Joined: Feb 26, 2008 16:03

How to mark application to require admin privilegies to run?

Postby izero » May 16, 2017 12:39

Hi guys, do you know, how to mark application to require admin privilegies to run? I think there is some switch for c/c++ compilator/linker to mark it as requeres admin privilegies.
vdecampo
Posts: 2977
Joined: Aug 07, 2007 23:20
Location: Maryland, USA
Contact:

Re: How to mark application to require admin privilegies to run?

Postby vdecampo » May 16, 2017 13:11

You need to create a manifest file that goes with your EXE file.

Example (MyApp.exe.manifest)
<?xml version="1.0" encoding="utf-8" ?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
</asmv1:assembly>


-Vince
izero
Posts: 8
Joined: Feb 26, 2008 16:03

Re: How to mark application to require admin privilegies to run?

Postby izero » May 16, 2017 13:37

vdecampo wrote:You need to create a manifest file that goes with your EXE file.


Yep, found it here: viewtopic.php?t=23757. Thanks.

Return to “Windows”

Who is online

Users browsing this forum: No registered users and 2 guests