使用py2exe生成windows服务在win7下可以正常运行,但是到了xp下面可以安装,但是无法启动;报“服务没有及时响应或控制请求”的错误,改用pyinstaller生成也是不行;查资料后修改setup.py如下即可,服务名、脚本名请自行替换:
#!/usr/bin/python #-*-coding:cp936-*-from distutils.core import setupimport py2execlass Target: def __init__(self, **kw): self.__dict__.update(kw) # for the versioninfo resources self.version = "1.1.8" self.company_name = "Yovole Shanghai Co. Ltd." self.copyright = "Copyright (c) 2013 Founder Software (Shanghai) Co., Ltd. " self.name = "Guest Agent"myservice = Target( description = 'Yovole Cloud Desktop Guest Agent', modules = ['service'], cmdline_style='pywin32' #icon_resources=[(1, "cartrigde.ico")] )options = {"py2exe": { "compressed": 1, "bundle_files": 1 } } setup( service=[myservice], options = options, zipfile = None, windows=[{"script": "service.py"}], )
本文标题:解决py2exe生成windows服务不能正常启动的问题本文链接:http://www.maben.com.cn/archives/629.html转载请注明出处 当明知不可挽回,唯一补偿的方法就是怀念,