Installing to c:\Program Files\

Hi! Is the distutils system suited for installation of a python program to a subfolder of c:\Program Files\ ? I can generate an msi file using the bdist_msi method, but the resulting msi installer puts the files in c:\python27\lib\site-packages (or something like that). My python program basically consists of a python script, two python modules and some text files. None of this should be available to other python programs, so I want it all to be installed in a subdirectory of Program Files. This makes sense, right? The program itself is already capable to be launched from any folder. Can distutils create an msi file for my python program that does what I want? Or should I use some other tool? I want to create an installer that uses the Windows "Add/Remove programs" system, and hopefully allows upgrading to newer program versions without leaving multiple versions installed. Thanks, Torquil Sørensen

On 9 February 2012 19:01, Torquil Macdonald Sørensen <torquil@gmail.com>wrote:
Hi!
Is the distutils system suited for installation of a python program to a subfolder of c:\Program Files\ ?
I can generate an msi file using the bdist_msi method, but the resulting msi installer puts the files in c:\python27\lib\site-packages (or something like that).
My python program basically consists of a python script, two python modules and some text files. None of this should be available to other python programs, so I want it all to be installed in a subdirectory of Program Files. This makes sense, right?
The program itself is already capable to be launched from any folder.
Can distutils create an msi file for my python program that does what I want? Or should I use some other tool? I want to create an installer that uses the Windows "Add/Remove programs" system, and hopefully allows upgrading to newer program versions without leaving multiple versions installed.
Basically the answer is no, you can't use distutils to do this. Instead you should use a tool like py2exe to generate an executable for your program that bundles the Python binaries itself along with the program. You can then create an msi installer for your program using a free tool like WiX. Your bundled installers can then be installed into the standard Windows location and won't require your user to have Python installed to use your program: http://www.py2exe.org/ http://wix.sourceforge.net/ All the best, Michael Foord
Thanks, Torquil Sørensen ______________________________**_________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/**mailman/listinfo/distutils-sig<http://mail.python.org/mailman/listinfo/distutils-sig>
-- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html

Basically the answer is no, you can't use distutils to do this. Instead you should use a tool like py2exe to generate an executable for your program that bundles the Python binaries itself along with the program. You can then create an msi installer for your program using a free tool like WiX. Your bundled installers can then be installed into the standard Windows location and won't require your user to have Python installed to use your program:
Thanks Michael, but I don't think I want to do it that way. Py2exe was familiar to me, but I don't like the idea of bundling Python together with my program. I'll start to investigate the different installer systems that are available for Windows. Best regards, Torquil Sørensen

On 10/02/12 00:29, Michael Foord wrote:
Basically the answer is no, you can't use distutils to do this. Instead you should use a tool like py2exe to generate an executable for your program that bundles the Python binaries itself along with the program. You can then create an msi installer for your program using a free tool like WiX. Your bundled installers can then be installed into the standard Windows location and won't require your user to have Python installed to use your program:
Hi again! That WIX looks like it is up for the job. I'll give it a try. Thanks for mentioning it! Best regards, Torquil Sørensen
participants (2)
-
Michael Foord
-
Torquil Macdonald Sørensen