Created
June 3, 2014 16:19
-
-
Save c4pt0r/da39cd0c4cad65fa87b4 to your computer and use it in GitHub Desktop.
jdk mac os pkg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check is current MAC OS X version less than supportedVersion | |
function checkForMacOSX(supportedVersion) { | |
try { | |
// Get current ProductVersion | |
var tProductVersion = system.version.ProductVersion; | |
// Get current ProductName | |
var tProductName = system.version.ProductName; | |
// Check if current version is less than supportedVersion, if yes Set the result type to Fatal, and give correct message to user | |
if(tProductVersion < supportedVersion) | |
{ | |
// Set result values | |
var osCheckTitle = system.localizedStringWithFormat('OSCHECK_TITLE'); | |
osCheckTitle = osCheckTitle.replace("%1$@", tProductName); | |
osCheckTitle = osCheckTitle.replace("%2$@", supportedVersion); | |
var osCheckMessage = system.localizedStringWithFormat('OSCHECK_MESSAGE'); | |
osCheckMessage = osCheckMessage.replace("%1$@", tProductName); | |
osCheckMessage = osCheckMessage.replace("%2$@", tProductVersion); | |
osCheckMessage = osCheckMessage.replace("%3$@", supportedVersion); | |
my.result.title = osCheckTitle; | |
my.result.message = osCheckMessage; | |
my.result.type = 'Fatal'; | |
} | |
} catch (e) { | |
// an exception just occurred | |
return (false); | |
} | |
// return true | |
return (true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment