diff --git a/src/octoprint/plugins/softwareupdate/__init__.py b/src/octoprint/plugins/softwareupdate/__init__.py index d271c1041..945199e60 100644 --- a/src/octoprint/plugins/softwareupdate/__init__.py +++ b/src/octoprint/plugins/softwareupdate/__init__.py @@ -9,6 +9,7 @@ import hashlib import logging import logging.handlers import os +import sys import threading import time from concurrent import futures @@ -1913,6 +1914,14 @@ class SoftwareUpdatePlugin( except Exception: self._logger.exception(f"Error while checking if {target} can be updated") update_possible = False + error = "update" + + if target == "octoprint" and sys.platform == "win32": + self._logger.info( + "OctoPrint is running on Windows, it cannot be updated through itself due to Windows' file locking behavior. Please update manually." + ) + update_possible = False + error = "windows" self._version_cache[target] = { "timestamp": time.time(), diff --git a/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js b/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js index aba2cf5b7..a9098d576 100644 --- a/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js +++ b/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js @@ -720,6 +720,19 @@ $(function () { "Unknown error while checking for update, please check the logs" ); } + case "update": { + return gettext( + "Unknown error while checking if update is possible, please check the logs" + ); + } + case "windows": { + return _.sprintf( + gettext( + 'Update not possible under Windows due to its strict file locking behaviour, please see the FAQ' + ), + {url: "https://faq.octoprint.org/update-not-possible-windows"} + ); + } default: { return ""; } diff --git a/src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2 b/src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2 index 4080362ea..b6b2e3342 100644 --- a/src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2 +++ b/src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2 @@ -46,7 +46,7 @@ {% trans %}

- Please take a look at this FAQ entry on how to proceed. + Please take a look at this FAQ entry on how to proceed.

{% endtrans %}
{% trans %} @@ -115,7 +115,7 @@ {{ _('Installed:') }} {{ _('Available:') }} {{ _('Release Notes:') }} - + {{ _('Newer versions of this plugin are not compatible to this setup.') }}