Archive: You can only install if you have admin rights


You can only install if you have admin rights
  --------------
Windows Vista
--------------

Hi

What is the best approach to inform the user that they can only install our product providing they have admin rights.

Is there a way to raise the administrator dialog in Vista.

Regards

Paul


Re: You can only install if you have admin rights
 

Originally posted by pgg1
What is the best approach to inform the user that they can only install our product providing they have admin rights.
UserInfo plugin (part of nsis) and MessageBox or Custom Page

Originally posted by pgg1

Is there a way to raise the administrator dialog in Vista.
for vista, use RequestExecutionLevel admin (this only works when UAC is on) If you need to support 2k/XP or Vista with UAC off, check if the user is admin with UserInfo and display a dialog and quit if they are not, or use the UAC plugin

RequestUserLevel admin


Thanks guys.


Hi

I have a problem that occurs that I cannot reproduce.

Current setup is:
Windows Vista
Amin rights
UAC is on

When the installer is double clicked the installer dialog appears. Everything is fine until the installer starts copying files over to Program files. The installer errors on the very first file transfer and displays a message that is not helpful to the user and I can't remember what is said anyway :-/

The reason is that the user does not have admin rights when in fact they do, this is due to UAC I think. So they simply run the installer with admin rights (right-clicking the installer and run as admin).

My question is:

Why does Windows allow the installer to get that far and then the moment we start to copy files over the installer errors.

What can I do to get around this problem?

Cheers

Paul


if you have "RequestExecutionLevel admin" in your script, the elevation dialog should pop up right away, if it does not, you should file a bug report


In Function .onInit, insert:

;Does user have Admin privileges?

>Push $R0
Call IsUserAdmin
Pop $R0
>${If} $R0 == "false"
>MessageBox MB_OK|MB_ICONEXCLAMATION "This installer must be run with Administrative Privileges"
>Abort
>${EndIf}
HTH,
Victor