简体   繁体   English

为Windows 7 / Vista应用程序(VS2012 / InstallShield2013)启用“以管理员身份运行”

[英]Enable 'Run as an Administrator' for Windows 7/Vista application (VS2012/InstallShield2013)

I'm using VS2012 & InstallShield2013 to generate installer file. 我正在使用VS2012&InstallShield2013生成安装程序文件。

Some of the installed user couldn't run this application on WIn 7 OS. 一些已安装的用户无法在WIn 7 OS上运行此应用程序。 But they can get into the installed directory and right click 'Run as an Administrator' it works. 但是他们可以进入安装目录,然后右键单击'Run as an Administrator'它可以正常工作。

The icon on the desktop, when i right right click there is no option like 'Run as an Administrator' . 当我右键单击桌面上的图标时,没有像'Run as an Administrator''Run as an Administrator'选项。

I checked in the InstallShield directory C:\\Program Files\\InstallShield\\2013LE\\Support\\ There are three files: SetupExe.Admin.manifest, SetupExe.Highest.manifest, SetupExe.Invoker.manifest 我检查了InstallShield目录C:\\ Program Files \\ InstallShield \\ 2013LE \\ Support \\有三个文件: SetupExe.Admin.manifest, SetupExe.Highest.manifest, SetupExe.Invoker.manifest

So I followed this article : http://helpnet.flexerasoftware.com/installshield20helplib/Content/helplibrary/SpecifyingRequiredExecution.htm and selected Required Execution Level 'Invoker' and Include MSI Engine:yes in the 'Release Setup /Single Image' 因此,我遵循了这篇文章: http : //helpnet.flexerasoftware.com/installshield20helplib/Content/helplibrary/SpecifyingRequiredExecution.htm并选择了必需的执行级别'Invoker'并在'Release Setup /Single Image' Include MSI Engine:yes

How can i enable the option to right click 'Run as an Administrator' ? 我如何启用右键单击'Run as an Administrator'的选项?

It's important for me to fix this problem, for the users of Win 7 32/64 & Win Vista. 对于Win 7 32/64和Win Vista的用户来说,解决此问题对我来说很重要。

I'm totally confused about these files. 我完全对这些文件感到困惑。 Please help me. 请帮我。

在此处输入图片说明

The settings you reference in InstallShield will not affect how your application itself runs; 您在InstallShield中引用的设置不会影响您的应用程序本身的运行方式。 instead they only change the privileges setup.exe requires when launched. 相反,它们仅更改启动时setup.exe所需的特权。

As for your application, there are a number of potential moving pieces that can affect whether the "Run as administrator" option shows up in the context menu in Explorer: 对于您的应用程序,有很多潜在的问题可能会影响“以管理员身份运行”选项是否显示在资源管理器的上下文菜单中:

  • If the exe referenced by the shortcut has a manifest that requires administrative access, it will always run elevated, and the Run as administrator option will not appear 如果快捷方式引用的exe具有需要管理访问权限的清单,则它将始终以提升的身份运行,并且不会以管理员身份运行选项
  • If the exe referenced is detected as an installer, Windows may choose to act as though it has a manifest requiring administrative access, and thus the Run as administrator option may not appear 如果检测到引用的exe为安装程序,则Windows可能会选择将其视为具有要求管理访问权限的清单,因此可能不会出现“以管理员身份运行”选项
  • If the Program Compatability Assistant (PCA) has decided the program needs administrative access, ditto 如果程序兼容性助手(PCA)决定该程序需要管理权限,则同上
  • If the shortcut's compatibility settings have been modified to select "Run this program as an administrator", ditto 如果快捷方式的兼容性设置已被修改为选择“以管理员身份运行该程序”,则同上
  • If UAC is disabled, Explorer may choose not to show Run as administrator 如果禁用了UAC,资源管理器可能选择不显示以管理员身份运行

Some of these scenarios may persist across uninstallation and reinstallation; 其中某些情况可能在卸载和重新安装后仍然存在。 Windows can be very aggressive in its attempts to improve the end-user experience. Windows可能会非常积极地尝试改善最终用户的体验。 However in all these cases, the end result is that your application would launch as an administrator. 但是,在所有这些情况下,最终结果都是您的应用程序将以管理员身份启动。

If you always require administrative access in your application, you are strongly advised to implement the first of these: embed a manifest that includes the requiresAdministrator setting. 如果您始终在应用程序中需要管理访问权限,强烈建议您执行以下第一个操作:嵌入包含requiresAdministrator设置的清单。 This is equivalent to what the settings you reference change for setup.exe, but must be done in your application's executable. 这等效于您引用的setup.exe更改的设置,但是必须在应用程序的可执行文件中完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM