diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java index 8176bf894..eaa277560 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java @@ -197,6 +197,12 @@ public ToolInstallation installTool(ToolInstallRequest request) { } else if (!isIgnoreMissingSoftwareVersionFile()) { LOG.warn("Deleting corrupted installation at {}", installationPath); fileAccess.delete(installationPath); + } else { + // Version file missing but tool allows this - restore it and preserve installation + LOG.warn("Version file missing at {} - restoring it for tool {}", toolVersionFile, this.tool); + // Restore the missing file + this.context.writeVersionFile(resolvedVersion, installationPath); + return createToolInstallation(installationPath, resolvedVersion, false, processContext, additionalInstallation); } } } diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/python/Python.java b/cli/src/main/java/com/devonfw/tools/ide/tool/python/Python.java index f5fc45d35..818426601 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/python/Python.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/python/Python.java @@ -75,6 +75,12 @@ protected boolean isIgnoreSoftwareRepo() { return true; } + @Override + protected boolean isIgnoreMissingSoftwareVersionFile() { + + return true; + } + @Override public ToolRepository getToolRepository() {