How to make MFC bypass UAC in Windows 7 and Vista

I have an MFC application developed in VS Studio 2008 that reads and writes to a JSON file in the installation folder. It works fine in Vista (administrator), BUT ONLY when UAC is off. When UAC is enabled, the application cannot write it to a JSON file. I decided that I needed to create a manifest file, but I did not try to create it.

Questions:

  • link: http://msdn.microsoft.com/en-us/library/bb384691.aspx . It says that you can simply set the linker options in the Visual Studio development environment. What values ​​do I need to select for:
    a) Enable User Account Control (UAC)? [I tried NO].

    b) UAC performance level? [I tried highAvailable].

    c) and UAC Protection against UAC bypass? [I tried Yes].

  • Do I need to add the manifest file to the software package (exe, Dll, etc.)?

Thank...

+3
source share
5 answers

The whole concept of UAC is that you cannot get around it. If you could, it would be useless.

The only solution (which you should do anyway, and not just because of UAC) is to never write files in the installation folder, but in% APPDATA%, where it belongs.

+12
source

Copy this file to AppData. Modifying a file in Program Files always invokes the UAC prompt. This operation requires administrator rights, and the manifest will not help you with this.

+3
source

, UAC permisison. , UAC .

, , , .

aprroach - , LocalSystem, () , UAC. . , , , , . UAC ( )

+3

EnableLUA DWORD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System 0 .

UAC , , , , UAC Uista , , , ( ) win7.

:)

win7, , .

, stackoverflow , , UAC, / .

0

,

  • UAC: highestAvailable

requireAdministrator.

, highestAvailable , , (UAC) . , .

, requireAdministrator , . , , ; -, .

, requireAdministrator .

0

Source: https://habr.com/ru/post/1732501/


All Articles