macOS Installer Notification 2.0
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
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
<installer-gui-script minSpecVersion="1"> | |
<options hostArchitectures="i386,x86_64,arm64e" type="config-data" customize="never"/> | |
<title>SU_TITLE</title> | |
<script/> | |
<volume-check script="VolumeCheck()"/> | |
<installation-check script="InstallationCheck()"/> | |
<tags> | |
<tag>TYPE:MAJOROSAVAILABLE</tag> | |
<tag>NAMESPACE:com.apple.SoftwareUpdate.OSNotificationBundle.1</tag> | |
</tags> | |
<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" description-mime-type="text/html" secondaryDescription="SU_SERVERCOMMENT" suDisabledGroupID="macOSInstallerNotification_GM" start_selected="true" versStr="SU_VERS" description="SU_DESCRIPTION" title="macOS Installer Notification" visible="Script18(my.target.mountpoint)"> | |
<pkg-ref id="com.apple.pkg.macOSInstallerNotification_GM.16U2269" auth="Root" packageIdentifier="com.apple.pkg.macOSInstallerNotification_GM.16U2269">macOSInstallerNotification_GM.pkg</pkg-ref> | |
</choice> | |
<script> | |
function InstallationCheck(prefix) { | |
var boardIds = ['Mac-E43C1C25D4880AD6','Mac-35C5E08120C7EEAF','Mac-66E35819EE2D0D05','Mac-CAD6701F7CEA0921','Mac-A5C67F76ED83108C','Mac-551B86E5744E2388','Mac-F60DEB81FF30ACF6','Mac-9AE82516C7C6B903','Mac-FFE5EF870D7BA81A','Mac-DB15BD556843C820','Mac-B809C3757DA9BB8D','Mac-65CE76090165799A','Mac-9F18E312C5C2BF0B','Mac-937CB26E2E02BB01','Mac-A369DDC4E67F1C45','Mac-EE2EBD4B90B839A8','Mac-473D31EABEB93F9B','Mac-B4831CEBD52A0C4C','Mac-827FB448E656EC26','Mac-4B682C642B45593E','Mac-77F17D7DA9285301','Mac-BE088AF8C5EB4FA2','Mac-7BA5B2D9E42DDD94','Mac-AA95B1DDAB278B95','Mac-63001698E7A34814','Mac-226CB3C6A851A671','Mac-827FAC58A8FDFA22','Mac-06F11FD93F0323C5','Mac-06F11F11946D27C5','Mac-E1008331FDC96864','Mac-27AD2F918AE68F61','Mac-7BA5B2DFE22DDD8C','Mac-CFF7D910A743CAAF','Mac-AF89B6D9451A490B','Mac-53FDB3D8DB8CA971','Mac-5F9802EFE386AA28','Mac-A61BADE1FDAD7B05','Mac-E7203C0F68AA0004','Mac-0CFF9C7C2B63DF8D','Mac-937A206F2EE63C01','Mac-1E7E29AD0135F9BC','Mac-112818653D3AABFC','VMM-x86_64',]; | |
var cpuFeatures = system.sysctl( 'machdep.cpu.features' ); | |
if (cpuFeatures) { | |
cpuFeatures=cpuFeatures.split(" "); | |
for( var i = 0; i < cpuFeatures.length; i++ ){ | |
if( cpuFeatures[i] == "VMM" ){ | |
return true; | |
} | |
} | |
} | |
var nonSupportedModels = ['MacBookPro10,2','MacBookPro10,1','iMac13,1','iMac13,3','iMac13,2','MacBookAir5,1','MacBookAir5,2','iMac14,1','iMac14,3','iMac14,2','MacBookPro9,2','MacBookPro9,1','Macmini5,2','Macmini5,1','Macmini5,3','MacBookAir6,1','MacBookAir6,2','MacBookPro11,1','MacBookPro11,2','MacBookPro11,3','Macmini6,1','Macmini6,2','iMac14,4','iMac15,1','MacBook8,1','iMac8,1','MacPro4,1','MacPro5,1','MacBookPro7,1','Xserve3,1','MacBookAir3,2','MacBookPro6,1','MacBookPro6,2','MacBookPro5,3','MacBookPro5,4','MacBookPro5,2','MacBookAir4,2','iMac10,1','iMac11,1','MacBookPro5,5','MacBook3,1','MacBook4,1','MacBook5,2','Macmini4,1','iMac9,1','iMac12,1','iMac12,2','iMac11,2','iMac11,3','MacBookAir4,1','MacBook6,1','MacBook7,1','Macmini3,1','MacBookPro8,1','MacBookPro8,2','MacBookPro8,3','MacBookAir3,1','MacBookPro1,1','MacBookPro1,2','iMac4,1','iMac5,1','Macmini1,1','Macmini2,1','MacBook1,1','MacBook2,1','MacPro1,1','MacPro2,1','Xserve1,1','iMac4,2','iMac5,2','iMac6,1','MacBookPro2,1','MacBookPro2,2','Xserve2,1','iMac7,1','MacBookPro3,1','MacBookAir1,1','MacPro3,1','MacBookPro4,1','MacBookAir2,1','MacBook5,1','MacBookPro5,1',]; | |
var currentModel = system.sysctl('hw.model'); | |
if (nonSupportedModels.indexOf(currentModel) >= 0) { | |
my.result.message = system.localizedString('ERROR_3491501876'); | |
my.result.type = 'Fatal'; | |
return false; | |
} | |
var boardId = system.ioregistry.fromPath('IOService:/')['board-id']; | |
if (boardId) { | |
if (boardIds.indexOf(boardId) == -1) { | |
my.result.message = system.localizedString('ERROR_3491501876'); | |
my.result.type = 'Fatal'; | |
return false; | |
} | |
} | |
if (system.compareVersions(system.version.ProductVersion, '10.7.5') < 0) { | |
my.result.message = system.localizedStringWithFormat('ERROR_B85E600482', '10.7.5'); | |
my.result.type = 'Fatal'; | |
return false; | |
} | |
return true; | |
} | |
function VolumeCheck(prefix) { | |
var myTargetSystemVersion = (my.target.systemVersion || system.files.plistAtPath(my.target.mountpoint + "/System/Library/CoreServices/SystemVersion.plist")); | |
my.result.message = system.localizedString('ERROR_ABA5BBB51F'); | |
if (!Bundle0(my.target.mountpoint) || !Or1(my.target.mountpoint)) { | |
my.result.type = 'Fatal'; | |
return false; | |
} | |
return true; | |
} | |
function Bundle0(prefix) { | |
var bundle = system.files.bundleAtPath(prefix + '/Library/Bundles/OSXNotification.bundle'); | |
if (!bundle) { | |
return true; | |
} | |
var bundleKeyValue = bundle['CFBundleShortVersionString']; | |
if (!bundleKeyValue) { | |
return true; | |
} | |
if (system.compareVersions(bundleKeyValue, '3') >= 0) { | |
return false; | |
} | |
return true; | |
} | |
function Or1(prefix) { | |
if (And2(prefix) || Plist6(prefix) || Plist7(prefix) || Plist8(prefix) || Plist9(prefix) || Plist10(prefix) || Plist11(prefix) || Plist12(prefix) || Plist13(prefix) || Plist14(prefix) || Plist15(prefix) || Plist16(prefix) || Plist17(prefix)) { | |
return true; | |
} | |
return false; | |
} | |
function And2(prefix) { | |
if (Plist3(prefix) && Bundle4(prefix) && Bundle5(prefix)) { | |
return true; | |
} | |
return false; | |
} | |
function Plist3(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.11.6') < 0) { | |
return false; | |
} | |
if (system.compareVersions(plistKeyValue, '10.12') >= 0) { | |
return false; | |
} | |
return true; | |
} | |
function Bundle4(prefix) { | |
var bundle = system.files.bundleAtPath(prefix + '/Applications/App Store.app'); | |
if (!bundle) { | |
return false; | |
} | |
var bundleKeyValue = bundle['CFBundleVersion']; | |
if (!bundleKeyValue) { | |
return false; | |
} | |
if (system.compareVersions(bundleKeyValue, '464') < 0) { | |
return false; | |
} | |
return true; | |
} | |
function Bundle5(prefix) { | |
var bundle = system.files.bundleAtPath(prefix + '/System/Library/PrivateFrameworks/CommerceKit.Framework'); | |
if (!bundle) { | |
return false; | |
} | |
var bundleKeyValue = bundle['CFBundleVersion']; | |
if (!bundleKeyValue) { | |
return false; | |
} | |
if (system.compareVersions(bundleKeyValue, '464') < 0) { | |
return false; | |
} | |
return true; | |
} | |
function Plist6(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.13') < 0) { | |
return false; | |
} | |
if (system.compareVersions(plistKeyValue, '10.14') >= 0) { | |
return false; | |
} | |
return true; | |
} | |
function Plist7(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.14') < 0) { | |
return false; | |
} | |
if (system.compareVersions(plistKeyValue, '10.15') >= 0) { | |
return false; | |
} | |
return true; | |
} | |
function Plist8(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.15') < 0) { | |
return false; | |
} | |
if (system.compareVersions(plistKeyValue, '10.16') >= 0) { | |
return false; | |
} | |
return true; | |
} | |
function Plist9(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, '11.0') < 0) { | |
return false; | |
} | |
if (system.compareVersions(plistKeyValue, '11.1') >= 0) { | |
return false; | |
} | |
return true; | |
} | |
function Plist10(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, '11.1') < 0) { | |
return false; | |
} | |
if (system.compareVersions(plistKeyValue, '11.2') >= 0) { | |
return false; | |
} | |
return true; | |
} | |
function Plist11(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, '11.2') < 0) { | |
return false; | |
} | |
if (system.compareVersions(plistKeyValue, '11.3') >= 0) { | |
return false; | |
} | |
return true; | |
} | |
function Plist12(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, '11.3') < 0) { | |
return false; | |
} | |
if (system.compareVersions(plistKeyValue, '11.4') >= 0) { | |
return false; | |
} | |
return true; | |
} | |
function Plist13(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, '11.4') < 0) { | |
return false; | |
} | |
if (system.compareVersions(plistKeyValue, '11.5') >= 0) { | |
return false; | |
} | |
return true; | |
} | |
function Plist14(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, '11.5') < 0) { | |
return false; | |
} | |
if (system.compareVersions(plistKeyValue, '11.6') >= 0) { | |
return false; | |
} | |
return true; | |
} | |
function Plist15(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, '11.6') < 0) { | |
return false; | |
} | |
if (system.compareVersions(plistKeyValue, '11.7') >= 0) { | |
return false; | |
} | |
return true; | |
} | |
function Plist16(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.12.5') < 0) { | |
return false; | |
} | |
if (system.compareVersions(plistKeyValue, '10.12.6') >= 0) { | |
return false; | |
} | |
return true; | |
} | |
function Plist17(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.12.6') < 0) { | |
return false; | |
} | |
if (system.compareVersions(plistKeyValue, '10.12.7') >= 0) { | |
return false; | |
} | |
return true; | |
} | |
function Script18(prefix) { | |
if (!my.target.receiptForIdentifier('com.apple.pkg.macOSInstallerNotification_GM.16U2269')) { | |
return true; | |
} | |
return false; | |
} | |
</script> | |
<localization> | |
<strings language="English">"SU_TITLE" = "macOS Installer Notification"; | |
"SU_VERS" = "2.0"; | |
"SU_SERVERCOMMENT" = "For Desktop and Server systems"; | |
"SU_DESCRIPTION" = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head><title></title></head> | |
<body></body> | |
</html> | |
'; | |
</strings> | |
</localization> | |
<pkg-ref id="com.apple.pkg.macOSInstallerNotification_GM.16U2269" installKBytes="1746" version="3.1.1645601921"/> | |
</installer-gui-script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment