[pywin32-checkins] pywin32/isapi install.py,1.1,1.2
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2005-01-28 04:43:21
|
Update of /cvsroot/pywin32/pywin32/isapi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29172 Modified Files: install.py Log Message: * When removing an extension, don't bother checking the DLL is up to date. * Be more robust in creating and removing virtual directories Index: install.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/install.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** install.py 6 Oct 2004 05:11:52 -0000 1.1 --- install.py 28 Jan 2005 04:43:09 -0000 1.2 *************** *** 158,161 **** --- 158,166 ---- newDir = GetObject(FindPath(options, params.Server, params.Name)) log(2, "Updating existing directory '%s'..." % (params.Name,)) + if newDir.Class != keyType: + log(2, "but it has the wrong class (is %s, expecting %s) - recreating" \ + % (newDir.Class, keyType)) + webDir.Delete(newDir.Class, newDir.Name) + newDir = webDir.Create(keyType, name) else: log(2, "Creating new directory '%s'..." % (params.Name,)) *************** *** 309,319 **** try: directory = GetObject(FindPath(options, vd.Server, vd.Name)) - directory.AppUnload() - parent = GetObject(directory.Parent) - parent.Delete(directory.Class, directory.Name) except pythoncom.com_error, details: rc = _GetWin32ErrorCode(details) if rc != winerror.ERROR_PATH_NOT_FOUND: raise _CallHook(vd, "PostRemove", options) log (1, "Deleted Virtual Directory: %s" % (vd.Name,)) --- 314,338 ---- try: directory = GetObject(FindPath(options, vd.Server, vd.Name)) except pythoncom.com_error, details: rc = _GetWin32ErrorCode(details) if rc != winerror.ERROR_PATH_NOT_FOUND: raise + log(2, "VirtualDirectory '%s' did not exist" % vd.Name) + directory = None + if directory is not None: + # Be robust should IIS get upset about unloading. + try: + directory.AppUnLoad() + except: + exc_val = sys.exc_info()[1] + log(2, "AppUnLoad() for %s failed: %s" % (vd.Name, exc_val)) + # Continue trying to delete it. + try: + parent = GetObject(directory.Parent) + parent.Delete(directory.Class, directory.Name) + except: + exc_val = sys.exc_info()[1] + log(1, "Failed to remove directory %s: %s" % (vd.Name, exc_val)) + _CallHook(vd, "PostRemove", options) log (1, "Deleted Virtual Directory: %s" % (vd.Name,)) *************** *** 337,341 **** if sm.Module is None: sm.Module = dll_name ! def GetLoaderModuleName(mod_name): # find the name of the DLL hosting us. # By default, this is "_{module_base_name}.dll" --- 356,360 ---- if sm.Module is None: sm.Module = dll_name ! def GetLoaderModuleName(mod_name, check_module = None): # find the name of the DLL hosting us. # By default, this is "_{module_base_name}.dll" *************** *** 357,361 **** dll_name = os.path.abspath(os.path.join(path, "_" + base + ".dll")) # Check we actually have it. ! if not hasattr(sys, "frozen"): CheckLoaderModule(dll_name) return dll_name --- 376,381 ---- dll_name = os.path.abspath(os.path.join(path, "_" + base + ".dll")) # Check we actually have it. ! if check_module is None: check_module = not hasattr(sys, "frozen") ! if check_module: CheckLoaderModule(dll_name) return dll_name *************** *** 372,376 **** def UninstallModule(conf_module_name, params, options): ! loader_dll = GetLoaderModuleName(conf_module_name) _PatchParamsModule(params, loader_dll, False) Uninstall(params, options) --- 392,396 ---- def UninstallModule(conf_module_name, params, options): ! loader_dll = GetLoaderModuleName(conf_module_name, False) _PatchParamsModule(params, loader_dll, False) Uninstall(params, options) |