使用Installshield的Windows安装程序:如何将ALLUSERS设置与Env Vars匹配

时间:2021-10-27 23:18:12

I am making an MSI based installation package with Installshield Express 2011.

我正在使用Installshield Express 2011制作基于MSI的安装包。

I like to set the ALLUSERS field to 2, which means that a per-machine installation is attempted but if that is not possible then a per-user installation is performed.

我喜欢将ALLUSERS字段设置为2,这意味着尝试了每台计算机的安装,但如果不可能,则执行每用户安装。

But my package must also create some environment variables which have to be set as either System or User variables. These do not seem to be affected by the ALLUSERS field, such that if a per-user installation is being performed then the installer may try to set a System environment variable which would be inappropriate/prohibited for a per-user installation.

但是我的包还必须创建一些环境变量,这些变量必须设置为System或User变量。这些似乎不受ALLUSERS字段的影响,因此如果正在执行每用户安装,则安装程序可能尝试设置系统环境变量,该变量对于每用户安装是不合适/禁止的。

Is there way in Installshield to have the enviornment variables set according to whether it is a per-user or per-machine installation?

在Installshield中是否有办法根据是每个用户还是每个机器安装来设置环境变量?

One solution would be to have ALLUSERS set to "" which would cause every installation to be per-user, however this is not suitable for small business environments where different staff may log on and expect to be able to use the product.

一种解决方案是将ALLUSERS设置为“”,这将导致每个安装都是每个用户,但是这不适用于不同员工可能登录并期望能够使用该产品的小型企业环境。

2 个解决方案

#1


1  

Here is a snippet from the MSDN documentation "If the package can be installed per-user or per-machine, create two components: (1) a per-user component with the Environment table entries authored for user settings, and (2) a per-machine component with the Environment table authored for computer settings. Condition the installation of this component using the Privileged property."

以下是MSDN文档的片段“如果可以按用户或按机器安装软件包,请创建两个组件:(1)每个用户组件,其中包含为用户设置创作的环境表条目,以及(2)a为计算机设置创建环境表的每台计算机组件。使用Privileged属性调整此组件的安装。“

http://msdn.microsoft.com/en-us/library/windows/desktop/aa368369(v=vs.85).aspx

http://msdn.microsoft.com/en-us/library/windows/desktop/aa368369(v=vs.85).aspx

#2


0  

In the Install Shield Project under the 3 Configure the target System there is step named Enviroment Variables

在3配置目标系统下的Install Shield Project中,有一个名为Enviroment Variables的步骤

使用Installshield的Windows安装程序:如何将ALLUSERS设置与Env Vars匹配

#1


1  

Here is a snippet from the MSDN documentation "If the package can be installed per-user or per-machine, create two components: (1) a per-user component with the Environment table entries authored for user settings, and (2) a per-machine component with the Environment table authored for computer settings. Condition the installation of this component using the Privileged property."

以下是MSDN文档的片段“如果可以按用户或按机器安装软件包,请创建两个组件:(1)每个用户组件,其中包含为用户设置创作的环境表条目,以及(2)a为计算机设置创建环境表的每台计算机组件。使用Privileged属性调整此组件的安装。“

http://msdn.microsoft.com/en-us/library/windows/desktop/aa368369(v=vs.85).aspx

http://msdn.microsoft.com/en-us/library/windows/desktop/aa368369(v=vs.85).aspx

#2


0  

In the Install Shield Project under the 3 Configure the target System there is step named Enviroment Variables

在3配置目标系统下的Install Shield Project中,有一个名为Enviroment Variables的步骤

使用Installshield的Windows安装程序:如何将ALLUSERS设置与Env Vars匹配