I am trying to create an installer from a Python application we coded. I wrote a simple setup.py file and it generates a .msi file no problem, but I can't figure out the way to specify the default install path. We don't want it to install to the default "C:\Program Files" directory. Help?
Distutils is rather limited in functionality when it comes to creating installers. I would suggest you use NSIS instead. Its quite simple and lets you customise a lot more than distutils.
The other way would be to manually add --initial-target-dir to the argument list in setup.py (before calling the setup
function):
if 'bdist_msi' in sys.argv:
sys.argv += ['--initial-target-dir', 'c:\default\path']
It appears that in the current version, adding the following to your setup script provides the same functionality:
setup(
...
options={'bdist_msi': {'initial_target_dir': 'C:\\alternate\\start\\path'}}
...
)
Note that it requires the backslash, not the forward slash.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With