以编程方式更改UAC虚拟化 [英] Change UAC Virtualization Programmatically

查看:245
本文介绍了以编程方式更改UAC虚拟化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个支持UAC的应用程序,但它可能会加载现在的插件,并且他们想要在c:\program文件下编写。对于中等完整性级别的应用程序,这将失败。

I 've created an application that is UAC-aware, but it may load plugins that are now and they would want to write under c:\program files. This would fail for a medium-integrity level application.

我已经看到任务管理器可以为应用程序启用/禁用UAC虚拟化。如何从我的应用程序中以编程方式执行此操作?

I 've seen that the Task Manager can enable/disable UAC virtualization for an application. How can I do that programmatically from my application ?

 

最好的问候。

 

推荐答案

说实话,我不会。

To be honest, I wouldn't.

通过从用户的个人资料中加载插件等操作,您可以做得更好。如果您使用用户配置文件而不必担心写访问权限,那么您可以在不执行任何工作的情况下获取它。您也可以使用每用户配置
。这可能是额外的工作,但说实话,它最终会更好用。

You can do a much better job just by doing things like load plugins from the user's profile. If you use the user profile instead of having to worry about write access then you can get it without doing any of the work. You can also use per user configuration too. It may be extra work, but to be honest it would end up much better to use.

如果你不想这样做,那么你可以用另一种方法让事情变得容易多了。那就是在安装目录上设置安全性,或者如果它的子目录设置允许标准用户写入安全目录。

If you don't want to do that then there is also another approach which you can use to make things a lot easier. That is to set the security on your install directory or one if it's subdirectories to allow standard users to write.

这是更好的解决方案,因为虚拟化不能保证长时间停留。它可能会在下一版本的Windows中删除,然后您无论如何都必须修复您的应用程序。

This is the better solution since virtualisation is not guaranteed to stay for long. It may be removed in the next version of Windows and then you would have to fix your application anyway.


这篇关于以编程方式更改UAC虚拟化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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