Friday, January 22, 2010

Running Python's Distutil Created Wininst Installers (.exe) from the Commmand Line

I recently created an installer with Inno Setup that was used to launch a bunch of other installers. As such, I needed to, more or less, run those sub-installers from the command line during install and uninstall. The sub-installers were executables generated by Python's distutils using the wininst bdist command (i.e. "wininst" installers for Windows).

Given the wininst installer mypymodule.1.2.exe, to install, execute the command mypymodule.1.2.exe. This places the files Removemypymodule.exe and wininst-mypymodule.log in the root directory of the Python installation. To uninstall execute the command path/to/python/root/Removemypymodule.exe -u path/to/python/root/wininst-mypymodule.log.