<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
    <options type="firmware" customize="never" hostArchitectures="i386" rootVolumeOnly="true"/>
    <title>SU_TITLE</title>
    <script>

var EFIDict = {
   "Mac-942459F5819B171B" : {
      "efi-version" : "MBP81.88Z.0047.B2A.1506082203"
   },
   "Mac-FC02E91DDD3FA6A4" : {
      "efi-version" : "IM131.88Z.010A.B08.1506081728"
   },
   "Mac-42FD25EABCABB274" : {
      "efi-version" : "IM151.88Z.0207.B03.1506050728"
   },
   "Mac-3CBD00234E554E41" : {
      "efi-version" : "MBP112.88Z.0138.B15.1506050548"
   },
   "Mac-8ED6AF5B48C039E1" : {
      "efi-version" : "MM51.88Z.0077.B12.1506081728"
   },
   "Mac-35C1E88140C3E6CF" : {
      "efi-version" : "MBA61.88Z.0099.B19.1506050547",
      "minimum-smc-version" : "2.12f135"
   },
   "Mac-81E3E92DD6088272" : {
      "efi-version" : "IM144.88Z.0179.B10.1506050729"
   },
   "Mac-35C5E08120C7EEAF" : {
      "efi-version" : "MM71.88Z.0220.B03.1506051117"
   },
   "Mac-94245BF5819B151B" : {
      "efi-version" : "MBP81.88Z.0047.B2A.1506082203"
   },
   "Mac-4BC72D62AD45599E" : {
      "efi-version" : "MM51.88Z.0077.B12.1506081728"
   },
   "Mac-2E6FAB96566FE58C" : {
      "efi-version" : "MBA51.88Z.00EF.B03.1506081623"
   },
   "Mac-7BA5B2794B2CDB12" : {
      "efi-version" : "MM51.88Z.0077.B12.1506081728"
   },
   "Mac-031AEE4D24BFF0B1" : {
      "efi-version" : "MM61.88Z.0106.B09.1507101044"
   },
   "Mac-7DF2A3B5E5D671ED" : {
      "efi-version" : "IM131.88Z.010A.B08.1506081728"
   },
   "Mac-00BE6ED71E35EB86" : {
      "efi-version" : "IM131.88Z.010A.B08.1506081728"
   },
   "Mac-942B59F58194171B" : {
      "efi-version" : "IM121.88Z.0047.B21.1506101610"
   },
   "Mac-742912EFDBEE19B3" : {
      "efi-version" : "MBA41.88Z.0077.B12.1506081728"
   },
   "Mac-189A3D4F975D5FFC" : {
      "efi-version" : "MBP111.88Z.0138.B15.1506050728"
   },
   "Mac-937CB26E2E02BB01" : {
      "efi-version" : "MBA71.88Z.0166.B06.1506051511"
   },
   "Mac-4B7AC7E43945597E" : {
      "efi-version" : "MBP91.88Z.00D3.B0B.1506081214"
   },
   "Mac-E43C1C25D4880AD6" : {
      "efi-version" : "MBP121.88Z.0167.B07.1506051617"
   },
   "Mac-7DF21CB3ED6977E5" : {
      "efi-version" : "MBA61.88Z.0099.B19.1506050547",
      "minimum-smc-version" : "2.13f7"
   },
   "Mac-C3EC7CD22292981F" : {
      "efi-version" : "MBP101.88Z.00EE.B09.1506081405"
   },
   "Mac-942B5BF58194151B" : {
      "efi-version" : "IM121.88Z.0047.B21.1506101610"
   },
   "Mac-06F11F11946D27C5" : {
      "efi-version" : "MBP114.88Z.0172.B04.1506051511"
   },
   "Mac-9F18E312C5C2BF0B" : {
      "efi-version" : "MBA71.88Z.0166.B06.1506051511"
   },
   "Mac-94245B3640C91C81" : {
      "efi-version" : "MBP81.88Z.0047.B2A.1506082203"
   },
   "Mac-6F01561E16C75D06" : {
      "efi-version" : "MBP91.88Z.00D3.B0B.1506081214"
   },
   "Mac-94245A3940C91C80" : {
      "efi-version" : "MBP81.88Z.0047.B2A.1506082203"
   },
   "Mac-BE0E8AC46FE800CC" : {
      "efi-version" : "MB81.88Z.0164.B06.1506051617"
   },
   "Mac-27ADBB7B4CEE8E61" : {
      "efi-version" : "IM142.88Z.0118.B11.1506050547"
   },
   "Mac-06F11FD93F0323C5" : {
      "efi-version" : "MBP114.88Z.0172.B04.1506051511"
   },
   "Mac-031B6874CF7F642A" : {
      "efi-version" : "IM141.88Z.0118.B11.1506050727"
   },
   "Mac-F60DEB81FF30ACF6" : {
      "efi-version" : "MP61.88Z.0116.B15.1506050548"
   },
   "Mac-77EB7D7DAF985301" : {
      "efi-version" : "IM143.88Z.0118.B11.1506050727"
   },
   "Mac-FA842E06C61E91C5" : {
      "efi-version" : "IM151.88Z.0207.B03.1506050728"
   },
   "Mac-F65AE981FFA204ED" : {
      "efi-version" : "MM61.88Z.0106.B09.1507101044"
   },
   "Mac-C08A6BB70A942AC2" : {
      "efi-version" : "MBA41.88Z.0077.B12.1506081728"
   },
   "Mac-66F35F19FE2A0D05" : {
      "efi-version" : "MBA51.88Z.00EF.B03.1506081623"
   },
   "Mac-2BD1B31983FE1663" : {
      "efi-version" : "MBP112.88Z.0138.B15.1506050548"
   },
   "Mac-AFD8A9D944EA4843" : {
      "efi-version" : "MBP102.88Z.0106.B08.1506081215"
   }
}


