This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: How to set an executable property to 'Run as Administrator'?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Oct 06, 2008
08:25 AM
How to set an executable property to 'Run as Administrator'?
I have an InstallScript MSI project.
On Windows Server 2008, there is a check box in the executable properties dialog to run it as an administrator.
Is there a way to do this from Install Script so that the user does not have to do this?
Thanks!
On Windows Server 2008, there is a check box in the executable properties dialog to run it as an administrator.
Is there a way to do this from Install Script so that the user does not have to do this?
Thanks!
(9) Replies
‎Oct 06, 2008
09:13 PM
I don't know of a way to do this in InstallShield. We create a manifest file and name it the same as the exe file we are trying to force Run as Admin on. For example for a file named APP.EXE the manifest would be named APP.EXE.MANIFEST. This file is placed in the same folder as the EXE and contains the following XML code that instructs Windows how to handle the file.
‎Oct 07, 2008
06:52 AM
Is this a DLL that you compile in house? IF so why not have Visual Studio create and embed the manifest file for you? In VS2005 I just open the project, right click on the project in the Solution Explorer view, choose properties and then modify the manifest properties.
‎Oct 07, 2008
09:21 AM
I did update the manifests (wherever I could) of all our executables.
But for some, the build server won't let me do it. So, I was wondering for such exes, if I could do it from the install.
Any suggestions will be much appreciated.
Thanks!
But for some, the build server won't let me do it. So, I was wondering for such exes, if I could do it from the install.
Any suggestions will be much appreciated.
Thanks!
‎Oct 07, 2008
10:37 AM
If your calling code is running as a normal user, you can launch .exe files as administrator (subject to a UAC prompt) by using a call to the Windows API ShellExecute or ShellExecuteEx with a verb of "runas". Note that the InstallScript function LaunchApplication can use ShellExecute/Ex when passed the correct flags.
However a .dll file is invoked with the privileges of the calling application, so in this scenario there is no easy way to elevate. If you can wrap the .dll with a .exe you can turn it into the first scenario. If it's registered as a COM server, there are ways to do elevated COM invocations (but I've not studied them, especially from InstallScript). So the .dll case is probably a non-starter.
However a .dll file is invoked with the privileges of the calling application, so in this scenario there is no easy way to elevate. If you can wrap the .dll with a .exe you can turn it into the first scenario. If it's registered as a COM server, there are ways to do elevated COM invocations (but I've not studied them, especially from InstallScript). So the .dll case is probably a non-starter.
‎Oct 09, 2008
01:49 PM
For those executables that are to be run during the time of install, I used ShellExecute API and it works.
But this particular exe, the user can run it whenever he wants to. Is there a way to simulate the effect of manifest from the Install?
Thanks!
But this particular exe, the user can run it whenever he wants to. Is there a way to simulate the effect of manifest from the Install?
Thanks!
‎Oct 15, 2008
09:31 AM
Hi,
I have similar problem with DLL.
I need to install PnP and not PnP drivers. For this purpose I've modify "devcon.exe" (driver installation from command line utility - SetupAPI) to be a DLL and use it from IS merge module. It worked fine in 2000 and XP, but does not work in Vista. I guess it needs more rights to modify registry even if I run as administrator.
How to elevate privilege for DLL used from merge module?
Any help appreciated.
I have similar problem with DLL.
I need to install PnP and not PnP drivers. For this purpose I've modify "devcon.exe" (driver installation from command line utility - SetupAPI) to be a DLL and use it from IS merge module. It worked fine in 2000 and XP, but does not work in Vista. I guess it needs more rights to modify registry even if I run as administrator.
How to elevate privilege for DLL used from merge module?
Any help appreciated.
‎Dec 04, 2008
06:41 PM
Is there any commands in install scripts to set 'Run as Administrator'? flag to TRUE
I created teh manifest file. But I dont knwo how to embed it in the application exe I have. Pls help
I created teh manifest file. But I dont knwo how to embed it in the application exe I have. Pls help