VPython depends on Python. The current version of VPython (2.4-3.22b) depends on Python 2.4.1.
There are problems with both the Python installer and the VPython installer.
Python installer issue
The real problem is with the Python 2.4.1 installer. Python will put the InstallPath registry setting (which indicates where Python is installed) under HKEY_CURRENT_USER instead of HKEY_LOCAL_MACHINE under some circumstances:
(1) if you are not a member of the Administrators group
(2) if you choose "Install for Just Me" rather than "Install for All Users",
(3) if you automate the Python install using "msiexec.exe /i python-2.4.1.msi /q". The /q (quiet) switch causes different behavior than the defaults with a manual install ("msiexec.exe /i python-2.4.1.msi").
This is a mistake in the Python installer. The path to an installed application always belongs under HKLM, because the path to installed software is a machine-specific setting. If the path is in HKCU, the InstallPath setting can follow a user to a machine where Python is not installed.
VPython installer issue
The VPython installer looks for the path to Python. The installer *only* looks in HKEY_LOCAL_MACHINE for the InstallPath (specifically,
HKLM\Software\Python\PythonCore\2.4\InstallPath). This is a reasonable assumption, but doesn't actually work with the Python installer.
The problem is that the VPython installer does not gracefully handle the situation in which it cannot find the InstallPath for Python, such as when the InstallPath is in HKEY_CURRENT_USER (see "What it looks like when things go wront installing VPython" below). The VPython installer prompts for the path to Python, and then does not seem to be able use it.
This will result in the following scenario when you try to run the VPython installer:
What it looks like when things go wrong installing VPython
1. Start the VPython Installer. Under Windows XP Service Pack 2, you'll be prompted by Windows with an "Open File - Security Warning" that complains "The publisher could not be verified", and notes that it's from an "Unknown Publisher". Click Run.
2. Click Next to get started. An error message appears. Setup is the title, and the text says "Could not locate where Python 2.4 is installed. You will be asked where to install the VPython extensions." Click OK.
3. The dialog box says "Setup will install VPython for Python 2.4 into the following folder." However, no folder is listed. You are prompted for a location. You might try manually entering or browsing to C:\Python24 or C:\Python24\.
4. Then there is a second error message, identical to the first. Setup is the title, and the text says "Could not locate where Python 2.4 is installed. You will be asked where to install the VPython extensions." Click OK.
5. You are at the Select Components dialog. Accept the defaults for a full install and click Next.
6. Then the Additional Tasks dialog appears. Accept the defaults and click Next.
7. You are at the Ready to Install dialog. Click Install. Now you get the final error message. The title is Error, and the text is "You must enter a folder name." Click OK. The installer quits without installing VPython.
There are three workarounds. All require installing or reinstalling Python.
Uninstall Python, and reinstall it as Administrator. Choose the "Install for All Users" option. You should then be able to install VPython.
(2) Registry hack:
Manually add both of the following in the registry entries (string values):
This is the minimum to get through the VPython install. You should make sure that you get all the Python registry settings, really. You'd probably want to duplicate everything under HKEY_CURRENT_USER\Software\Python in HKEY_LOCAL_MACHINE. The settings under that key really belong under HKLM, not HKCU.
(3) How to make a silent install of Python that puts its InstallPath settings in HKLM rather than HKCU:
Specify a property on the command line so that the application is installed for all users. Here's how (case DOES matter):
"msiexec.exe /i python-2.4.1.msi ALLUSERS=1 /q"
This does not always work because the Python installer is not digitally signed. You'll have the same "Open File - Security Warning" problem noted above, but with the quiet switch, you won't see the warning. Instead, the installer will fail completely and MSIEXEC returns an error complaining that the package is damaged or cannot be found. This doesn't happen every time, I think just until you run the app successfully by hand once to get past that warning. Of course, for automation, that doesn't help at all.
In the end, dealing with the Unknown Publisher issue was aggravating enough that I just saved the time and repackaged Python snapshot-style with AdminStudio, and doing VPython through installation monitoring in AdminStudio.
VPython is really nothing but a few thousand tiny files that go in the Python24 directory plus a shortcut on the desktop to the IDLE. You could install it with a batch file.
Python is a handful of shortcuts in the start menu, 28 registry settings, one under HKLM\Software\Microsoft\Windows\CurrentVersion\AppPaths\Python.exe\@=%_Python24%\Python.exe, and the rest you can just export out of HKLM\Software\Python (or HKCU\Software\Python if you're unlucky). All the files are under C:\Python24. You could install it with a batch file too.