function MacminiNeedsFirmwareUpdate()
{
	// 1 Get actual EFI
	var actualEFI = system.ioregistry.fromPath('IODeviceTree:/rom\@0').version;
	debuglog("This machine has actualEFI '" + actualEFI + "'");

	// 2 If it is not "MM61.88Z.0106.B08.1507101044" return false
	var isCorrectEFI = compareTwoEFIVersions(actualEFI, "MM61.88Z.0106.B08.1507101044");
	if (0 != isCorrectEFI)
	{
		debuglog("actualEFI NOT right version to update, return false");
		return false;
	}
	else
	{
		// 3 it is, so do the rest of the checking.
		debuglog("actualEFI IS right version to update, perform the rest of the checks");
		return needsFirmwareUpdate();
	}
}


function needsFirmwareUpdate()
{
    // 1 Get board-id, which is something like 'Mac-F42C89C8'
    var boardID = system.ioregistry.fromPath('IOService:/')['board-id'];
	debuglog("This machine has boardID '" + boardID + "'");
    
    // 2 Get actual EFI and SMC
    var actualEFI = system.ioregistry.fromPath('IODeviceTree:/rom\@0').version;
	debuglog("This machine has actualEFI '" + actualEFI + "'");
    
    var actualSMC = system.ioregistry.fromPath('IOService:/AppleACPIPlatformExpert/SMC/AppleSMC')['smc-version'];
	debuglog("This machine has actualSMC '" + actualSMC + "'");
    
    // 3 Get intended SMC and EFI out of array
//	var intendedSMC = null;
//	var minEFIforSMC = null;
//	if (SMCDict[boardID])
//	{
//		intendedSMC = SMCDict[boardID]["smc-version"];
//		minEFIforSMC = SMCDict[boardID]["minimum-efi-version"];
//	}
//	debuglog("SMCDict suggests intendedSMC version '" + intendedSMC + "' and minEFIforSMC '" + minEFIforSMC + "'");

	var intendedEFI = null;
	var minSMCforEFI = null;
	if (EFIDict[boardID])
	{
		intendedEFI = EFIDict[boardID]["efi-version"];
		minSMCforEFI = EFIDict[boardID]["minimum-smc-version"];
	}
	debuglog("EFIDict suggests intendedEFI version '" + intendedEFI + "' and minSMCforEFI '" + minSMCforEFI + "'");
	
    // 4 go compare
	debuglog("Off to the comparison machines");
//	return (needsSMCUpdate(actualSMC, intendedSMC, actualEFI, minEFIforSMC) || needsEFIUpdate(actualEFI, intendedEFI, actualSMC, minSMCforEFI));
	return (needsEFIUpdate(actualEFI, intendedEFI, actualSMC, minSMCforEFI));
}

