--- a/scripts/install.py Wed Sep 28 16:15:56 2022 +0200 +++ b/scripts/install.py Thu Sep 29 11:18:50 2022 +0200 @@ -920,29 +920,23 @@ # install the API file if installApis: - for progLanguage in progLanguages: - apidir = os.path.join(cfg["apidir"], progLanguage) - print("Installing {0} API files to '{1}'.".format(progLanguage, apidir)) - try: + if os.access(cfg["apidir"], os.W_OK): + for progLanguage in progLanguages: + apidir = os.path.join(cfg["apidir"], progLanguage) + print("Installing {0} API files to '{1}'.".format(progLanguage, apidir)) if not os.path.exists(apidir): os.makedirs(apidir) - except OSError: - print("Could not create '{0}' (no permission).".format(apidir)) - continue - for apiName in glob.glob( - os.path.join(eric7SourceDir, "APIs", progLanguage, "*.api") - ): - try: + for apiName in glob.glob( + os.path.join(eric7SourceDir, "APIs", progLanguage, "*.api") + ): shutilCopy(apiName, apidir) - except OSError: - print("Could not install '{0}' (no permission).".format(apiName)) - for apiName in glob.glob( - os.path.join(eric7SourceDir, "APIs", progLanguage, "*.bas") - ): - try: + for apiName in glob.glob( + os.path.join(eric7SourceDir, "APIs", progLanguage, "*.bas") + ): shutilCopy(apiName, apidir) - except OSError: - print("Could not install '{0}' (no permission).".format(apiName)) + else: + print("The API directory '{0}' is not writable.".format(cfg["apidir"])) + print("Use the API files provided by the 'API Files' plug-in.") # Create menu entry for Linux systems if sys.platform.startswith("linux"):