I have created an MSI file and then setup.exe with setupbld.exe. I want to have this shield on the setup.exe icon, so when user try to run this installer, the user will immediately get this screen with User Account Control (UAC) elevation. What should I do?
Currently I generate setup.exe with following cmd line:
setupbld.exe -out c:\Setup.exe -mpsu c:\outTEst\a.msi -setup setup.exe -title "setup"
Now users have to click on setup.exe and choose Run as Administrator in order to install my application.
You can edit the manifest in your resulting Setup.exe and change its
requestedExecutionLevelattribute torequireAdministrator.Yet, as Bob said in his answer, you should better use Deferred Execution Custom Actions with
NoImpersonatebit set. Deferred custom actions have access only to a limited number of properties, see Obtaining Context Information for Deferred Execution Custom Actions for more information.Also take a look at UAC in MSI Notes: The NoImpersonate Bit Mistake.