“作为管理员运行”选项不会出现在浏览器的上下文菜单中

时间:2023-01-17 00:12:15

I'm using VS2012 WPF Application & Install-shield 2013 LE to generate the installer.

我正在使用VS2012 WPF应用程序和安装盾2013 LE来生成安装程序。

After the installation I noticed that "Run as administrator" option doesn't shows up in the context menu in Explorer of the desktop icon.

安装之后,我注意到“作为管理员运行”选项没有出现在桌面图标的Explorer的上下文菜单中。

Some of the user couldn't run the application but they can run the application by getting into the installed dir and right click on the icon, Run as administrator.

有些用户不能运行应用程序,但可以通过进入已安装的dir并以管理员的身份右键单击图标来运行应用程序。

I checked in this link :http://msdn.microsoft.com/en-us/library/ms247046.aspx then I added the option: "Embed manifest with default settings" and regenerated the installer. But it didn't make any change.

我检查了这个链接:http://msdn.microsoft.com/en-us/library/ms247046.aspx,然后我添加了选项:“使用默认设置嵌入清单”并重新生成安装程序。但它没有任何改变。

I'm making a test on Win 7 OS 32bit.

我正在测试win7os 32bit。

How can i enable the option "Run as administrator" when i right click on application icon in the context menu in Explorer?

当我在资源管理器的上下文菜单中右键单击应用程序图标时,如何启用“作为管理员运行”选项?

Same problem like this question: VS 2010 setup shortcut file not shows Run as Administrator option

同样的问题:VS 2010设置快捷文件不显示为管理员选项。

app.manifest:

app.manifest:

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
        <!-- UAC Manifest Options
            If you want to change the Windows User Account Control level replace the 
            requestedExecutionLevel node with one of the following.

        <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
        <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
        <requestedExecutionLevel  level="highestAvailable" uiAccess="false" />

            Specifying requestedExecutionLevel node will disable file and registry virtualization.
            If you want to utilize File and Registry Virtualization for backward 
            compatibility then delete the requestedExecutionLevel node.
        -->
        <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
      </requestedPrivileges>
    </security>
  </trustInfo>

  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
    <application>
      <!-- A list of all Windows versions that this application is designed to work with. 
      Windows will automatically select the most compatible environment.-->

      <!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->
      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>

      <!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>

      <!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->
      <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>

    </application>
  </compatibility>

  <!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
   <dependency>
    <dependentAssembly>
      <assemblyIdentity
          type="win32"
          name="Microsoft.Windows.Common-Controls"
          version="6.0.0.0"
          processorArchitecture="*"
          publicKeyToken="6595b64144ccf1df"
          language="*"
        />
    </dependentAssembly>
  </dependency>

</asmv1:assembly>

“作为管理员运行”选项不会出现在浏览器的上下文菜单中

“作为管理员运行”选项不会出现在浏览器的上下文菜单中

Edited:

编辑:

I figured it out that the InstallShield 2013 LE(Limited Edition) is not allowing me to put the target directioy like this : "C:\ProgramFiles\TestUtility.exe". If the target refer to exe, then the 'Run as Administrator' will be enabled automatically.

我发现InstallShield 2013 LE(限量版)不允许我将目标目录放在这样的地方:“C:\程序文件\TestUtility.exe”。如果目标引用exe,则“作为管理员运行”将自动启用。

Original:

原:

“作为管理员运行”选项不会出现在浏览器的上下文菜单中

It should be like this:

应该是这样的:

“作为管理员运行”选项不会出现在浏览器的上下文菜单中

So, InstallShield LE is doesn't allow me to change that.

所以安装盾是不允许我改变的。

I have to find another way to generate the installer. Any suggestion please?

我必须找到另一种方法来生成安装程序。任何建议吗?

1 个解决方案

#1


0  

I finally found why the 'Run as Administrator' is not enabled. When an installed icon is not referred to .exe it won't be available.

我终于发现为什么不启用“作为管理员运行”。当未引用已安装的图标时,它将不可用。exe。

On top of this InstalShield 2013 LE version doesn't allow to change the "Target Directory" value.

在这个InstalShield上,2013年的版本不允许改变“目标目录”的值。

Link: http://community.flexerasoftware.com/showthread.php?206542-Permissions-setting-to-edit-within-directory

链接:http://community.flexerasoftware.com/showthread.php?206542-Permissions-setting-to-edit-within-directory

It's important to refer the .exe; why? the user can run the application as an Administrator through Windows Explorer Context Menu.

引用。exe是很重要的;为什么?用户可以通过Windows资源管理器上下文菜单以管理员的身份运行应用程序。

I decided to go with WIX installer.

我决定使用WIX安装程序。

Please give me your FB.

请把你的表给我。

#1


0  

I finally found why the 'Run as Administrator' is not enabled. When an installed icon is not referred to .exe it won't be available.

我终于发现为什么不启用“作为管理员运行”。当未引用已安装的图标时,它将不可用。exe。

On top of this InstalShield 2013 LE version doesn't allow to change the "Target Directory" value.

在这个InstalShield上,2013年的版本不允许改变“目标目录”的值。

Link: http://community.flexerasoftware.com/showthread.php?206542-Permissions-setting-to-edit-within-directory

链接:http://community.flexerasoftware.com/showthread.php?206542-Permissions-setting-to-edit-within-directory

It's important to refer the .exe; why? the user can run the application as an Administrator through Windows Explorer Context Menu.

引用。exe是很重要的;为什么?用户可以通过Windows资源管理器上下文菜单以管理员的身份运行应用程序。

I decided to go with WIX installer.

我决定使用WIX安装程序。

Please give me your FB.

请把你的表给我。