////////////////////////////////

function needsSMCUpdate(actualSMC, intendedSMC, actualEFI, minEFIforSMC)
{
    // Return true if ((actualSMC &lt; intendedSMC) AND (actualEFI &gt;= minEFIforSMC))
	// also handle cases where
    
    debuglog("Checking if we need an SMC update");
	if (!actualSMC)
	{
		debuglog("No actualSMC for this machine, so return false (do not update SMC)");
		return false;
	}
	
	if (!intendedSMC)
	{
		debuglog("No intendedSMC for this machine (which means there's no SMC update in this package), so return false (do not update SMC)");
		return false;
	}

	
    var SMCResult = compareTwoSMCVersions(actualSMC, intendedSMC);
    // if either of the SMC versions is malformed, -2 will be returned, and we should return false
    if (-2 == SMCResult)
    {
        debuglog("Got an error back from SMC comparison; not going to update");
        return false;
    }
    
    // If (actualSMC &gt;= intendedSMC) return false (SMCResult &gt;= 0)
    if (SMCResult &gt;= 0)
    {
        debuglog("SMC is already up to date; not going to update");
        return false;
    }
    
	// OK, we know that the SMC needs an update, so let's check if EFI is new enough to allow
	debuglog("SMC needs an update, but let's check if EFI is new enough to allow");
	if (!minEFIforSMC)
	{
		debuglog("No minEFIforSMC for this machine (which means no minimum EFI is required), so return true (update the SMC)");
		return true;
	}
	
	if (!actualEFI)
	{
		debuglog("No actualEFI for this machine, so return false (do not update SMC)");
		return true;
	}
	
    var EFIResult = compareTwoEFIVersions(actualEFI, minEFIforSMC);
    // if either of the EFI versions is malformed, -2 will be returned, and we should return false
    if (-2 == EFIResult)
    {
        debuglog("Got an error comparing EFI versions; not going to update");
        return false;
    }
    
    // So return true if actualEFI &gt;= minEFIforSMC (EFIResult &gt;= 0)
    if (EFIResult &gt;= 0)
    {
        debuglog("The actual SMC is new enough to allow EFI update, return true");
        return true;
    } else
    {
        debuglog("The actual SMC is too old to allow EFI update, return false");
        return false;
    }
}

function needsEFIUpdate(actualEFI, intendedEFI, actualSMC, minSMCforEFI)
{
    // Return true if ((actualEFI &lt; intendedEFI) AND (actualSMC &gt;= minSMCforEFI))
    
    debuglog("Checking if we need an EFI update");
	if (!actualEFI)
	{
		debuglog("No actualEFI for this machine, so return false (do not update EFI)");
		return false;
	}
	
	if (!intendedEFI)
	{
		debuglog("No intendedEFI for this machine (which means there's no EFI update in this package), so return false (do not update EFI)");
		return false;
	}
	

    var EFIResult = compareTwoEFIVersions(actualEFI, intendedEFI);
    // if either of the EFI versions is malformed, -2 will be returned, and we should return false
    if (-2 == EFIResult)
    {
        debuglog("Got an error back from EFI comparison; not going to update");
        return false;
    }
    
    // If (actualEFI &gt;= intendedEFI) return false (EFIResult &gt;= 0)
    if (EFIResult &gt;= 0)
    {
        debuglog("EFI is already up to date; not going to update");
        return false;
    }
    
    debuglog("EFI needs an update, but let's check if SMC is new enough to allow");
    
    // OK, we know that the EFI needs an update, so let's check if SMC is new enough to allow
	if (!minSMCforEFI)
	{
		debuglog("No minSMCforEFI for this machine (which means no minimum SMC is required), so return true (update the EFI)");
		return true;
	}
	
	if (!actualSMC)
	{
		debuglog("No actualSMC for this machine, so return false (do not update EFI)");
		return true;
	}
	
    var SMCResult = compareTwoSMCVersions(actualSMC, minSMCforEFI);
    // if either of the SMC versions is malformed, -2 will be returned, and we should return false
    if (-2 == SMCResult)
    {
        debuglog("Got an error comparing SMC versions; not going to update");
        return false;
    }
    
    // So return true if actualSMC &gt;= minSMCforEFI (SMCResult &gt;= 0)
    if (SMCResult &gt;= 0)
    {
        debuglog("The actual SMC is new enough to allow EFI update, return true");
        return true;
    } else
    {
        debuglog("The actual SMC is too old to allow EFI update, return false");
        return false;
    }
}

