New Environment Variable Option

Command Syntax

/NewEnvironment
      -name <name>
      -value <value>
      [-install_operation {CreateUpdate|CreateNotExist|Remove}]
      [-preserve_unistall]
      [-system_variable]
      [-behavior {Replace|Append|Prepend}]
      [-separator <separator>]

This command will add a new environment variable to your project. Its equivalent UI option is the [ New... ] button from Environment Variables page.

Parameters:

  • -name <name>
  • The name of the environment variable.
  • -value <value>
  • The value of the variable.
  • [-install_operation {CreateUpdate|CreateNotExist|Remove}]
  • The install behavior of the environment variable:
    • CreateUpdate - The environment variable will be created or updated if already exists, during the package installation.
    • CreateNotExist- The environment variable will be created only if it doesn't exist.
    • Remove - The environment variable will be deleted during the package installation.
  • [-preserve_uninstall]
  • Set this flag if you don't want to remove the variable when the package is uninstalled.
  • [-system_variable]
  • Set this flag in order to create a system variable.
  • [-behavior {Replace|Append|Prepend}]
  • Specify what action should be performed in case the variable already exists:
    • Replace - If the environment variable already exists, it will be replace during the installation process.
    • Append - If the environment variable already exists, its new value will be appended to the existing one.
    • Prepend - If the environment variable already exists, its new value will be prepended to the existing one.
  • [-separator]
  • Separator used for append and prepend operations. By default it is ;

Example:

AdvancedInstaller.com /edit MyProject.aip
    /NewEnvironment -name PATH -value "C:\test"
    -install_operation CreateUpdate -system_variable -behavior Append