<h2>Windows Installer Features</h2>
Python 2.5 is distributed as a Microsoft Installer (MSI) file on Windows. Typically, packages are installed by double-clicking them in the file explorer. However, with the msiexec.exe command line utility, additional features are available, like non-interactive installation and administrative installation.
<h2><a name="automated">Non-interactive Installation</a></h2> With the command line <pre>
msiexec /i python<version>.msi
</pre> installation can be initiated programmatically. Additional parameters can be passed at the end of this command line, like
- msiexec /i python-2.5.msi TARGETDIR=r:python25
<h3>Limited user interface</h3>
The amount of user interface that installer displays can be controlled with /q options, in particular: <ul>
<li> /qn - No interface <li> /qb - Basic interface - just a small progress dialog <li> /qb! - Like /qb, but hide the Cancel button <li> /qr - Reduced interface - display all dialogs thatdon't require user interaction (skip all modal dialogs)
<li> /qn+ - Like /qn, but display "Completed" dialog at the end <li> /qb+ - Like /qb, but display "Completed" dialog at the end
<h3>Target directory</h3> The property TARGETDIR determines the root directory of the Python installation. For example, a different installation drive can be specified with <pre>
</pre> The default TARGETDIR is [WindowsVolume]Python<version>.
<h3>Installation for All Users</h3> Adding <pre>
</pre> causes an installation for all users. By default, the non-interactive installation install the package just for the current user, and the interactive installation offers a dialog which defaults to "all users" if the user is sufficiently privileged.
<h3>Feature Selection</h3> A number of properties allow selection of features to be installed, reinstalled, or removed. The set of features for the Python installer is <ul>
<li>DefaultFeature - install the interpreter proper, plus the core libraries <li>Extensions - register extensions (.py, .pyc, etc) <li>TclTk - install Tkinter, and IDLE <li>Documentation - install documentation <li>Tools - install the Tools/ directory <li>Testsuite - install Lib/test/
</ul> In addition, ALL specifies all features. All features depend on DefaultFeature, so installing any feature automatically installs the default feature as well. The following properties control features to be installed or removed <ul>
<li>ADDLOCAL - list of feature to be installed on the local machine <li>REMOVE - list of features to be removed <li>ADDDEFAULT - list of features added in their default configuration (which is local for all Python features) <li>REINSTALL - list of features to be reinstalled/repaired <li>ADVERTISE - list of feature for which to perform an advertise installation
</ul> There are a few additional properties available; see the MSDN documentation for details.<p> With these options, adding <pre>
</pre> installs the interpreter itself and registers the extensions, but does not install anything else.
<h2>Uninstallation</h2> With <pre>
msiexec /x python<version>.msi
</pre> python can be uninstalled. It is not necessary to have the MSI file available for uninstallation; alternatively, the package or product code can also be specified. You can find the product code by looking at the properties of the Uninstall shortcut that Python installs in the start menu.
<h2>Administrative installation</h2> With <pre>
msiexec /a python<version>.msi
</pre> an "administrative" (network) installation can be initiated. The files get unpacked into the target directory (which should be a network directory), but no other modification is made to the local system. In addition, another (smaller) msi file is generated in the target directory, which clients can then use to perform a local installation (future versions may also offer to keep some features on the network drive altogether).<p> Currently, there is no user interface for administrative installations, so the target directory must be passed on the command line.<p> There is no specific uninstall procedure for an administrative install - just delete the target directory if no client uses it anymore.
<h2>Advertisement</h2> With <pre>
msiexec /jm python<version>.msi
</pre> it would be possible, in principle, to "advertise" python to a machine (with /ju to a user). This would cause the icons to appear in the start menu, and the extensions to become registered, without the software actually being installed. The first usage of a feature would cause that feature to be installed.<p> <em style="color:brown">The Python installer currently supports just advertisement of start menu entries, but no advertisement of shortcuts.</em>
<h2>Automatic Installation on a Group of Machines</h2>
With Windows Group Policy, it is possible to automatically install Python an a group of machines. To do so, perform the following steps: <ol>
<li>Log on to the domain controller <li>Copy the MSI file into a folder that is shared with access granted to all target machines. <li>Open the MMC snapin "Active Directory users and computers" <li>Navigate to the group of computers that need Python <li>Open Properties <li>Open Group Policies <li>Add a new polices, and edit it <li>In Computer Configuration/Software Installation, choseNew/Package
<li>Select the MSI file through the network path <li>Optionally, select that you want the Python to be deinstalled if the computer leaves the scope of the policy.
</ol> Group policy propagation typically takes some time - to reliably deploy the package, all machines should be rebooted.