19

My application has an installer built in installshield. But for proper working of installation process in vista Win 7 etc. the installer should be run as administrator. (Even though the user has admin previlege he should select the 'Run as Administrator' option in the menu on rightclicking the installer exe)

How can I make my installer to prompt that it should be always run as administrator.

Thanks in advance...

JijeshKV
  • 670
  • 2
  • 7
  • 26
  • 3
    I would recommend figuring out whether there is an inherent need for administrative privileges, or if there is a mistake in the authoring (such as failing to use deferred-in-system-context for custom actions that require elevation) that could be corrected. If the latter, it's better to correct it than to set the manifest option. – Michael Urman Feb 23 '12 at 12:28

2 Answers2

25

With InstallShield 2008 (14.0) go to Media -> Releases then select tab Setup.exe and change the item Required Execution Level to Administrator

enter image description here

emmanuel
  • 765
  • 8
  • 15
  • 1
    And if my installer is an MSI and NOT setup.exe? – liorafar Dec 02 '15 at 08:19
  • 2
    @liorafar An MSI is not an executable file, it is just a standard Windows Installer database that is loaded by an executable from the system, i.e. msiexec.exe. So the answer is unfortunately, no. The manifest which specifies the execution level can be only embed into an EXE bootstrapper that launches your MSI (by calling msiexec.exe in in the background and passing its execution level too). An MSI can only be executed as admin from an elevated command prompt if it is manually launched, but never by simply double clicking it. – Bogdan Mitrache Dec 03 '15 at 05:29
  • @Bogdan Mitrache thanks for your answer. this is what actually we're doing but I thought there is more elegant way. – liorafar Dec 07 '15 at 12:42
17

You need to set the execution level to "Require Administrator" from the project options. This option will be stored in the manifest file included in your setup package and it will make the installer to act as it was launched with the option "Run as administrator" on machines that run on Vista or a newer OS. Older versions of Windows will ignore the manifest file.

Bogdan Mitrache
  • 10,536
  • 19
  • 34