diff --git a/core/src/main/groovy/com/muwire/core/Core.groovy b/core/src/main/groovy/com/muwire/core/Core.groovy index 52631143..e1be94de 100644 --- a/core/src/main/groovy/com/muwire/core/Core.groovy +++ b/core/src/main/groovy/com/muwire/core/Core.groovy @@ -168,6 +168,7 @@ public class Core { final WatchedDirectoryManager watchedDirectoryManager final NegativeFiles negativeFiles private final TrackerResponder trackerResponder + final AutoUpdater autoUpdater private final Router router @@ -536,9 +537,10 @@ public class Core { String className = System.getProperty("auto.updater.class") log.info("initializing auto-updater $className") Class clazz = Class.forName(className) - AutoUpdater autoUpdater = (AutoUpdater) clazz.newInstance() + autoUpdater = (AutoUpdater) clazz.newInstance() autoUpdater.init(this) - } + } else + autoUpdater = null File modulesProps = new File(home, "mwmodules.list") if (modulesProps.exists()) { diff --git a/gui/griffon-app/views/com/muwire/gui/UpdateView.groovy b/gui/griffon-app/views/com/muwire/gui/UpdateView.groovy index 00ac18b1..1f0511c9 100644 --- a/gui/griffon-app/views/com/muwire/gui/UpdateView.groovy +++ b/gui/griffon-app/views/com/muwire/gui/UpdateView.groovy @@ -42,7 +42,7 @@ class UpdateView { panel (constraints : BorderLayout.SOUTH) { if (model.available != null) button(text : trans("FIND"), toolTipText: trans("TOOLTIP_FIND"), searchAction) - else if (model.downloaded != null) + else if (model.downloaded != null && model.core.autoUpdater != null) button(text : trans("RESTART"), toolTipText: trans("TOOLTIP_RESTART"), restartAction) button(text : trans("CLOSE"), closeAction) }