////////////////////////////////

function compareTwoEFIVersions(leftEFI, rightEFI)
{
    // EFI version looks like this: IM142.88Z.0118.B03.1406081853

    // return -1 if left is less than right, 0 if exactly equal, and +1 if left is greater than right
    // return -2 if there's an error

    debuglog("Entering compareTwoEFIVersions with left EFI '" + leftEFI + "' and right EFI '" + rightEFI + "'");
    
    // set up variables for leftEFI and rightEFI fields
    var leftArray = leftEFI.split(".");
    var rightArray = rightEFI.split(".");
    
	// Make sure each of the EFIs has 5 fields
	if (leftArray.length != 5)
	{
		debuglog("leftArray has " + leftArray.length + " fields, error");
		return -2;
	}
	if (rightArray.length != 5)
	{
		debuglog("rightArray has " + rightArray.length + " fields, error");
		return -2;
	}
    
    // Make sure that left and right EFI's first fields match
    var leftFirstField = leftArray[0];
    debuglog("leftEFI's first field is '" + leftFirstField + "'");
    var rightFirstField = rightArray[0];
    debuglog("rightEFI's first field is '" + rightFirstField + "'");
    if (leftFirstField != rightFirstField)
    {
        debuglog("First fields don't match, error");
        return -2;
    }
    debuglog("First fields match, continue");
    
    // Make sure that left EFI's second field is "88Z"
    var leftSecondField = leftArray[1];
    debuglog("leftEFI's second field is '" + leftSecondField + "'");
    if (leftSecondField != "88Z")
    {
        debuglog("leftEFI's second field doesn't match, error");
        return -2;
    }
    debuglog("leftEFI's second field matches, continue");
    
    // Make sure that right EFI's second field is "88Z"
    var rightSecondField = rightArray[1];
    debuglog("rightEFI's second field is '" + rightSecondField + "'");
    if (rightSecondField != "88Z")
    {
        debuglog("rightEFI's second field doesn't match, error");
        return -2;
    }
    debuglog("rightEFI's second field matches, continue");
    
	var hex4pat = /[0-9a-fA-F]{4}/;
    
    // Get leftEFI's major version number. error if non-numeric
    var leftMajorVersion = leftArray[2];
    debuglog("leftEFI's major version number is '" + leftMajorVersion + "'");
    // does this comprise 4 hexadecimal digits?
    if ((leftMajorVersion.length != 4) ||
        (!hex4pat.test(leftMajorVersion)))
    {
        debuglog("left major version number is NOT four hex digits, error");
        return -2;
    }
    debuglog("left major version number is four hex digits, continue");
    
    // Get rightEFI's major version number, error if non-numeric
    var rightMajorVersion = rightArray[2];
    debuglog("rightEFI's major version number is '" + rightMajorVersion + "'");
    if ((rightMajorVersion.length != 4) ||
		(!hex4pat.test(rightMajorVersion)))
	{
        debuglog("right major version number is NOT four hex digits, error");
        return -2;
    }
    debuglog("right major version number is four hex digits, continue");
    
    // Get leftEFI's build type. error if "D"
    var leftBuildType = leftArray[3].charAt(0);
    debuglog("leftEFI's build type is '" + leftBuildType + "'");
    if (("d" == leftBuildType) || ("D" == leftBuildType))
    {
        debuglog("left build type is d, error");
        return -2;
    }
    debuglog("left build type is acceptable to update");
    
    // Get rightEFI's build type. error if "D"
    var rightBuildType = rightArray[3].charAt(0);
    debuglog("rightEFI's build type is '" + rightBuildType + "'");
    if (("d" == rightBuildType) || ("D" == rightBuildType))
    {
        debuglog("right build type is d, error");
        return -2;
    }
    debuglog("right build type is acceptable");
    
    
 	var hex2pat = /[0-9a-fA-F]{2}/;
    
	// Get leftEFI's minor version number, error if non-numeric
    var leftMinorVersion = leftArray[3].substring(1);
    debuglog("leftEFI's minor version number is '" + leftMinorVersion + "'");
    // does this comprise 2 hexadecimal digits?
    if ((leftMinorVersion.length != 2) ||
		(!hex2pat.test(leftMinorVersion)))
    {
        debuglog("leftEFI's minor version number is NOT two hex digits, error");
        return -2;
    }
    debuglog("leftEFI's minor version number is two hex digits, continue");
    
    // Get rightEFI's minor version number, error if non-numeric
    var rightMinorVersion = rightArray[3].substring(1);
    debuglog("rightEFI's minor version number is '" + rightMinorVersion + "'");
    // does this comprise 2 hexadecimal digits?
    if ((rightMinorVersion.length != 2) ||
		(!hex2pat.test(rightMinorVersion)))
    {
        debuglog("right minor version number is NOT two hex digits, error");
        return -2;
    }
    debuglog("right minor version number is two hex digits, continue");
    
    debuglog("Time to compare versions");
    if (parseInt(leftMajorVersion,16) &gt; parseInt(rightMajorVersion,16))
    {
        debuglog("left major &gt; right, returning greaterThan");
        return 1;
    }
    
    if (parseInt(leftMajorVersion,16) &lt; parseInt(rightMajorVersion,16))
    {
        debuglog("left major &lt; right, returning lessThan");
        return -1;
    }
    
    debuglog("major versions are equal, on to the minor versions");
    
    if (parseInt(leftMinorVersion,16) &gt; parseInt(rightMinorVersion,16))
    {
        debuglog("left minor &gt; right, returning greaterThan");
        return 1;
    }
    
    if (parseInt(leftMinorVersion,16) &lt; parseInt(rightMinorVersion,16))
    {
        debuglog("left minor &lt; right, returning lessThan");
        return -1;
    }
    
    debuglog("The two versions are exactly equal, return equalTo");
    return 0;
}

