Environment Variables Modifications

With MSI Package Builder you can easily add to a project any system and user environment variables so that they will be registered in or unregistered from the operating system when the deployment package is installed on the computer.

MSIX/AppX packages do not support configuring the environment variables during deployment, so, when generated, those changes are included into MSI and App-V deployment packages only.

The environment variables modifications are displayed in the Environment Variables view when the Environment Variables node of a project is selected in the Projects view. Let us take a close look at configuring environment variables modifications.

Environment Variable

Environment Variable

The Environment Variable button from the New group on the regular Project and contextual Environment Variables Ribbon pages should be used to add a new environment variable modification to the currently configured project.

MSI Package Builder allows you to add both modifications to system and user environment variables. To add a modification choose the New Environment Variable item from the pop-up menu or click the Environment Variable button from the New group on regular Project and contextual Environment Variables Ribbon pages. The New Environment Variable dialog will appear on the screen Pic 1.

Configuring an environment variable modification

Pic 1. Configuring an environment variable modification

During the configuration process, you are suggested to specify the environment variable name and the operation to be performed over this variable during a deployment package installation. You can choose between the Create, Create if does not exist, Remove and Remove if value equals operations. For creating an environment variable you should provide a variable value to the Value field. If variable already exists during a generated package installation, you can choose if its value should be overridden with the defined one, or the defined value should be appended/prepended to the existing one. The System Variable checkbox is used to identify if you are going to modify system or user environment variable.

It is also possible to specify if the environment variable should be treated as persistent, thus not removed during a deployment package uninstall process, within the Advanced Options group.

The advanced options are provided for the experienced users. Please do not modify these options until you are positively sure that this modification is required for the correct package deployment.

The Value field supports the property definition placeholders, so you can use the standard MSI properties while specifying the value for an environment variable. See the Property Definition Placeholders section of this document for the list of available placeholders.

Edit

Edit

The Edit button from the Management group on the contextual Environment Variables Ribbon page should be used to change the selected environment variables modification.

Delete

Delete

The Delete button from the Management group on the contextual Environment Variables Ribbon page allows you to delete the selected environment variables modifications from the selected project.

Copy To

Copy To

The Copy To button from the Management group on the contextual Environment Variables Ribbon page should be used to copy the selected environment variables modifications to another location.

Move To

Move To

The Move To button from the Management group on the contextual Environment Variables Ribbon page allows you to move the selected environment variables modifications to another location.

The environment variables modifications can be changed, deleted and transferred to different location. To change the modification, select it in the Environment Variables view and double-click it. Alternatively, you can either choose the Edit item in the pop-up menu or click the Edit button on the contextual Environment Variables Ribbon page. While editing an environment variables modification, it is possible to configure the same options as during its creation. To delete specific modifications from the project, select them and choose the Delete item from the pop-up menu or click the Delete button on the contextual Environment Variables Ribbon page.

If the project contains some environment variables that you don’t want to include into the generated package, you can use the context menu option Exclude from Build. Excluded resources are displayed in the project using the faded icons. Use the context menu option Include in Build for excluded resource to add them into the generated package. The Exclude from Build option allows you to make experiments with the set of resources included into the resulted package with no deleting resources from the project.

The well-known drag/drop and copy/paste techniques are fully supported for copying and moving environment variables modifications between projects. You can also use the Copy To and Move To buttons from the Management group on the contextual Environment Variables Ribbon page to transfer the selected environment variables modifications to a different location. While using these buttons, you are suggested to select a target location in a dialog and confirm your selection Pic 2.

Copying environment variables modifications

Pic 2. Copying environment variables modifications

Now you are introduced to the features used to manage the environment variables modifications with MSI Package Builder and should be able to define the user and system variables modifications to be included into a deployment package without any misunderstanding.