UAC与VC6应用程序 [英] UAC with VC6 Application

查看:62
本文介绍了UAC与VC6应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个VC6应用程序.我想将清单执行级别"设置为"RequireAdministrator",但Visual 6没有此选项.
我应该怎么做才能运行MyApplication.exe并弹出用户帐户控制"消息?

I Have a VC6 application. I want to set "Manifest Execution Level" to "RequireAdministrator" but Visual 6 does not have this option.
what should I do to run my MyApplication.exe and pop up "User Account Control" Message???

推荐答案

您可以使用文本编辑器手动创建清单文件.它包含:
You can manually create a manifest file with a text editor. It would contain:
<?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.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel

          level="RequireAdministrator"

          uiAccess="false"/>
        </requestedPrivileges>
       </security>
  </trustInfo>
</assembly>


如果将其保存在与应用程序相同的目录中,则应获得所需的结果.

您保存的清单文件必须使用您的应用程序名称和.manifest命名.例如,如果您的应用程序名为"MyApp.exe",则清单文件将为MyApp.exe.manifest.

另一种选择是简单地使用包含UAC的触发器"之一的名称来命名您的应用程序.如果应用程序名称包含设置",安装"或其他几个类似的单词,则会自动触发Admin UAC.

希望对您有所帮助.


If you save it in the same directory as your application, you should get the desired result.

The manifest file you save must be named with your application name and .manifest. For instance, if your application is called "MyApp.exe" then the manifest file would be MyApp.exe.manifest.

Another option is to simply name your application with a name containing one of the "triggers" for UAC. Admin UAC is automatically triggered if the app name includes "setup", "install" or several other similar words.

Hope that helps.


真正的答案是:升级您的应用程序到VS2010或VC2010 Express :)

如果出于某种良好的原因而无法下载 ^ ],然后尝试使用清单工具 [ ^ ]线.

祝你好运:)
AR
The real answer is: upgrade your app to VS2010 or VC2010 Express :)

If, for any good reason, you cannot, download the Windows 7 SDK[^] and try use the manifest tool[^] from the command line.

Good luck :)
AR


这篇关于UAC与VC6应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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