1

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.

  1. Build Executable / MSI
  2. Deploy everywhere
  3. Update automatically from central server.

I am very new to distrubtions and esky in general, any and all advice is appreciated!

Busturdust
  • 2,447
  • 24
  • 41
  • Did u solve this issue? – yuval Nov 29 '15 at 13:07
  • @yuval no, sorry, we actually abandoned the concept and are pushing automatic updates through a Domain Group Policy – Busturdust Nov 29 '15 at 19:38
  • May you elaborate on the way you distribite updates, because im also looking for an alternitive to esky – yuval Nov 29 '15 at 21:45
  • @yuval This was an internal corporate project, and as such, we were able to convince our users to put their workstation's on an internal domain. Using this domain, we make a software policy that says "if the system on the domain does not have the software, install the software. If it is not the newest version, update it."..... We use the natural incremanal update function of the MSI (which was built with `WiX Toolset` ) and as long as we remember to increment the version of the application, and replace the MSI on domain, as soon as the station is logged in, it will get the udpate – Busturdust Nov 30 '15 at 13:19
  • @yuval a resource for domain policy https://support.microsoft.com/en-us/kb/816102 – Busturdust Nov 30 '15 at 13:19
  • 1
    there is an old issue on windows services with esky ... https://github.com/cloudmatrix/esky/issues/39 – timeyyy Nov 30 '15 at 23:51

0 Answers0