diff --git a/UniversalModloader.py b/UniversalModloader.py index 06a5d14..78294b8 100644 --- a/UniversalModloader.py +++ b/UniversalModloader.py @@ -188,7 +188,17 @@ def unloadMods(output = False): if output: print("Can't delete folder! Is it in use?") return - os.rename(originalAppPath,appPath) + + tries = 0 + while tries < 100: + try: + os.rename(originalAppPath,appPath) + tries + 1 + except: + time.sleep(0.1) + else: + tries = 10 + #ctypes.windll.kernel32.SetFileAttributesW(appPath,128) if output: print("\nUnloading mods successful.")