Improve installation of exe file after compilation by py2exe

A forum for general discussion of the Python programming language.

Improve installation of exe file after compilation by py2exe

Postby moje » Tue Jan 28, 2014 1:33 pm

I have myapp.exe which is working correctly, it's a windows service.
Now after compilation I must use command " myapp.exe install " in windows command line (CMD).
I wonder how can I change it, that myapp.exe could install itself after click on it?
Last edited by stranac on Tue Jan 28, 2014 2:10 pm, edited 1 time in total.
Reason: First post lock.
Hi :)
moje
 
Posts: 3
Joined: Tue Jan 28, 2014 1:14 pm
Location: PL

Re: Improve installation of exe file after compilation by py

Postby Mekire » Tue Jan 28, 2014 2:39 pm

Code: Select all
import sys
sys.argv.append("install")

Actually the above is what you could do with a setup.py file; not sure where you would add it so your executable had it.

-Mek

Edit: Wah blind. Just read you used py2exe in the title.
User avatar
Mekire
 
Posts: 1131
Joined: Thu Feb 07, 2013 11:33 pm
Location: Asakusa, Japan

Re: Improve installation of exe file after compilation by py

Postby moje » Tue Jan 28, 2014 4:25 pm

I added it into myapp.py and it's work but it isn't good for a windows service.
Service was installed without (service) name, display name, description and startup type.
Hi :)
moje
 
Posts: 3
Joined: Tue Jan 28, 2014 1:14 pm
Location: PL

Re: Improve installation of exe file after compilation by py

Postby moje » Fri Jan 31, 2014 2:11 pm

I have another question.
I can install myapp.exe on computer without Python but it don't work.
Where I made a mistake?

Code: Select all
setup(
    options = {'py2exe': {
   'includes' : ['win32service', 'win32serviceutil', 'win32event', 'datetime', 'ftplib', 're', 'os', '_winreg', 'time', 'shutil', 'subprocess', 'inspect', 'sys', 'win32con', 'traceback'],
   'dll_excludes' : ['w9xpopen.exe'],
   'bundle_files': 1,
   'compressed': True}},
   service = [{'modules' : 'myapp, 'cmdline_style' : 'pywin32'}],
    console = ['myapp.py'],
    zipfile = None
)
Hi :)
moje
 
Posts: 3
Joined: Tue Jan 28, 2014 1:14 pm
Location: PL


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 5 guests

cron