cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
kriz_82
Level 5

Check if admin before prerequisites installation

Hi,

How can i prevent starting installer by someone who is not an administrator? I noticed that there is a Require Administrative Privileges property in the Summary Information Stream. WHen i start the installer as a non-administator "Install Program as Other User" window pops up. Now I have an option to either run the installation as a logged on user (non-administator) or a run as selected used (eg.Administrator).

How not to give the end user option to run the installation as a non administrator user (show error and leave the installer)?

As far as I know I cannot call CA before prerequisites (setup.exe)

I am using Basic MSI project type.

Regards!
Labels (1)
0 Kudos
(6) Replies
Bineesh
Level 6

In the prerequisite editor you can add "This prerequisite require Admin Privileges" under Behaviour tab.
0 Kudos
kriz_82
Level 5

Hi,

Thank you for the response. I did a test with "This prerequisite require Admin Privileges" ticked on (default behaviour). The setup.exe allowed non-administrator user to launch installer and its prerequisistes even though "This prerequisite require Admin Privileges" checkbox was selected. Do you know why?

Ideally, I would like to display end user a message and exit installer before a window with prerequisistes is displayed.
0 Kudos
kriz_82
Level 5

Hi,

THat is what help file says about "This prerequisite require Admin Privileges"

NOTE

This setting applies to installations that are run on Windows Vista systems. Earlier versions of Windows ignore this setting.

I need a solution for OSs like XP, Vista and 7. SO is there a way to detect if user is an admin and if not abort the installation, before prerequisistes are installed or even displayed?

Regards!
0 Kudos
AlexandrV
Level 3

I have the same problem, on Windows 7 OS my installer runs the prerequisite installation under non-Admin account, "The prerequisite requires administrative privileges" option is set in prerequisite editor.
InstallShield 2009 Premiere.
0 Kudos
rrinblue22
Level 9

if the 'Require admin privileges' doesn't work then use a wrapper (C#) to your exe to check if user is admin based on which you can launch your setup.exe
0 Kudos
AlexandrV
Level 3

rrinblue22 wrote:
if the 'Require admin privileges' doesn't work then use a wrapper (C#) to your exe to check if user is admin based on which you can launch your setup.exe


thank you. I'm going to create my own hidden prerequisites that will check admin privileges and exit from installation if user is not admin.

The next question is how to break installation, what code should my .exe return to let InstallShield know it should break?
0 Kudos