Search code examples
c++windows-installerbhocmdregsvr32

Would an MSI able to launch programs/files with elevated permissions automatically?


I am trying to make it possible for an .msi file to open an executable which will register a Browser Helper Object. Since this involves writing to the registry, cmd.exe must be elevated with administrative privelages. I am able to manipulate the ShellExecute() function to make a UAC dialog pop up and ask whether the user wants to run cmd as an administrator, however, I would not like to give the user any control over the installation. Much research online has lead me to conclude that it is impossible to user a Browser Helper Object without administrative rights, so my question is: Would cmd.exe be able to inherit the permissions of the msi installer, assuming that the installer is already running with administrative rights? To no avail, I have also tried to automatically run cmd as an administrator. I appreciate any direction or help given, thank you very much!


Solution

  • My understanding is that IF UAC is enabled there should be no way to get around it. If there is it is an exploit and should be avoided.