Page 1 of 1
Administrator priviledges
Posted: Mon Dec 08, 2008 1:18 am
by get101
Should
Administrator priviledges on the Applications Requirements page be checked?
I am finding that some users are unable to run my software because they get a "class not registered" error. This means that some lines in the install code are not installed properly, line like:
Code: Select all
Register Library $TARGETDIR$\\ctTree.ocx
Register Library $TARGETDIR$\\Olepro32.dll
I suspect that if I checked Administrator priviledges that may solve it.
Can anyone give me some guidance? Is there any downside in checking it?
Thanks.
Posted: Tue Dec 09, 2008 4:11 am
by ulrichard
Hi get101,
the downside is, that users without administrator rights cannot install your application.
To at least provide a clearer error message to the user you can insert something like this after your "register library" calls. Replace the GUID and the name that follows with your correct values.
Check Registry Key HKLM\\SOFTWARE\\Classes\\CLSID\\{EA2D476C-06ED-42B6-9636-3247F806B1F6}\\InprocServer32 into CHECKSYSTEM
if Variable CHECKSYSTEM Equals NO$KEY
MessageBox: $TITLE$ Setup Error, Library registration failed.
Terminate Installation
end
Rgds
Richard
Posted: Tue Dec 09, 2008 7:38 pm
by get101
Hi Richard
From your answer, can I assume that one does not usually need administrator rights for a Register Library line, as in:
Register Library $TARGETDIR$\\ctTree.ocx ?
Any thoughts as to why the ocx registers fine on some PCs, and on others it does not?
Do you find that most install setups do not need administrator rights?
Regards
Cyril
Posted: Wed Dec 10, 2008 2:11 am
by ulrichard
Hi get101,
The checkbox actually inserts the following code into your script:
Get System Setting Administrator Rights into CHECKSYSTEM
if Variable CHECKSYSTEM not Equals TRUE
MessageBox: $TITLE$ Setup Error, This product requires at least Administrator Privileges.$NEWLINE$$NEWLINE$Setup cannot continue.
Terminate Installation
end
Unless I'm entirely sure that the Install doesn't need admin rights, I check that box to require admin rights.
User rights can be different on any Pc. So if you don't want to require admin rights, you have to check the installing user's rights on every resource, you want to modify.
I started writing a dll that can check the access rights for Registry Keys, Filesystem Objects and so on. A relatively easy starting point is at:
http://smsoft.ru/en/checkfileaccess.htm
So with that I can start without admin rights, but as soon as I find out that the currently logged on user doesn't have some rights to modify a resource that I need to modify, I present the dialog to require admin rights. Technically it would be more appropriate to state what rights the user is missing that the installer requires. But if the user sees this technical stuff he doesn't understand, he thinks something's wrong with your application.
Registering a library writes to the HKLM Registry key, to which regular users usually don't have write access.
You could tell the administrator to give your users all the rights they need, but usually it's easier to require admin rights for the install.
Rgds
Richard
Posted: Wed Dec 10, 2008 10:42 am
by Tinus
From a user perspective I don't like software which allows me to go 70% and then tells me that I need admin rights and rolls back.
When I know that my installation writes to HKLM (or similar) I prefer to check admin privileges and tell them up front what is required.
Posted: Wed Dec 10, 2008 7:26 pm
by get101
Richard and Martin
Thanks for your replies.
I will keep Admin privileges on when the install program needs to register activeX.