admin.py 文件源码

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

项目:fritzchecksum 作者: mementum 项目源码 文件源码
def CheckAdminRun():
    if not appconstants.AppUACAdmin or UserIsAdmin():
        # if admin not needed or already admin ... go ahead
        return True, None

    if not appconstants.appisfrozen() or sys.platform != 'win32':
        # Manifest cannot be used if not frozen or in unix-like systems
        return RunAsAdmin()
    elif not appconstants.AppUACManifest:
        # frozen and win32 ... and no manifest
        return RunAsAdmin()
    else:
        # frozen win32 ... and manifest
        # we "must" be running as Admin, becasue if not the application
        # would not have started
        # (or else ... a bug in the manifest or embedding process has acted)
        return False, ('Unknown error. Manifest must request Administrator'
                       ' permissions before launch')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号