1

I'm using VS2012 & InstallShield2013 to generate installer file.

Some of the installed user couldn't run this application on WIn 7 OS. But they can get into the installed directory and right click 'Run as an Administrator' it works.

The icon on the desktop, when i right right click there is no option like '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

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'

How can i enable the option to right click 'Run as an Administrator'?

It's important for me to fix this problem, for the users of Win 7 32/64 & Win Vista.

I'm totally confused about these files. Please help me.

enter image description here

linguini
  • 1,939
  • 5
  • 49
  • 79
  • It's a little unclear whether you are asking about running the installation as administrator, or (having installed it) you are asking about running your application via a shortcut installed to the desktop. Could you clarify that? – Michael Urman Feb 05 '14 at 13:39
  • @MichaelUrman:running the application via a shortcut installed to the desktop to run as administrator. – linguini Feb 05 '14 at 14:24
  • @Kiquenet: Since i'm using a basic version of Installshield, it didn't let me to change this option. I gave up & i combined with Wix & NSIS! Installshield is good with Paid version! – linguini Aug 29 '14 at 07:32

1 Answers1

4

The settings you reference in InstallShield will not affect how your application itself runs; instead they only change the privileges setup.exe requires when launched.

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
  • 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
  • If the Program Compatability Assistant (PCA) has decided the program needs administrative access, ditto
  • 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

Some of these scenarios may persist across uninstallation and reinstallation; Windows can be very aggressive in its attempts to improve the end-user experience. 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. This is equivalent to what the settings you reference change for setup.exe, but must be done in your application's executable.

Michael Urman
  • 15,737
  • 2
  • 28
  • 44
  • Thank you very much for the detailed explanation. IN the beginning I included app.manifest in VS & then compiled through the InstallShield but i don't see the manifest file in the installed dir. Then I figured i tout that I have to o it through InsatllShiel Setup.exe, so I activated `Invoker`to enable the application run as Administrator when we right click on. But it's not working. How can I enable 'Run as an Administrator' when i right click on the icon? Thank you. – linguini Feb 05 '14 at 14:54
  • I'm having difficulty understanding your troubleshooting. You indicate that the lack of a visible manifest file in the installed folder was a problem, but I would expect the relevant manifest file to be embedded inside your application's exe. – Michael Urman Feb 05 '14 at 14:58
  • Please guide me that how can i put/enable the option when i right click on the icon 'Run as an Administrator' – linguini Feb 05 '14 at 15:35
  • I'm pretty sure Windows also won't allow you to redirect standard input/output/error across the admin/non-admin security boundary. You'll have to find a different way to get output from the program running as admin - Reference: http://stackoverflow.com/a/8690661 – Kiquenet Aug 28 '14 at 11:39