regutil.py 文件源码

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

项目:purelove 作者: hucmosin 项目源码 文件源码
def RegisterPythonExe(exeFullPath, exeAlias = None, exeAppPath = None):
    """Register a .exe file that uses Python.

       Registers the .exe with the OS.  This allows the specified .exe to
       be run from the command-line or start button without using the full path,
       and also to setup application specific path (ie, os.environ['PATH']).

       Currently the exeAppPath is not supported, so this function is general
       purpose, and not specific to Python at all.  Later, exeAppPath may provide
       a reasonable default that is used.

       exeFullPath -- The full path to the .exe
       exeAlias = None -- An alias for the exe - if none, the base portion
                 of the filename is used.
       exeAppPath -- Not supported.
    """
    # Note - Dont work on win32s (but we dont care anymore!)
    if exeAppPath:
        raise error("Do not support exeAppPath argument currently")
    if exeAlias is None:
        exeAlias = os.path.basename(exeFullPath)
    win32api.RegSetValue(GetRootKey(), GetAppPathsKey() + "\\" + exeAlias, win32con.REG_SZ, exeFullPath)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号