views:

144

answers:

4

I'm making a Python package that gets installed with a setup.py file using setuptools.

The package includes a GUI, and when it's installed on a Windows machine, I want the installation to make a folder in "Programs" in the start menu, and make a shortcut there to a pyw script that will start the GUI. (The pyw think works on all platforms, right?)

On Mac and Linux, I would like it to put this shortcut in whatever Mac and Linux have that is parallel to the start menu.

How do I do this?

A: 

Take a look at how the post-install script for pywin32 does it (search for shortcut). Not sure about Mac/Linux.

ars
+1  A: 

Linux systems typically do not use a .pyw extension for executable applications (though you could if you wish). Traditionally, a python (or perl, bash, etc) script on Linux has no file name extension, has execution permissions, and begins with the 'magic' line "#!/usr/bin/python'. The '#!' lets the OS know that this is a script requiring an interpreter and the following path denotes the interpreter to use.

As for adding the desktop shortcut, freedesktop.org hosts the specifications for how menus work for modern Linux desktops. Specifically, the one you'll be most interested in is the one for Desktop Entries though the one on Menu Generation may also be of interest.

Rakis
+1  A: 

InnoSetup allows you to create shorcuts in the windows start menu. You can add even an uninstall icon.

The relevant sections of the innosetup file are:

UninstallDisplayIcon={app}\myico.ico
[Icons]
Name: "{group}\MyPrograms"; Filename: "{app}\miexe.exe" ;WorkingDir: "{app}"; Comment: "miexe program"

for Mac and Linux I can not help

joaquin
A: 

Since setuptools doesn't seem to give an easy solution to this, I've decided to give up on this idea until I release my app with py2exe/InnoSetup.

cool-RR