views:

834

answers:

3

Install Shield 2009, Premier, Basic MSI Projcet:[I want to allow only administrator users to run setup] In the Releases->MyProductConfiguration->MyRelease->Setup.exe tab i chose "Required Execution Level" = "Invoker" and in General Information->Product Properties I put a Install condition as Condition = "AdminUser" Message = "Require Admin user to run this..."

The problem is only the main Administrator can install it. Any other user say "Test" with Administrative privilege can't install and get the error message "Require Admin user to run this..."

So how to allow only those user who are in Admin group to install and restrict others.

+1  A: 

Hi Samir the above problem you can achieve through Installscript

For example : if(SYSINFO.WINNT.bWinNT) then if ( !SYSINFO.WINNT.bAdmin_Logged_On) then
MessageBox(You must be logged in as admin, SEVERE); abort; endif; endif;

First this will check for which O.S. then logged-in user is TRUE, the end user is logged on under NT with administator rights. or quit the application.

Hope this helps you...

Chetan
A: 

This can be done in Basic MSI Project by going into the Installation Designer -> General Information -> Summary Information Stream -> Require Administrative Privileges = Yes

Annon
A: 

How would you check if a certain user has admin privileges if the user is not logged on? I have to install SQL Server 2008 express where a user account with admin privileges is required. However, as the user of my setup enters domain/username, I don't even know if the string describes a valid user account.

Is there a way to test a) if the user account string is valid b) if the user exists (may be an external domain!) c) if the user has admin access on the current machine running the setup

Kurt Wolf