diff --git a/UniversalModloader.py b/UniversalModloader.py index 5fb24f8..b3774fd 100644 --- a/UniversalModloader.py +++ b/UniversalModloader.py @@ -191,6 +191,14 @@ def mainMenu(): if choice == "2": unloadMods(True); input("Press ENTER to continue.") if choice == "3": openModsFolder() +def requestAppPath(): + while True: + clear() + dir = input("Please insert a folder via Drag&Drop:\n") + dir = dir.replace('"',"") + if os.path.isdir(dir) == True: + return dir + def setupVariables(): global appPath global appName @@ -199,7 +207,14 @@ def setupVariables(): global modPath global originalModPath - appPath = sys.argv[1] + if len(sys.argv) < 2: + appPath = requestAppPath() + else: + appPath = sys.argv[1] + + if os.path.isdir(appPath) == False: + raise NameError("Folder not found: " +appPath) + if os.path.isdir(appPath.replace(" - umlOriginal","")): appPath = appPath.replace(" - umlOriginal","") appName = appPath.replace(os.path.dirname(appPath)+ "\\","") originalAppPath = appPath + " - umlOriginal"