How does requireAdministrator work in an inno installer?

117 views
Skip to first unread message

AndrewP

unread,
Dec 16, 2023, 2:07:19 PM12/16/23
to innosetup
If I have PrivilegesRequired=admin set in the installer script, inno creates an installer .exe that requests elevation.  However, if I examine the manifest resource embedded in the .exe, I notice that the "requestedExecutionLevel" is set to "asInvoker" which I wouldn't expect.  I would have expected it to be "requireAdministrator".

How can it be that it's set to run asInvoker, but still trigger the UAC prompt?  What method is it using to request elevation?  (I am talking about without setting the "run as admin" flag in the properties dialog or the registry setting).

Thanks, Andrew

Martijn Laan

unread,
Dec 16, 2023, 2:10:59 PM12/16/23
to inno...@googlegroups.com
It respawns itself elevated. The elevated process is the wizard you see. It communicates with the original process to be able to run the installed application as the original user. 

(In reality it's more complicated, there's also a loader involved)

Greetings,
Martijn

Op 16 dec 2023 om 20:07 heeft AndrewP <apeck...@gmail.com> het volgende geschreven:


If I have PrivilegesRequired=admin set in the installer script, inno creates an installer .exe that requests elevation.  However, if I examine the manifest resource embedded in the .exe, I notice that the "requestedExecutionLevel" is set to "asInvoker" which I wouldn't expect.  I would have expected it to be "requireAdministrator".

How can it be that it's set to run asInvoker, but still trigger the UAC prompt?  What method is it using to request elevation?  (I am talking about without setting the "run as admin" flag in the properties dialog or the registry setting).

Thanks, Andrew

--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/innosetup/2b85f3d7-aa59-4348-9d4c-bb9b949a9f73n%40googlegroups.com.

AndrewP

unread,
Dec 18, 2023, 12:23:24 PM12/18/23
to innosetup

Got it, thanks for your reply.
Andrew

ming tong

unread,
Nov 10, 2025, 11:50:50 PMNov 10
to innosetup
If I need the manifest to have the value "requireAdministrator", what should I do?
I am using the latest version, but even after I set the "PrivilegesRequired=admin" in the install script, it still generates the value "asInvoker"

Jernej Simončič

unread,
Nov 11, 2025, 2:50:12 AMNov 11
to ming tong on [innosetup]

On Tuesday, November 11, 2025, 04:52:34, ming tong wrote:


If I need the manifest to have the value "requireAdministrator", what should I do?
I am using the latest version, but even after I set the "PrivilegesRequired=admin" in the install script, it still generates the value "asInvoker"

You need to edit the manifest in your own application – Inno will not modify your files (if you're talking about Inno itself, it will never have requireAdministrator on installers it produces, because it needs the initial process to run without elevated user rights, and it will elevate the installer process on its own).

 

-- 
< Jernej Simončič ><><><><>< https://eternallybored.org/ >


When in doubt, predict that the present trend will continue.
       -- Merkin's Maxim

Gavin Lambert

unread,
Nov 16, 2025, 6:48:30 PM (12 days ago) Nov 16
to innosetup
On Tuesday, November 11, 2025 at 8:50:12 PM UTC+13 Jernej Simončič wrote:

You need to edit the manifest in your own application

If and only if your app actually does require admin permissions.  Most of the time you should treat that as a bug, not a feature.  In the very unlikely case you are actually writing an app that genuinely does need admin permissions, there are usually better ways to do it (such as elevating on demand).

The installer requiring elevation is fairly normal.  The application requiring elevation is not. 
Reply all
Reply to author
Forward
0 new messages