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
- :
- Running under User Access Control
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 18, 2014
05:50 AM
Running under User Access Control
Hello,
For historical reasons, we've always required that our customers install and run our application with UAC turned off, but we're now seeking to change that.
The problem is, we have customised scripts running NGen and RegAsm commands that will need to be granted elevated privileges at install time.
Is there a flag we can set in InstallShield to enable this?
Also, as we distribute both setup.exe and .msi formats, is there any flag we need to specify to msiexec?
Thanks
For historical reasons, we've always required that our customers install and run our application with UAC turned off, but we're now seeking to change that.
The problem is, we have customised scripts running NGen and RegAsm commands that will need to be granted elevated privileges at install time.
Is there a flag we can set in InstallShield to enable this?
Also, as we distribute both setup.exe and .msi formats, is there any flag we need to specify to msiexec?
Thanks
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 23, 2014
09:33 PM
In your release config in the setup.exe tab set Required Execution Level to Administrator. There is no way to require Admin rights without an exe bootstrap so for the MSI you just have to tell them to launch msiexec from an Admin command prompt. To stop the people that don't follow instruction from running the msi without admin rights, you can create a custom action to check for admin rights and then abort if they arent running as admin. I'm not sure of a way to check in Installscript but you could create a DLL to do the check and return true or false to your install. Here is a C# example:
Alternatively, when you launch your scripts you could use LAAW_OPTION_USE_SHELLEXECUTE and set LAAW_SHELLEXECUTEVERB = "runas" before calling LaunchApplication. This should allow the user to provide Admin credentials to prevent being blocked by UAC.
public bool IsElevated
{
get
{
return new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator);
}
}
Alternatively, when you launch your scripts you could use LAAW_OPTION_USE_SHELLEXECUTE and set LAAW_SHELLEXECUTEVERB = "runas" before calling LaunchApplication. This should allow the user to provide Admin credentials to prevent being blocked by UAC.