Old 19th October 2017, 16:39   #1
alecs26
Junior Member
 
Join Date: Apr 2017
Posts: 6
NSIS without administrator rights

Hello,

I have developed an installer with NSIS which work very well.
The installer copy files to Program Files.

However, I tried running today the installer on a Windows 7 session where the user didn't have administrator privileges. The installer ran and looked as if everything was installed. However, the files were not copied to Program Files and no error message was shown.

What should I do to request admin rights or to show an error message if the files were not installed correctly ?

Thank you very much,

Alex
alecs26 is offline   Reply With Quote
Old 19th October 2017, 23:57   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,605
NSIS version?

Do you have "RequestExecutionLevel" in your script?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 20th October 2017, 15:33   #3
alecs26
Junior Member
 
Join Date: Apr 2017
Posts: 6
No I didn't
In fact I didn't need to before. On different computers it automatically required admin privileges (with a shield on the installer exe) both on Win10, Win8 and Win7. However, on a particular Win7 machine, the shield was not there and it was able to run without privileges.

I added "RequestExecutionLevel" to my script by following this
https://stackoverflow.com/questions/...ons-using-nsis

Thank you so much !!

Alex
alecs26 is offline   Reply With Quote
Old 20th October 2017, 15:54   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,605
NSIS v3 defaults to "RequestExecutionLevel Admin" (but does not include the recommended UserInfo check in .onInit).

Older versions default to "none" which translates to no entry in the application manifest. UAC will detect these installers and elevate with compatibility hacks applied but that feature can be turned off in the registry/by policy (EnableInstallerDetection). In this mode it is also possible for writes to $Programfiles to succeed because the writes are redirected to the users "$LocalAppdata\VirtualStore" folder.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump