使用 Py2exe 拒绝访问 [英] Access denied using Py2exe

查看:57
本文介绍了使用 Py2exe 拒绝访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Py2exe 创建一个可执行文件作为 Windows 服务.

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

当我运行脚本时出现此错误:

When I run the script I get this error:

文件C:\TeamCity\buildAgent\work\582d895bd5b431ac\winpython\WinPython-32bit-2.7.3.3\python-2.7.3\lib\site-packages\py2exe\build_exe.py",第860行,在build_executableadd_resource(ensure_unicode(exe_path), script_bytes, u"PYTHONSCRIPT", 1, True)运行时错误:EndUpdateResource:访问被拒绝.

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.

这是对py2exe的调用:

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.

有什么想法吗?

谢谢.

推荐答案

经过两天的调查,我们在 IT 人员的帮助下找到了解决方案.

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

当 py2exe 尝试修改添加元数据和\或图标的可执行文件时出现问题.

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.

谢谢大家!

这篇关于使用 Py2exe 拒绝访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