When using the installation service, many users will encounter the problem of permission to improve the problem that
installation fails. This is because the process lacks the necessary permissions required for the installation. To solve this problem, the process must be run with the permissions.
Process.Start
Use shellexecute to solve the problem of improving permission InstallUtil.exe
At first, people thought that could solve the problem of power improvement. However, simply setting is not enough.
ShellExecute
startInfo.Verb = "runas"
In order to effectively improve the process permissions, the
object must be set to 'runas', and :
This will ensure that Windows prompts users to increase their permissions, which is consistent with the behavior of "run as an administrator" option in the resource manager. However, if this prompt is not required, the authority of the entire host process can be enhanced by embedded application lists that require "HigheStavailable" to execute level. This will trigger UAC prompts when the application starts and automatically increases the permissions of all sub -processes without requiring further user intervention. startInfo
The above is the detailed content of How Can I Programmatically Elevate Privileges for InstallUtil.exe to Successfully Install Services?. For more information, please follow other related articles on the PHP Chinese website!