Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #74817

Creating Windows Start Menu or Desktop shortcuts using setuptools bdist_winst installer

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <yasar11732@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:Windows': 0.02; 'scripts': 0.03; 'indicated': 0.07; 'sys': 0.07; 'created,': 0.09; 'option,': 0.09; 'os.path': 0.09; 'setup.py': 0.09; 'subject:using': 0.09; 'python': 0.11; 'windows': 0.15; 'dirname,': 0.16; 'docs.': 0.16; 'installer,': 0.16; 'setuptools': 0.16; 'shortcut': 0.16; 'subject: \n ': 0.16; 'trying': 0.19; 'command': 0.22; 'import': 0.22; 'install': 0.23; 'package.': 0.24; 'skip:e 30': 0.24; 'script': 0.25; 'specified': 0.30; 'message-id:@mail.gmail.com': 0.30; 'run': 0.32; 'url:python': 0.33; 'not.': 0.33; "can't": 0.35; 'created': 0.35; 'received:google.com': 0.35; 'policies': 0.36; 'skip:j 20': 0.36; 'url:org': 0.36; 'to:addr:python-list': 0.38; 'skip:- 10': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'url:3': 0.61; 'from:charset:utf-8': 0.61; 'confirm': 0.64; 'here': 0.66; 'url:4': 0.69; 'installer': 0.84; 'join,': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=d+u5MSnvwv7pn4C+pwhInFlF95AU3gClmT7Jv88KXMw=; b=zKqZeiD+bokr7K9H+p2Q/FbQKJeP3qjSRGeZfOTsu0sSrWa4KdPGfQuS6DO7P41APl PHY2w8g29TTfOBX1wAvigKV5S8F/CCF667/8k7Yxza7ChQ0FBm+6yCI/IFfJgGuyMTrL QfMLUiKu6rCKapSgKg8bKik6dCXQyucGwh9Ft0W6j7JtbDnzY/a+F1LC6MLNW99TDdJE dWD76Bjfga4o0o/7BJDP+OKA9V3ga86SOQ5YhqCq24DosU93cA6lcAUpjZOX9IRdl3F9 fGbC8UOd3TQg9aNc3/tkRLslpJQ9gHGr3N8KoBh/sXTcK9coKza+zifOvYF4HrB9s74K +L2Q==
MIME-Version 1.0
X-Received by 10.236.37.231 with SMTP id y67mr18739778yha.146.1405779790686; Sat, 19 Jul 2014 07:23:10 -0700 (PDT)
Date Sat, 19 Jul 2014 17:23:10 +0300
Subject Creating Windows Start Menu or Desktop shortcuts using setuptools bdist_winst installer
From Yaşar Arabacı <yasar11732@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.12045.1405779792.18130.python-list@python.org> (permalink)
Lines 51
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1405779792 news.xs4all.nl 2925 [2001:888:2000:d::a6]:38732
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:74817

Show key headers only | View raw


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


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