当前安装过程installshield 2011的环境变量

时间:2022-06-01 17:40:07

I am creating two environment variable during installation. During installation itself those environment variables are being used by some of my batch files. But I cant find the environment variables available at the point when my batch files starts its execution. Post installation I can find the environment variable being set properly. What am I missing here? Is there any sequencing issue, like I am running my batch files before the environment variable is even set? Please shed some light on this I am trying this for past one week.

我在安装过程中创建了两个环境变量。在安装过程中,我的一些批处理文件正在使用这些环境变量。但是当我的批处理文件开始执行时,我无法找到可用的环境变量。安装后我可以找到正确设置的环境变量。我在这里想念的是什么?是否存在任何排序问题,例如我在环境变量设置之前运行我的批处理文件?请详细说明我过去一周的尝试。

1 个解决方案

#1


1  

It would help to know exactly where your code is being run (sequenced) and whether it's deferred, impersonated and so on, and whether the variable is for the User or the System.

这将有助于确切地知道代码的运行位置(排序)以及它是否被延迟,模拟等,以及变量是用于用户还是系统。

The issues tend to be:

问题往往是:

  1. If it's deferred and running under the local system account it won't see a user variable.

    如果它延迟并在本地系统帐户下运行,则不会看到用户变量。

  2. If it's impersonated it won't see any user variables because impersonation means only user account credentials - it does not mean load up the entire user profile (which is required to see the user variables).

    如果它被模拟,它将不会看到任何用户变量,因为模拟仅表示用户帐户凭据 - 它并不意味着加载整个用户配置文件(这是查看用户变量所必需的)。

  3. You might be doomed because Windows Installer doesn't broadcast or commit the changes until somewhere at the end of the install. A Commit custom action might find them, or a shell execute of a program after InstallFinalize might find them.

    您可能注定要失败,因为Windows Installer不会在安装结束时的某个地方广播或提交更改。在InstallFinalize可能找到它们之后,Commit自定义操作可能会找到它们,或者执行程序的shell。

  4. Services don't see them because the SCM holds them from system boot time and doesn't refresh them.

    服务看不到它们,因为SCM在系统启动时保留它们并且不刷新它们。

  5. If you need a running program to pick them up after the install it needs to respond to the WM_SETTINGSCHANGED Windows message.

    如果您需要一个正在运行的程序来安装它,它需要响应WM_SETTINGSCHANGED Windows消息。

The first three are probably most relevant to your problem.

前三个可能与您的问题最相关。

#1


1  

It would help to know exactly where your code is being run (sequenced) and whether it's deferred, impersonated and so on, and whether the variable is for the User or the System.

这将有助于确切地知道代码的运行位置(排序)以及它是否被延迟,模拟等,以及变量是用于用户还是系统。

The issues tend to be:

问题往往是:

  1. If it's deferred and running under the local system account it won't see a user variable.

    如果它延迟并在本地系统帐户下运行,则不会看到用户变量。

  2. If it's impersonated it won't see any user variables because impersonation means only user account credentials - it does not mean load up the entire user profile (which is required to see the user variables).

    如果它被模拟,它将不会看到任何用户变量,因为模拟仅表示用户帐户凭据 - 它并不意味着加载整个用户配置文件(这是查看用户变量所必需的)。

  3. You might be doomed because Windows Installer doesn't broadcast or commit the changes until somewhere at the end of the install. A Commit custom action might find them, or a shell execute of a program after InstallFinalize might find them.

    您可能注定要失败,因为Windows Installer不会在安装结束时的某个地方广播或提交更改。在InstallFinalize可能找到它们之后,Commit自定义操作可能会找到它们,或者执行程序的shell。

  4. Services don't see them because the SCM holds them from system boot time and doesn't refresh them.

    服务看不到它们,因为SCM在系统启动时保留它们并且不刷新它们。

  5. If you need a running program to pick them up after the install it needs to respond to the WM_SETTINGSCHANGED Windows message.

    如果您需要一个正在运行的程序来安装它,它需要响应WM_SETTINGSCHANGED Windows消息。

The first three are probably most relevant to your problem.

前三个可能与您的问题最相关。