Arthur
Posts: 69
Joined: Wed May 19, 2010 9:53 am

Python package install

Hi,

I would like to install a Python package (https://pypi.python.org/pypi/rpdb/) but this uses a Python script as it's installer (setup.py). I can't work out how to do this. I presume I can't run this as a prerequisite, and I can't see how to put this into a temporary folder and then call it.

Regards, Arthur
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Python package install

Hi Arthur,

This is very easy. First you must extract the contents of the archive and add them in Files and Folders page, including the setup.py file.

Then you need to add a custom action that calls python.exe and passes the path to setup.py in its command line. For this you can use our predefined custom action "Launch File" from Custom Actions page. To get the path of Python.exe from where the package will be installed you
can create a search in Search page, then refer it in the custom action like this [MY_PYTHON_SEARCH_NAME].

The custom action should be added after the group "Add Resources", scheduled be executed only on "Install" and enable the options "When the system is being deferred" and "Run under the LocalSystem account with full privileges".

This custom action will actually launch Python.exe, pass to him the path to the setup.py file (you need to set it in "Command Line" field in Advanced Installer) and execute it, similar to how Notepad++ can test *.py files.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”