From 71d2c567094aba356b5fd226a63a236622dce56c Mon Sep 17 00:00:00 2001 From: Per Olofsson Date: Fri, 16 Sep 2016 09:20:54 -0400 Subject: [PATCH] Better OS version mismatch error dialog. --- AutoDMG/IEDWorkflow.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/AutoDMG/IEDWorkflow.py b/AutoDMG/IEDWorkflow.py index d189846..13d53c5 100644 --- a/AutoDMG/IEDWorkflow.py +++ b/AutoDMG/IEDWorkflow.py @@ -205,7 +205,13 @@ def checkVersion_(self, mountPoint): LogNotice(u"Found source: %@ %@ %@", name, version, build) if installerVersion[:2] != runningVersion[:2]: self.delegate.ejectingSource() - self.dmgHelper.detachAll_(self.rejectSource_) + majorVersion = u".".join(unicode(x) for x in installerVersion[:2]) + self.delegate.sourceFailed_text_(u"OS version mismatch", + u"The major version of the installer and the current OS must match.\n\n" + \ + u"%s %s %s installer requires running %s.x to build an image." % ( + name, version, build, + majorVersion)) + self.dmgHelper.detachAll_(self.alertFailedUnmounts_) return LogNotice(u"Accepted source %@: %@ %@ %@", self.newSourcePath, name, version, build) self._source = self.newSourcePath @@ -237,11 +243,6 @@ def loadImageTemplate_(self, mountPoint): return None return template - def rejectSource_(self, failedUnmounts): - self.delegate.sourceFailed_text_(u"Version mismatch", - u"The major version of the installer and the current OS must match.") - self.alertFailedUnmounts_(failedUnmounts) - def ejectSystemImage_(self, failedUnmounts): self.alertFailedUnmounts_(failedUnmounts)