View Full Version : Suppress UAC
june1212
7th October 2009, 16:27
How to suppress UAC in Vista? I need my installer.exe run totally automatically.But if the UAC is on on Vista, it need user elevates.
MSG
7th October 2009, 16:34
requestexecutionlevel user
http://nsis.sourceforge.net/Docs/Chapter4.html#4.8.1.32
(Of course, this will not grant you administrative access. But that is the whole point of the administrator password.)
june1212
7th October 2009, 19:29
thanks. Does that mean I must login as a user instead of admin to run the installer?
MSG
7th October 2009, 19:35
No. It just means that any user running the installer will NOT get the UAC elevation prompt on Win Vista and higher. (Remember, Windows UAC pops up even for Administrator users when they run an admin-only application.)
Anders
7th October 2009, 19:37
admins are members of the user group (normally)
It just means you can't write to programfiles/windir/HKLM etc
june1212
7th October 2009, 19:41
I tried the user, still have the "Allow/Cancel" prompt. Is that because I have some statements in the script to write to HKLM, and copy files to ProgramFiles?
Anders
7th October 2009, 19:51
did you put "requestexecutionlevel user" in your script?
june1212
7th October 2009, 20:00
yes, i do
RequestExecutionLevel user /* RequestExecutionLevel REQUIRED! for UAC Plugin*/
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
There are other registry writing lines in -Post
Then I log into my Vista as an account in Admin group, and run this installer.exe from %Public%. Still have the "Allow/Cancel" prompt.
june1212
7th October 2009, 20:02
But I also have your UAC plugin in the .onInit
UAC::RunElevated
Is that causing the prompt?
Anders
7th October 2009, 20:03
um, yes, what do you think RunElevated means?
june1212
7th October 2009, 20:10
Originally posted by Anders
um, yes, what do you think RunElevated means?
Hehe, that is added by a NSIS expert guy from my company:-)
By the way, if I set it run as user, what will be the diff as admin? THis installer copies files to ProgramFiles, add registry for the product, and install a windows service. Can User priviledge aproach that?
Thanks
june1212
7th October 2009, 20:24
I take out the UAC plugin. But installing windows service has "Access is denied" error. Does that mean, I must use admin in the "RequestExecutionLevel"?
MSG
8th October 2009, 06:50
Yes. Unless you are using the NSIS UAC plugin, which is a special case. In that case, you need to use requestexecutionlevel user.
The point is: If you want your installer to do something that only admins are allowed to do, naturally the installer will need admin access.
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.