Hi Mark,
You are absolutely right about the lack of documentation on this, it was a
big pain in a project I worked on last year. I should probably put a blog
post together somewhere...
I don't have a lot of time at the moment, but I took a couple of minutes to
strip down some of my code to just the basic parts for a Windows service. I
haven't actually tried using this stand alone, but it should give you a
better idea of what's entailed to get it working and hopefully answer some
questions. My biggest issue with getting this working is it was very hard
to get any kind of real debugging output in the case where the service just
wouldn't start for some reason.
https://gist.github.com/dmccombs/49f2f0de3c3f9bd452f2
Hopefully this can help point you in the right direction, and if you have
more specific questions after playing with this I'll try to answer them.
Take care,
-Dan
[image: Dyn logo, Dyn.com] <http://dyn.com/>
<http://twitter.com/dyn> <http://twitter.com/dyninc> [image: Dyn facebook
account] <http://facebook.com/dyn> [image: Dyn LinkedIn account]
<http://linkedin.com/company/dyn>
Dan McCombs / Senior Software Engineer
603 296 1568 @danmccombs <http://twitter.com/danmccombs/>
On Wed, Feb 18, 2015 at 11:16 PM, Mark Grandi <markgra...@gmail.com> wrote:
> I have some questions about using cx_freeze to create a python windows
> service. Since there is literally 0 documentation about this, I had to look
> at the source for a lot of things, but I still have some questions. I am
> running python3 64 bit if it helps.
>
> 1: What is the lifecycle of the windows service? Obviously the first
> things that get called are Initialize() and Run(), but what happens after
> that? I know Run() keeps going, but mainly, what should be the last method
> to return? Should Run() exit before Stop()? Its unclear from Win32Service.c
> what is supposed to exit first.
>
> 2: Is there any way to get the 'generated source' for the exe? I'm having
> problems with my program and it seems to only happen when its compiled as
> an exe, (getting a WinError: Invalid Handle with a bogus stack trace) so
> i'm thinking its something in the C part of the exe, but I can't really
> debug it as I don't have the source to have visual studio step through /
> set breakpoints. Or should I make a separate message about this problem?
>
> ~Mark Grandi
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
> _______________________________________________
> cx-freeze-users mailing list
> cx-freeze-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/cx-freeze-users
>
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
cx-freeze-users mailing list
cx-freeze-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users