Administrator priviledges

Got a problem you cannot solve? Try here.
Post Reply
get101
Posts: 48
Joined: Wed May 16, 2007 1:58 am

Administrator priviledges

Post 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.
ulrichard
Posts: 150
Joined: Thu Dec 27, 2007 5:45 am
Location: Switzerland
Contact:

Post 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
http://www.pointline.com
http://www.paraeasy.ch
http://ulrichard.ch
get101
Posts: 48
Joined: Wed May 16, 2007 1:58 am

Post 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
ulrichard
Posts: 150
Joined: Thu Dec 27, 2007 5:45 am
Location: Switzerland
Contact:

Post 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
http://www.pointline.com
http://www.paraeasy.ch
http://ulrichard.ch
Tinus
Posts: 209
Joined: Tue Jun 20, 2006 8:42 am
Location: Germany

Post 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.
Martin Rothschink

AxoNet Software GmbH
http://www.axonet.de/products/other-pro ... stallaware
get101
Posts: 48
Joined: Wed May 16, 2007 1:58 am

Post by get101 »

Richard and Martin

Thanks for your replies.

I will keep Admin privileges on when the install program needs to register activeX.
Post Reply