如何检查用户是否在Install Shield 2009 Basic MSI Project中的Administrator组中

时间:2021-07-16 22:38:37

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

Install Shield 2009,Premier,Basic MSI Projcet:[我想只允许管理员用户运行安装程序]在Releases-> MyProductConfiguration-> MyRelease-> Setup.exe选项卡中,我选择了“Required Execution Level”=“Invoker”in一般信息 - >产品属性我将安装条件设置为Condition =“AdminUser”Message =“要求管理员用户运行此...”

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.

因此,如何仅允许Admin组中的用户安装和限制其他用户。

3 个解决方案

#1


the above problem you can achieve through Installscript

您可以通过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;

例如:if(SYSINFO.WINNT.bWinNT)然后if(!SYSINFO.WINNT.bAdmin_Logged_On)然后MessageBox(您必须以admin身份登录,SEVERE);中止;万一;万一;

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.

首先,这将检查哪个O.S.然后登录用户为TRUE,最终用户在具有管理员权限的NT下登录。或退出申请。

Hope this helps you...

希望这可以帮助你......

#2


There are (at least) two ways:

有(至少)两种方式:

  • Check if SYSINFO.WINNT.bAdmin_Logged_On is TRUE. If so, the user has Administrator privileges.
  • 检查SYSINFO.WINNT.bAdmin_Logged_On是否为TRUE。如果是,则用户具有管理员权限。

  • Check if Is(USER_ADMINISTRATOR,"") returns TRUE. If so, the user has Administrator privileges.
  • 检查Is(USER_ADMINISTRATOR,“”)是否返回TRUE。如果是,则用户具有管理员权限。

You can use any one.

你可以使用任何一个。

#3


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

这可以通过进入安装设计器 - >常规信息 - >摘要信息流 - >需要管理权限=是在基本MSI项目中完成

#1


the above problem you can achieve through Installscript

您可以通过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;

例如:if(SYSINFO.WINNT.bWinNT)然后if(!SYSINFO.WINNT.bAdmin_Logged_On)然后MessageBox(您必须以admin身份登录,SEVERE);中止;万一;万一;

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.

首先,这将检查哪个O.S.然后登录用户为TRUE,最终用户在具有管理员权限的NT下登录。或退出申请。

Hope this helps you...

希望这可以帮助你......

#2


There are (at least) two ways:

有(至少)两种方式:

  • Check if SYSINFO.WINNT.bAdmin_Logged_On is TRUE. If so, the user has Administrator privileges.
  • 检查SYSINFO.WINNT.bAdmin_Logged_On是否为TRUE。如果是,则用户具有管理员权限。

  • Check if Is(USER_ADMINISTRATOR,"") returns TRUE. If so, the user has Administrator privileges.
  • 检查Is(USER_ADMINISTRATOR,“”)是否返回TRUE。如果是,则用户具有管理员权限。

You can use any one.

你可以使用任何一个。

#3


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

这可以通过进入安装设计器 - >常规信息 - >摘要信息流 - >需要管理权限=是在基本MSI项目中完成