pgg1
1st August 2008 12:08 UTC
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
Anders
1st August 2008 12:13 UTC
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
Yathosho
1st August 2008 12:14 UTC
RequestUserLevel admin
pgg1
1st August 2008 13:49 UTC
Thanks guys.
pgg1
4th August 2008 11:25 UTC
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
Anders
4th August 2008 12:28 UTC
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
vc6
4th August 2008 15:29 UTC
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