function compareTwoSMCVersions(leftSMC, rightSMC)
{
    // SMC versions look like this: 2.15f6
    // However, if the SMC gets "borked" it reports as "0.000"
	// input is two SMC versions, each as above
	// output:
	//		-2 if there's an error
	//		-1 if left &lt; right
	//		0 if left == right
	//		1 if left &gt; right


	debuglog("Entering compareTwoSMCVersions with leftSMC '" + leftSMC + "' and rightSMC '" + rightSMC +"'");
    
    if ((leftSMC === "0.000") &amp;&amp; (rightSMC === "0.000"))
    {
        debuglog("both sides borked, means both sides are equal");
        return 0;
        
    } else if ((leftSMC === "0.000") &amp;&amp; !(rightSMC === "0.000"))
    {
        debuglog("left side borked, right side not, so left is less than right");
        return -1;
    } else if (!(leftSMC === "0.000") &amp;&amp; (rightSMC === "0.000"))
    {
        debuglog("left side not, right side borked, so left is greater than right");
        return 1;
    }

    // split SMC strings via regex
    var SMCre = /(\d+)\.(\d+)([a-f]{1})(\d+)/;
    
    // check the leftSMC for validity
    var leftResultObj = SMCre.exec(leftSMC);
    if (leftResultObj[0] != leftSMC)
    {
        // we didn't match the regex
        debuglog("LeftSMC '" + leftSMC + "' does not match regex, error!");
        return -2;
    }
    debuglog("LeftSMC '" + leftSMC + "' is a valid SMC Version.");
    
    // split into components
    var leftMajorVersion  = leftResultObj[1];
    var leftMinorVersion  = leftResultObj[2];
    var leftBuildType     = leftResultObj[3];
    var leftBuildNumber   = leftResultObj[4];

    
    // check the rightSMC for validity
    var rightResultObj = SMCre.exec(rightSMC);
    if (rightResultObj[0] != rightSMC)
    {
        // we didn't match the regex
        debuglog("right SMC version '" + rightSMC + "' does not match regex, error!");
        return -2;
    }
    debuglog("right SMC version '" + rightSMC + "' is a valid SMC Version.");
    
    // split into components
    var rightMajorVersion  = rightResultObj[1];
    var rightMinorVersion  = rightResultObj[2];
    var rightBuildType     = rightResultObj[3];
    var rightBuildNumber   = rightResultObj[4];
    
    // Business rules:
    //      rightMajorVersion must equal leftMajorVersion
    //      rightMinorVersion must equal leftMinorVersion
    //      rightBuildType must be a,b, or f
    //      leftBuildType must be a,b, or f
    //      compare build types, a&lt;b&lt;f and return -1 or 1
    //      if build types equal, compare build numbers, and return -1, 0, 1
    
    //      rightMajorVersion must equal leftMajorVersion
    if (rightMajorVersion != leftMajorVersion)
    {
        debuglog("rightMajorVersion '" + rightMajorVersion + "' does not match leftMajorVersion '" + leftMajorVersion + "', error!");
        return -2;
    }
	debuglog("Major versions match, continue");
    
    //      rightMinorVersion must equal leftMinorVersion
    if (rightMinorVersion != leftMinorVersion)
    {
        debuglog("rightMinorVersion '" + rightMinorVersion + "' does not match leftMinorVersion '" + leftMinorVersion + "', error!");
        return -2;
    }
	debuglog("Minor versions match, continue");

    var allowedBuildTypes = oc(["a","b","f"]);
    if (!(rightBuildType in allowedBuildTypes))
    {
        debuglog("rightBuildType '" + rightBuildType + "'is not allowed, error!");
        return -2;
    }
	if (!(leftBuildType in allowedBuildTypes))
    {
        debuglog("leftBuildType '" + leftBuildType + "'is not allowed, error!");
        return -2;
    }
	debuglog("Build types are allowed, continue");
	
	if (leftBuildType &lt; rightBuildType)
	{
		debuglog("leftBuildType '" + leftBuildType + "' is less than rightBuildType '" + rightBuildType + "', return -1");
		return -1;
	}

	if (leftBuildType &gt; rightBuildType)
	{
		debuglog("leftBuildType '" + leftBuildType + "' is greater than rightBuildType '" + rightBuildType + "', return 1");
		return 1;
	}

	debuglog("Buildtypes are equal, on to the build numbers");
	
	if (parseInt(leftBuildNumber) &lt; parseInt(rightBuildNumber))
    {
        debuglog("leftBuildNumber '" + parseInt(leftBuildNumber) + "' is less than rightBuildNumber '" + parseInt(rightBuildNumber) + "', return -1");
        return -1;
    }
    
    if (parseInt(leftBuildNumber) &gt; parseInt(rightBuildNumber))
    {
        debuglog("leftBuildNumber '" + parseInt(leftBuildNumber) + "' is greater than rightBuildNumber '" + parseInt(rightBuildNumber) + "', return 1");
        return 1;
    }
    
    debuglog("versions exactly equal, return 0");
    return 0;
}

