pywin32_postinstall.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:remoteControlPPT 作者: htwenning 项目源码 文件源码
def CopyTo(desc, src, dest):
    import win32api, win32con
    while 1:
        try:
            win32api.CopyFile(src, dest, 0)
            return
        except win32api.error, details:
            if details.winerror==5: # access denied - user not admin.
                raise
            if silent:
                # Running silent mode - just re-raise the error.
                raise
            tb = None
            full_desc = "Error %s\n\n" \
                        "If you have any Python applications running, " \
                        "please close them now\nand select 'Retry'\n\n%s" \
                        % (desc, details.strerror)
            rc = win32api.MessageBox(0,
                                     full_desc,
                                     "Installation Error",
                                     win32con.MB_ABORTRETRYIGNORE)
            if rc == win32con.IDABORT:
                raise
            elif rc == win32con.IDIGNORE:
                return
            # else retry - around we go again.

# We need to import win32api to determine the Windows system directory,
# so we can copy our system files there - but importing win32api will
# load the pywintypes.dll already in the system directory preventing us
# from updating them!
# So, we pull the same trick pywintypes.py does, but it loads from
# our pywintypes_system32 directory.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号