1
votes

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.

3

3 Answers

1
votes

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...

1
votes

There are (at least) two ways:

  • Check if SYSINFO.WINNT.bAdmin_Logged_On is TRUE. If so, the user has Administrator privileges.
  • Check if Is(USER_ADMINISTRATOR,"") returns TRUE. If so, the user has Administrator privileges.

You can use any one.

0
votes

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