////////////////////////////////////////////////////////////////////////////////
var updateName = "MacminiEFIUpdate 1.8";
function debuglog(message)
{
    // yes, this is secure
    if (system.files.fileExistsAtPath("/tmp/com.apple.pkg.testing")) system.log("********** " + updateName + ": " + message);
}
////////////////////////////////////////////////////////////////////////////////
function oc(a)
{
	var o = {};
	for(var i=0;i &lt; a.length;i++)
	{
		o[a[i]]='';
	}
	return o;
}
////////////////////////////////////////////////////////////////////////////////

</script>
    <installation-check script="InstallationCheck()"/>
    <script>
function InstallationCheck(prefix) {
	my.result.message = system.localizedString('ERROR_0');
	if (!hasGoodOS("/") || !needsFirmwareUpdateJS("/")) {
		my.result.type = 'Fatal';
		return false;
	}
	return true;
}
function hasGoodOS(prefix) {
	if (typeof(my.result) != 'undefined') my.result.message = system.localizedString('ERROR_1');
	if (hasCTO(prefix) || has1085(prefix) || has1095(prefix) || has10104orlater(prefix)) {
		return true;
	}
	return false;
}
function hasCTO(prefix) {
	if (!system.env.COMMAND_LINE_INSTALL) {
		return false;
	}
	return true;
}
function has1085(prefix) {
	var plist = system.files.plistAtPath(prefix + '/System/Library/CoreServices/SystemVersion.plist');
	if (!plist) {
		return false;
	}
	var plistKeyValue = plist['ProductVersion'];
	if (!plistKeyValue) {
		return false;
	}
	if (system.compareVersions(plistKeyValue, '10.8.5') != 0) {
		return false;
	}
	return true;
}
function has1095(prefix) {
	var plist = system.files.plistAtPath(prefix + '/System/Library/CoreServices/SystemVersion.plist');
	if (!plist) {
		return false;
	}
	var plistKeyValue = plist['ProductVersion'];
	if (!plistKeyValue) {
		return false;
	}
	if (system.compareVersions(plistKeyValue, '10.9.5') != 0) {
		return false;
	}
	return true;
}
function has10104orlater(prefix) {
	var plist = system.files.plistAtPath(prefix + '/System/Library/CoreServices/SystemVersion.plist');
	if (!plist) {
		return false;
	}
	var plistKeyValue = plist['ProductVersion'];
	if (!plistKeyValue) {
		return false;
	}
	if (system.compareVersions(plistKeyValue, '10.10.4') &lt; 0) {
		return false;
	}
	return true;
}
function needsFirmwareUpdateJS(prefix) {
	if (typeof(my.result) != 'undefined') my.result.message = system.localizedString('ERROR_2');
	if (!MacminiNeedsFirmwareUpdate()) {
		return false;
	}
	return true;
}
</script>
    <platforms>
        <client arch="i386"/>
        <server arch="i386"/>
    </platforms>
    <choices-outline ui="SoftwareUpdate">
        <line choice="su"/>
    </choices-outline>
    <choices-outline>
        <line choice="su"/>
    </choices-outline>
    <choice id="su" title="SU_TITLE" versStr="SU_VERS" description="SU_DESCRIPTION" description-mime-type="text/html" secondaryDescription="SU_SERVERCOMMENT" suDisabledGroupID="Mac mini EFI Firmware Update" start_selected="true">
        <pkg-ref id="FirmwareUpdate" auth="Root" packageIdentifier="com.apple.pkg.MacminiEFIUpdate1.8" onConclusion="RequireRestart">MacminiEFIUpdate1.8.pkg</pkg-ref>
    </choice>
    <localization>
        <strings language="pl">"SU_TITLE" = "Uaktualnienie oprogramowania sprzętowego EFI Maca mini";
"SU_VERS" = "1.8";
"SU_SERVERCOMMENT" = "Dla komputerów klienckich oraz serwerów";
"SU_DESCRIPTION" = '&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
        &lt;meta http-equiv="Content-Style-Type" content="text/css"&gt;
        &lt;title&gt;&lt;/title&gt;
        &lt;style type="text/css"&gt;
            body {font: 11.0px Lucida Grande;}
            p {margin: 0.0px 0.0px 0.0px 0.0px;}
        &lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
		&lt;p&gt;To uaktualnienie jest zalecane dla Maców mini (z końca 2012 roku). W tym uaktualnieniu odniesiono się do problemu, który mógł uniemożliwiać rozpoznawanie klawiatury USB po obudzeniu systemu z uśpienia.&lt;/p&gt;
    &lt;/body&gt;
&lt;/html&gt;
';
</strings>
    </localization>
    <pkg-ref id="FirmwareUpdate" installKBytes="62" version="1.8.0.0.1.1355452227"/>
</installer-gui-script>