linguini linguini - 1 year ago 70
C# Question

"Run as administrator" option doesn't shows up in the context menu in Explorer

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

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

desktop icon

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.

I checked in this link :
then I added the option: "Embed manifest with default settings" and regenerated the installer. But it didn't make any change.

I'm making a test on Win 7 OS 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


<?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="">
<assemblyIdentity version="" name=""/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<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" />

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<!-- 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>


<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->


enter image description here

enter image description here


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


enter image description here

It should be like this:

enter image description here

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

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

Answer Source

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.

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


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

I decided to go with WIX installer.

Please give me your FB.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download