Beginning in Canopy version 1.6, the Canopy Command-Line Interface (CLI) provides options for scripting Canopy setup immediately after installation, with a new
canopy_cli post-install-setup subcommand. These options can also be specified directly to the Windows MSI installer, for single-command installation and setup on Windows.
Here is the usage syntax of this new subcommand, followed by a description of its optional arguments:
$ canopy_cli post-install-setup --help usage: canopy_cli post-install-setup [-h] [--managed-common-install MANAGED_COMMON_INSTALL_PATH | --open-common-install OPEN_COMMON_INSTALL_PATH] [--user-python USER_PYTHON_PATH] [--license-path LICENSE_PATH]
When installing from a Windows MSI, the same functionality is available; the MSI command-line arguments are spelled a little differently:
SETUP_MANAGED_COMMON_INSTALL=xxx SETUP_OPEN_COMMON_INSTALL=xxx SETUP_USER_PYTHON=xxx SETUP_LICENSE_PATH=xxx
Detailed description of each sub-option:
SETUP_MANAGED_COMMON_INSTALL]: This option creates shared System and User virtual environments which will be used by all users, so that per-user environment directories will not be created. The argument is the path to a directory, which will be created if necessary, along with a Canopy (for Windows-64), or Canopy_64bit, or Canopy_32bit subdirectory, below which these shared System and User environments will be created.
SETUP_OPEN_COMMON_INSTALL]: This option creates shared System and User virtual environments, from which each user's System and User environments will inherit. The argument is the path to a directory, which will be created if necessary, along with a Canopy (for Windows-64), or Canopy_64bit, or Canopy_32bit subdirectory, below which these shared System and User environments will be created.
SETUP_USER_PYTHON]: This option sets a pre-existing python environment as the default python environment for this Canopy installation. No User Python environment is created. The argument is the path to an existing python executable (pythonw.exe in Windows, python in Mac or Linux). If Canopy subsequently fails to start, with an error message about the kernel interpreter, then you've probably specified this option incorrectly.
SETUP_LICENSE_PATH]: This option copies existing canopy license files into the Canopy installation directory, and sets global Canopy preferences to use these license files, in conjunction with user login, to determine user privileges. The argument is a list of absolute paths (license files or directories, separated by semicolons in Windows or colons in Mac or Linux). The contents of these files or directories (including subdirectories recursively) are copied into the Canopy installation directory.
SETUP_DISABLE_UPDATE_CHECK]: This option prevents Canopy from checking for available in-app updates. Updates can still be installed by the administrator (by running Canopy with elevated privileges and checking for updates in the Canopy About window), but neither user nor administrator will be notified of the availability of such an update on the Welcome Screen. The argument is "True" or "False". For Open and Managed Common Installs, this option defaults to True and is saved in the central preferences.ini in the Canopy Core installation directory.
Example of usage in Windows (including specifying a log file for audit and debugging):
msiexec /lv*x msi.log /i canopy-1.7.4*.msi SETUP_MANAGED_COMMON_INSTALL="C:\Program Files\Enthought" SETUP_LICENSE_PATH="C:\Users\xx\Canopy-licenses"
Warning: Because of Windows idiosyncrasies, it's essential that you not put a closing backslash character at the end of any of the paths which you pass to msiexec.
Two common scenarios are described in detail in these Knowledge Base articles: