0
votes

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.

3
I think that I know what should I do. I should use setupbld.exe to pack and them mt.exe with correct manifest file that force UAC elevation on setup.exe - Darqer

3 Answers

3
votes

Setupbld.exe doesn't support marking for asAdministrator elevation. If your .msi can only run with "early" elevation, you have a bug in your .msi. Usually it's custom actions that need to be run in deferred context without impersonation.

1
votes

You can edit the manifest in your resulting Setup.exe and change its requestedExecutionLevel attribute to requireAdministrator.

Yet, as Bob said in his answer, you should better use Deferred Execution Custom Actions with NoImpersonate bit 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.

1
votes

http://blog.torresdal.net/2008/10/06/

This blog does pretty much exactly what you are talking about if I understand correctly. I'm using to give my msi Admin so that my custom actions function correctly. However I'm also writing and reading to the registry, and for some reason reading from the registry isn't working. The log file says that the AppSearches are returning signature 3, which I believe means access denied. I am still working out why this is happening.

Best.

Edit: I believe my registry issues are not related to my admin privileges, I know that my setup is giving me elevated privileges, so ignore the comment about registry issues.