An environment variable represents some aspect of your computer environment, that is, the configuration of hardware and software on your computer. Environment variables can be used to represent drives, program paths, directory names, and other items associated with your computer environment as well as information such as the date, time, and your default printer and text editor. Installation programs use environment variables to provide information to the installation and to store information for later use by the application you are installing.
1) When being created, environment variables are available to the MSI after installfinalize. 2) Two actions happen in the execute sequence to install/create the variable.
Note that environment variables do not change for the installation in progress when either the WriteEnvironmentStrings action or RemoveEnvironmentStrings action are run. On Windows 2000, this information is stored in the registry and a message notifies the system of changes when the installation completes. A new process, or another process that checks for these messages, uses the new environment variables.