Using the Distutils

This is the place for queries that don't fit in any of the other categories.

Using the Distutils

Postby leoChristofoli » Thu Sep 05, 2013 1:20 pm

Hi guys.

I have a simple program with 2 modules, so I did an .msi file using the setup.py.

But I have 2 questions:

Can I create a shortcut on desktop or start menu after the installation? I see that its may be possible on python doc, but I didn't understand

And, is there a way to run this application in a machine without a already installed python? Like, import all I need on the package.

Thank you.
leoChristofoli
 
Posts: 9
Joined: Tue Aug 13, 2013 2:51 pm

Re: Using the Distutils

Postby Vik2015 » Thu Sep 05, 2013 2:00 pm

If you want your script to run on any other machine (with same OS ofcource), you can use py2exe (for windows), py2app (for mac), or (I recommend this!) pyinstaller. Pyinstaller can run on linux/win/mac, while py2exe only on win, and py2app only on mac.

Created .msi using setup.py? Interesting. Never heard about it. About shortcuts, honestly, i dont know. I will look around, and maybe find something interesting.

Happy codin'! :D
EDIT:

You can use pyinstaller to create just one file (--onefile), and then build .msi using this (but i haven't used it, so i dont know how it works...).
Vik2015
 
Posts: 21
Joined: Sat May 18, 2013 8:53 pm
Location: Computer

Re: Using the Distutils

Postby leoChristofoli » Thu Sep 05, 2013 2:04 pm

Vik2015 wrote:If you want your script to run on any other machine (with same OS ofcource), you can use py2exe (for windows), py2app (for mac), or (I recommend this!) pyinstaller. Pyinstaller can run on linux/win/mac, while py2exe only on win, and py2app only on mac.

Created .msi using setup.py? Interesting. Never heard about it. About shortcuts, honestly, i dont know. I will look around, and maybe find something interesting.

Happy codin'! :D

Well, to create this .msi I just use setup.py bdist_msi.

I will take a look on this pyinstaller, but I think it don't work with python 3

thanks
leoChristofoli
 
Posts: 9
Joined: Tue Aug 13, 2013 2:51 pm

Re: Using the Distutils

Postby Yoriz » Thu Sep 05, 2013 5:16 pm

cx_freeze works with python 3.
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Spam topic disapproval technician
Windows7, Python 2.7.4., WxPython 2.9.5.0., some Python 3.3
User avatar
Yoriz
 
Posts: 827
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: Using the Distutils

Postby leoChristofoli » Fri Sep 06, 2013 12:10 pm

Thanks everybody for the help.
I made it using cx_freeze. Here's the setup code:

Code: Select all
import sys
from cx_Freeze import setup, Executable

# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"compressed":True}

# GUI applications require a different base on Windows (the default is for a
# console application).

base = None
'''
Use it to hide the prompt

if sys.platform == "win32":
    base = "Win32GUI"
'''

setup(  name = "Compara",
        version = "1.3",
        description = "Compare server's services",
        options = {"build_exe": build_exe_options},
        packages = {"Package Path"},
        executables = [Executable(script="GUIpadrao.py", base=base)])
leoChristofoli
 
Posts: 9
Joined: Tue Aug 13, 2013 2:51 pm


Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 3 guests