I have a working Windows Service, That I use py2exe currently to build into an exe, and then use WiX toolset to build the MSI.
This structure works, however, when introducing esky into the mix for silent and automatic service updates, I am not properly getting the updated version.
from distutils.core import setup
import shutil, os
from esky import bdist_esky
# Setup.py for Windows Service. Works with Py2exe
#
class Target:
def __init__(self, **kw):
self.__dict__.update(kw)
self.version = "1.0.0"
self.company_name = ""
self.copyright = "2015"
self.name = " Edit Service"
myservice = Target(
description = 'Edit Tracker Service',
modules = ['Logon_Service'],
cmdline_style='pywin32'
)
setup(
name = " Edit Service",
data_files=[('files', ['configs.yaml']),
],
version = "1.0.0",
options = {
"bdist_esky":
{
"includes": ['yaml', 'pymysql', 'win32timezone'],
"freezer_module": 'py2exe',
}
},
zipfile = None,
service=[myservice]
)
Running python setup.py bdist_esky
with the above setup.py results in the .zip file being made. After unzipping, the executable and service are properly able to installed, and started.
After incrementing version number, and running python setup.py bdist_esky
again, I get another zip file created.
I then run the original .exe and it properly sees hte update, but it fails to perform, returning the following exception
You are running: 1.0.0
('ERROR UPDATING APP:', OSError(None, 'unable to cleanup: startup hooks not run'
))
The excerpt my Win32Service Implementation as it relates to esky is the following
if getattr(sys, "frozen", False):
app = esky.Esky(sys.executable, "http://localhost.com:8000")
print "You are running: %s" % app.active_version
try:
if(app.find_update() != None):
app.auto_update()
appexe = esky.util.appexe_from_executable(sys.executable)
os.execv(appexe,[appexe] + sys.argv[1:])
except Exception as e:
print("ERROR UPDATING APP:", e)
app.cleanup()
If there is any more info required, I will add more code as needed. THe goalis to achieve the following.
- Build Executable / MSI
- Deploy everywhere
- Update automatically from central server.
I am very new to distrubtions and esky in general, any and all advice is appreciated!