如何使MFC应用程序绕过Windows7和Vista中的UAC [英] How to make your MFC application bypass UAC in windows7 and Vista

查看:252
本文介绍了如何使MFC应用程序绕过Windows7和Vista中的UAC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在VS Studio 2008中开发的MFC应用程序,它可以在其安装文件夹中读取和写入JSON文件.仅当关闭UAC时,它才能在Vista(管理员)中完美运行.当UAC启用时,该应用程序将无法写入其JSON文件.我以为我必须创建一个清单文件,但我并没有真正尝试创建一个清单文件.

I have an MFC application developed in VS Studio 2008 which reads and writes to a JSON file in its installation folder. It works perfectly in vista(administrator) BUT ONLY when UAC is turned off. When UAC is ON, the application isn't able to write to its JSON file. I figured I had to create a manifest file but I haven't really tried creating one.

问题:

  1. 参考: http://msdn.microsoft.com/zh-cn/library/bb384691.aspx . 它在这里说,您可以在Visual Studio开发环境中简单地设置链接器选项. 我需要选择哪些值:
    a)启用用户帐户控制(UAC)? [我没有尝试].

  1. reference: http://msdn.microsoft.com/en-us/library/bb384691.aspx. It says here 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执行级别? [我尝试了SupremeAvailable].

b) UAC Execution Level? [I tried highestAvailable].

c)和UAC绕过UI保护? [我尝试过].

c) and UAC Bypass UI Protection? [I tried Yes].

是否需要在软件包(exe,Dll等)中添加清单文件?

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

谢谢...

推荐答案

UAC的整个概念是您不能绕过它.如果可以的话,那就没用了.

The whole concept of UAC is that you can not bypass it. If you could, it would be useless.

唯一的解决方案(无论如何,这都是您应该做的,不仅仅是因为UAC),永远不要在安装文件夹中写入文件,而要在其所属的%APPDATA%中写入文件.

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

这篇关于如何使MFC应用程序绕过Windows7和Vista中的UAC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