Skip to content

Instantly share code, notes, and snippets.

@timsutton
Created March 7, 2013 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timsutton/5108331 to your computer and use it in GitHub Desktop.
Save timsutton/5108331 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
<options visibleOnlyForPredicate="true" hostArchitectures="i386" customize="never"/>
<title>SU_TITLE</title>
<script>
</script>
<volume-check script="VolumeCheck()"/>
<installation-check script="InstallationCheck()"/>
<script>
function InstallationCheck(prefix) {
var models = ['MacBookPro9,1','MacBookPro9,2',];
var model = system.sysctl('hw.model');
if (models.indexOf(model) == -1) {
my.result.message = system.localizedString('ERROR_2');
my.result.type = 'Fatal';
return false;
}
if (system.compareVersions(system.version.ProductVersion, '10.7') &lt; 0) {
my.result.message = system.localizedStringWithFormat('ERROR_0', '10.7');
my.result.type = 'Fatal';
return false;
}
if (system.compareVersions(system.version.ProductVersion, '10.9') > 0) {
my.result.message = system.localizedStringWithFormat('ERROR_1', '10.9');
my.result.type = 'Fatal';
return false;
}
my.result.message = system.localizedString('ERROR_2');
if (!Script0("/")) {
my.result.type = 'Fatal';
return false;
}
return true;
}
function Script0(prefix) {
if (!system.ioregistry.matchingClass("ATIRadeonX1000").length == 0) {
return false;
}
return true;
}
function VolumeCheck(prefix) {
if (system.env.OS_INSTALL == 1) return true;
var hasOS = system.files.fileExistsAtPath(my.target.mountpoint + "/System/Library/CoreServices/SystemVersion.plist");
if (!hasOS || system.compareVersions(my.target.systemVersion.ProductVersion, '10.7') &lt; 0) {
my.result.message = system.localizedStringWithFormat('ERROR_0', '10.7');
my.result.type = 'Fatal';
return false;
}
if (!hasOS || system.compareVersions(my.target.systemVersion.ProductVersion, '10.9') > 0) {
my.result.message = system.localizedStringWithFormat('ERROR_1', '10.9');
my.result.type = 'Fatal';
return false;
}
return true;
}
function FileCheck1(prefix) {
if (system.files.fileExistsAtPath(prefix + '/Library/Application Support/BootCamp/WindowsSupport.dmg') == 0) {
return true;
}
return false;
}
</script>
<tags>
<tag>BootCamp</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" title="SU_TITLE" versStr="SU_VERS" description="SU_DESCRIPTION" description-mime-type="text/html" secondaryDescription="SU_SERVERCOMMENT" suDisabledGroupID="BootCampESD" start_selected="true" visible="FileCheck1('/') &amp;&amp; Script0('/')">
<pkg-ref id="ESD" auth="Root" packageIdentifier="com.apple.pkg.BootCampESD">BootCampESD.pkg</pkg-ref>
</choice>
<localization>
<strings language="English"><![CDATA["SU_TITLE" = "BootCamp";
"SU_VERS" = "1.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>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<style type="text/css">
body {font: 11.0px Lucida Grande;}
p {margin: 0.0px 0.0px 0.0px 0.0px;}
</style>
</head>
<body>
<p>This is the BootCamp ESD update.</p>
</body>
</html>
';
]]></strings>
</localization>
<pkg-ref id='ESD' installKBytes='672951' version='1.0.1.1293150744'/>
</installer-gui-script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment