Skip to main content
Version: v3

Environment Element

Description
Environment variables added or removed for the parent component.
Windows Installer references
Environment Table
Parents
Component
Inner Text
None
Children
None
Attributes
NameTypeDescriptionRequired
IdStringUnique identifier for environment entry.Yes
ActionEnumerationSpecfies whether the environmental variable should be created, set or removed when the parent component is installed. This attribute's value must be one of the following:
create
Creates 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.
set
Creates the environment variable if it does not exist, and then set it during installation. If the environment variable exists, set it during the installation.
remove
Removes 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 attributes. If you want to remove an environment variable, regardless of its value, do not set the Value attribute.
 
NameStringName of the environment variable.Yes
PartEnumerationThis attribute's value must be one of the following:
all
This value is the entire environmental variable. This is the default.
first
This value is prefixed.
last
This value is appended.
 
PermanentYesNoTypeSpecifies that the environment variable should not be removed on uninstall. 
SeparatorStringOptional attribute to change the separator used between values. By default a semicolon is used. 
SystemYesNoType Specifies that the environment variable should be added to the system environment space. The default is 'no' which indicates the environment variable is added to the user environment space.  
ValueString The value to set into the environment variable. If this attribute is not set, the environment variable is removed during installation if it exists on the machine.  
See Also
Wix Schema