Using py2exe to generate windows Services can run normally in win7, but it can be installed under xp, but the error "the service did not respond in time or control the request" cannot be started, it cannot be generated by using pyinstaller. After checking the information, modify setup. you can replace the service name and Script Name as follows:
The Code is as follows:
#! /Usr/bin/python
#-*-Coding: cp936 -*-
From distutils. core import setup
Import py2exe
Class 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'],
Export line_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"}],
)