Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #74817
| Date | 2014-07-19 17:23 +0300 |
|---|---|
| Subject | Creating Windows Start Menu or Desktop shortcuts using setuptools bdist_winst installer |
| From | Yaşar Arabacı <yasar11732@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.12045.1405779792.18130.python-list@python.org> (permalink) |
This is a cross-post from stackoverflow:
http://stackoverflow.com/q/24841130/886669
I am not sure about cross-posting policies of python-list. I am sorry
if this is discouraged.
Here is my problem;
I want to create a start menu or Desktop shortcut for my Python
windows installer package. I am trying to follow
https://docs.python.org/3.4/distutils/builtdist.html#the-postinstallation-script
Here is my script;
import sys
from os.path import dirname, join, expanduser
pyw_executable = sys.executable.replace('python.exe','pythonw.exe')
script_file = join(dirname(pyw_executable), 'Scripts', 'tklsystem-script.py')
w_dir = expanduser(join('~','lsf_files'))
print(sys.argv)
if sys.argv[1] == '-install':
print('Creating Shortcut')
create_shortcut(
target=pyw_executable,
description='A program to work with L-System Equations',
filename='L-System Tool',
arguments=script_file,
workdir=wdir
)
I also specified this script in scripts setup option, as indicated by
aforementioned docs.
Here is the command I use to create my installer;
python setup.py bdist_wininst --install-script tklsystem-post-install.py
After I install my package using created windows installer, I can't
find where my shorcut is created, nor I can confirm whether my script
run or not.
How can I make setuptools generated windows installer to create
desktop or start menu shortcuts?
--
http://ysar.net/
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Creating Windows Start Menu or Desktop shortcuts using setuptools bdist_winst installer Yaşar Arabacı <yasar11732@gmail.com> - 2014-07-19 17:23 +0300
csiph-web