Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access denied using Py2exe

I'm using Py2exe to create an executable as a windows service.

When I run the script I get this error:

File "C:\TeamCity\buildAgent\work\582d895bd5b431ac\winpython\WinPython-32bit-2.7.3.3\python-2.7.3\lib\site-packages\py2exe\build_exe.py", line 860, in build_executable add_resource(ensure_unicode(exe_path), script_bytes, u"PYTHONSCRIPT", 1, True) RuntimeError: EndUpdateResource: Access is denied.

This is the call to py2exe:

    setup(
    name = NAME,
    description = DESCRIPTION,
    version = '1.0.133.43',
    service = [{'modules':["ServiceLauncher"], 'cmdline':'pywin32'}],
    zipfile=None,
    options = {
        "py2exe":{"packages":"encodings",
                  "includes":"win32com,win32service,win32serviceutil,win32event",
                  "excludes":"libiomp5md.dll"
        },
        },
    )

The problem occurs only on the build machine, it runs fine on my dev pc.

I've tried to set Full Control to everyone on the work folder, but it doesn't work.

Any idea?

Thank you.

like image 785
Be.St. Avatar asked Feb 18 '14 08:02

Be.St.


People also ask

What is the use of py2exe?

py2exe turns Python programs into packages that can be run on other Windows computers without needing to install Python on those computers. You must run py2exe on a Windows computer.


1 Answers

After two days investigating we found a solution with the help of the IT staff.

The issue arise when py2exe try to modify the executable adding metadata and\or icon.

The root cause? Simple... ANTIVIRUS.

It considers that operation a threat and cause the Access Denied error.

Thank you all!

like image 158
Be.St. Avatar answered Sep 22 '22 07:09

Be.St.