防止 UAC 虚拟化? [英] Prevent UAC Virtualization?

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

问题描述

我有一个 VB6 应用程序,我已经销售了 12 年多.有时我的用户很难让应用程序运行.数据写入将进入/My Documents,因此除了安装文件(EXE 等)之外什么都没有进入 C:\Program Files(或 C:\Program Files (x86)).

I have a VB6 app that I've been selling for over 12 years. Sometimes I have users that have a hard time getting the app to run. The data writes are going into /My Documents so nothing but the installation files (EXE, etc.) are going into C:\Program Files (or C:\Program Files (x86)).

解决他们的问题是启动应用程序,即使它看起来挂起,然后显示任务管理器,查看进程,右键单击我的应用程序的进程并取消选中 UAC 虚拟化.然后我让他们修复安装,一切都很好.

The fix to their problem is to start the app, even though it appears hung, then show the task manager, view processes, right-click my app's process and uncheck UAC Virtualization. Then I have them repair the installation and all is fine.

为什么我的进程被置于 UAC 虚拟化之下,我该如何防止这种情况发生?我也使用 InstallShield 2010 Professional 创建安装,我不确定它是否与安装程序或应用程序本身有关.

Why is my process getting put under UAC Virtualization and how do I prevent this from occuring? I also use InstallShield 2010 Professional to create the installation, I'm not sure if it's related to the installer or the app itself.

推荐答案

要防止虚拟化,请向应用程序添加清单.无论您说 asInvoker 还是 requireAdministrator,您都不会再获得虚拟化.我猜 asInvoker 对你来说会更好,因为该应用程序在不提升的情况下运行良好.

To prevent virtualization, add a manifest to the application. Whether you say asInvoker or requireAdministrator, you won't get virtualization any more. I am guessing asInvoker will be better for you since the app works fine without elevating.

您可以将 foo.exe.manifest 与 exe 放在同一文件夹中,或者将其嵌入,这有一些棘手的事情,例如使清单长度为 4 字节的倍数.这个问题涵盖了嵌入的一些血腥细节.

You can just put foo.exe.manifest in the same folder as the exe, or embed it, which has some tricky stuff like making the manifest a multiple of 4 bytes long. This question covers some gory details of embedding.

这篇关于防止 UAC 虚拟化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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