The MASM Forum

General => The Campus => Topic started by: mabdelouahab on March 31, 2015, 02:50:49 AM

Title: UAC
Post by: mabdelouahab on March 31, 2015, 02:50:49 AM
hi everyone
How to add UAC execution level "requireAdministrator" to my MASM project?
linker: "Microsoft (R) Incremental Linker Version 11.00.50727.1",RadAsm 2.2
Title: Re: UAC
Post by: dedndave on March 31, 2015, 03:15:43 AM
does your project have a manifest ?

https://msdn.microsoft.com/en-us/library/bb756929.aspx (https://msdn.microsoft.com/en-us/library/bb756929.aspx)
Title: Re: UAC
Post by: mabdelouahab on March 31, 2015, 07:57:16 AM
Resource: MANIFEST did not give the result

mt.exe:
Microsoft (R) Manifest Tool version 6.2.9200.16384
Copyright (c) Microsoft Corporation 2012.
All rights reserved.

mt.exe : command line error c10100a8: No manifest outputs were specified to stor
e the final manifest.  Use the /? option for help on usage and samples.

I try
LINK.EXE /manifest:embed /manifestuac:"level=""requireAdministrator"" ...
Also nothing
Does anyone give me full example
Title: Re: UAC
Post by: dedndave on March 31, 2015, 09:52:14 AM
i can't test this because i am using XP - which doesn't support UAC
i also use the manifest for common controls - i hope i combined the 2 items properly   :P
give it a try...
Title: Re: UAC
Post by: dedndave on March 31, 2015, 09:53:45 AM
if that doesn't work for you, you may have to get into permissions and identify the current user level
i'm sure there's an API for that - or, you could probably get it frpm the registry
Title: Re: UAC
Post by: mabdelouahab on March 31, 2015, 10:18:10 AM
i thank you dave
it's work very fine  :t
I can reductase what you created to:
the XML file:
<?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.v2">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel
          level="requireAdministrator"
          uiAccess="false"/>
        </requestedPrivileges>
       </security>
  </trustInfo>
</assembly>

Then I was added " 1  24  "MyFile.xml"" to the Recsource file
:P
Title: Re: UAC
Post by: dedndave on March 31, 2015, 03:12:07 PM
the other part is for common controls
i suggest you leave it in there, if you want to support XP   :t