Summary
Used to modify the environment variables of the target computer at
runtime.
Parameters
Attribute |
Type |
Description |
Required |
name |
string |
The localizable name of the environment variable. The key values are written or removed depending upon
which of the characters in the following table are prefixed to the name. There is no effect in the ordering of
the symbols used in a prefix.
DescriptionCreate the environment variable if it does not exist, and then set it during installation. If the environment variable exists, set it during the installation.Create the environment variable if it does not exist, then set it during installation. This has no effect on the value of the environment variable if it already exists.Remove the environment variable when the component is removed. This symbol can be combined with any prefix.Remove the environment variable during an installation. The installer only removes an environment variable during an installation if the name and value of the variable match the entries in the Name and Value fields of the Environment table. If you want to remove an environment variable, regardless of its value, use the '!' syntax, and leave the Value field empty.This prefix is used with Microsoft� Windows� NT/Windows� 2000 to indicate that the name refers to a system environment variable. If no asterisk is present, the installer writes the variable to the user's environment. Microsoft Windows 95/98 ignores the asterisk and add the environment variable to autoexec.bat. This symbol can be combined with any prefix. A package that is used for per-machine installations should write environment variables to the machine's environment by including * in the Name column. For more information, see http://msdn.microsoft.com/library/en-us/msi/setup/environment_table.aspThe environment variable is set on install and removed on uninstall. This is the usual behavior.Removes an environment variable during an install or uninstall.
More information can be found here: http://msdn.microsoft.com/library/en-us/msi/setup/environment_table.asp
|
True |
append |
string |
Localizable value that is to be set as a formatted string |
True |
component |
string |
Refrence to a component. Allows the variabled to be modified when the component is un/installed. |
True |
Examples
Append the installation path to the user PATH variable.
<environment>
<variable name="PATH" append="'[TARGETDIR]'" component="C__MainFiles" />
</environment>
Syntax
[BuildElement("environment", ProcessXml = false)]
public SchemaElement[] InstallerEnvironmentElement { get; set; }
Attributes
Type |
Description |
BuildElement |
|
Value
Type |
Description |
SchemaElement[] |
|