Xserve 1,1 - Distribution
Added by astuffedtiger on June 18, 2018 10:55
<?xml version="1.0" standalone="yes"?>
<installer-gui-script minSpecVersion="1">
    <options eraseOptionAvailable="true" hostArchitectures="i386" allow-external-scripts="yes"/>
    <title>MacOSX_Title</title>
    <license file="License.rtf"/>
    <conclusion file="Conclusion.rtfd"/>
    <script>
        var minRam = 2048;

function checkSupportedMachine(machineType) {
	return true;
}

function checkSupportedBootRom(machineType) {
	return true;
}

function hasAtLeastRam(RAM) {
	var requiredRAM = (RAM * 1024 * 1024);
	var actualRAM = system.sysctl('hw.memsize');
	return (actualRAM &gt; (requiredRAM - 1));
}

function is64bit() {
    var is64bit =system.sysctl('hw.cpu64bit_capable');
	return is64bit;
}

function isVirtualMachine(){

	var cpuFeatures = system.sysctl( 'machdep.cpu.features' );
			cpuFeatures=cpuFeatures.split(" ");
			for( var i = 0; i &lt; cpuFeatures.length; i++ ){
			 	if( cpuFeatures[i] == "VMM" ){
						return true;
			  	}
			}
			return false;

}

function isSupportedPlatform(){

	if( isVirtualMachine() ){
		return true;
	}

	var platformSupportValues=["Mac-031B6874CF7F642A","Mac-F2268DC8","Mac-F22587C8","Mac-50619A408DB004DA","Mac-F2218EA9","Mac-742912EFDBEE19B3","Mac-F22C8AC8","Mac-AFD8A9D944EA4843","Mac-F227BEC8","Mac-F226BEC8","Mac-F305150B0C7DEEEF","Mac-35C1E88140C3E6CF","Mac-77EB7D7DAF985301","Mac-2E6FAB96566FE58C","Mac-7BA5B2794B2CDB12","Mac-BE0E8AC46FE800CC","Mac-00BE6ED71E35EB86","Mac-F42D86A9","Mac-4B7AC7E43945597E","Mac-F22C89C8","Mac-F22587A1","Mac-937CB26E2E02BB01","Mac-942459F5819B171B","Mac-F42388C8","Mac-F223BEC8","Mac-F4238CC8","Mac-F222BEC8","Mac-4BC72D62AD45599E","Mac-F2208EC8","Mac-66F35F19FE2A0D05","Mac-F4238BC8","Mac-189A3D4F975D5FFC","Mac-C08A6BB70A942AC2","Mac-8ED6AF5B48C039E1","Mac-FA842E06C61E91C5","Mac-FC02E91DDD3FA6A4","Mac-06F11FD93F0323C5","Mac-F42C86C8","Mac-06F11F11946D27C5","Mac-6F01561E16C75D06","Mac-F60DEB81FF30ACF6","Mac-81E3E92DD6088272","Mac-F2268EC8","Mac-F22589C8","Mac-3CBD00234E554E41","Mac-F22788AA","Mac-F22586C8","Mac-F221BEC8","Mac-942C5DF58193131B","Mac-F2238BAE","Mac-9F18E312C5C2BF0B","Mac-F2268CC8","Mac-C3EC7CD22292981F","Mac-F221DCC8","Mac-F2218FC8","Mac-94245A3940C91C80","Mac-27ADBB7B4CEE8E61","Mac-F65AE981FFA204ED","Mac-F42D89C8","Mac-942B59F58194171B","Mac-F42D89A9","Mac-F2268AC8","Mac-F22C86C8","Mac-F2238AC8","Mac-942452F5819B1C1B","Mac-F2218FA9","Mac-F42D88C8","Mac-94245B3640C91C81","Mac-F42D86C8","Mac-42FD25EABCABB274","Mac-7DF2A3B5E5D671ED","Mac-F2268DAE","Mac-2BD1B31983FE1663","Mac-7DF21CB3ED6977E5","Mac-031AEE4D24BFF0B1","Mac-F42C88C8","Mac-35C5E08120C7EEAF","Mac-F42386C8","Mac-E43C1C25D4880AD6","Mac-F42C89C8","Mac-942B5BF58194151B","Mac-F2218EC8","Mac-F4208AC8"];
	var boardID = system.ioregistry.fromPath('IOService:/')['board-id'];

	if( !boardID || platformSupportValues.length == 0 ) {
		return false
	}
	for( var i = 0; i &lt; platformSupportValues.length; i++ ){
	 	if( boardID == platformSupportValues[i] ){
				return true;
	  	}
	}

	return false;
}



	function installCheckScript(){

			try{
				var machineType = system.ioregistry.fromPath('IODeviceTree:/')['compatible'];

				if (typeof(isFNI) == "undefined" &amp;&amp; typeof(hwbeInstallCheck) != "undefined") {
					if (!hwbeInstallCheck()) {
						return false;
					}
				}

				if(!is64bit()){
					my.result.message = system.localizedStringWithFormat('IC_Unsupported_Processor');
					my.result.type = 'Fatal';
					return false;
				}

				if(!isSupportedPlatform()){
                    if (system.compareVersions(system.version.ProductVersion, '10.10') &gt;= 0 &amp;&amp; system.compareVersions(system.version.ProductVersion, '10.11') &lt; 0) {
                        my.result.message = system.localizedStringWithFormat('IC_cpusw_flavor');
                    } else {
                        my.result.message = system.localizedStringWithFormat('IC_Unsupported_Platform');
                    }
					my.result.type = 'Fatal';
					return false;
				}

				if(!hasAtLeastRam(minRam)){
					my.result.message = system.localizedStringWithFormat('IC_RAM_message');
					my.result.type = 'Fatal';
					return false;
				}

				if (typeof(redownloadCheck) != "undefined" &amp;&amp; !redownloadCheck()) return false;
				if (typeof(findBJPrinters) != "undefined" &amp;&amp; !findBJPrinters) return false;

			} catch (e) {
				system.log('installCheckScript threw exception ' + e);
			}

			return true;
	}


function volCheckScript(){
		var target = my.target;
		var destSystemVersion = target['systemVersion'];

		if(system.files.fileExistsAtPath(my.target.mountpoint + "/Backups.backupdb")) {
			my.result.message = system.localizedString('VC_Backup_message');
			my.result.type = 'Fatal';
			return false;
		}

		if(my.target.systemVersion){
			if( system.compareVersions(my.target.systemVersion.ProductVersion, '10.11') &gt;= 0){
				my.result.message = system.localizedString('VC_Newer_message');
				my.result.type = 'Fatal';
				return false;
			}
		}

		if (destSystemVersion) {

			// Don't allow upgrades on volumes less than 10.6.6
			if (-1 == system.numericalCompare(destSystemVersion['ProductVersion'], '10.6.6')) {
					my.result.message = system.localizedString('VC_Upgrade_message');
					my.result.type = 'Fatal';

					return false;
			}
		}

        try {
            if (false) {
                                my.result.message = system.localizedString('VC_Managed_Policy');
                                    my.result.type = 'Fatal';
                return false;
            }
        } catch(e) {}

		return true;
}


	function language_running(langKey){
		var appleLanguages = system.defaults['AppleLanguages'];


		if(!appleLanguages || (appleLanguages.length == 0))
				return ((langKey == 'English') || (langKey == 'en'))

		return (langKey == appleLanguages[0]);
	}

	gLanguageRequired = {
	};

	//Function returns true if the langKey is required, it uses a cache so that the logic doesn't
	//have to be run hundreds of times
	function language_required(langKey){

		if(! (gLanguageRequired[langKey])){
			var required = false;

			if(language_running(langKey)){
				required =  true;
			}

			gLanguageRequired[langKey] = required;
		}

		return gLanguageRequired[langKey];
	}

	function language_enabled(langKey){
		var enabled = !(language_required(langKey));

		if(false == enabled){
			my.choice.tooltip = system.localizedString('TT_Language_Required_message');
		}

		return enabled;
	}

	function language_selected(langKey){
		var selected = my.choice.selected || language_required(langKey);

		return selected;
	}


	function verCompare(checkVer){
		var sysVer = my.target['systemVersion'];
		if (sysVer) {
			return system.numericalCompare(sysVer['ProductVersion'],checkVer);
		}
		return -1;
	}

	function upgrade_allowed(){
		var argv = upgrade_allowed.arguments;
		var upgradable = true;
		var upgradeAction = my.choice.packageUpgradeAction;

		if(argv.length &gt; 0) {
			upgradeAction = eval('choices.' + argv[0] + '.packageUpgradeAction');
		}

		if((upgradeAction == 'downgrade') || (upgradeAction == 'mixed')){
			my.choice.tooltip = system.localizedString('TT_Newer_Package_Installed_message');
			upgradable = false;
		}

		return upgradable;
	}

	function systemHasDVD(){
		var obj = system.ioregistry.matchingClass("IODVDBlockStorageDriver");
		if (obj) {
			return true;
		}
		var obj2 = system.ioregistry.matchingName("ApplePlatformEnabler","IOService");
		if (obj2 ) {
			if ( obj2[0]['DVDSupported'] ) {
				return true;
			}
		}
		return false;
	}

	function hasNetInfo() {
		var path = my.target.mountpoint + "/private/var/db/netinfo/local.nidb";
	    if (system.files.fileExistsAtPath(path)) {
			return true;
		}

		return false;
	}

	function needsX11redirect() {
			var sysVer = my.target['systemVersion'];
			if (!sysVer) {
				return true;
			}
			var path = my.target.mountpoint + "/private/var/db/receipts/com.apple.pkg.X11redirect.plist";
		    if (system.files.fileExistsAtPath(path) || system.compareVersions(my.target.systemVersion.ProductVersion, '10.8') &lt; 0) {
				return true;
			}

			return false;
		}



	</script>
    <installation-check script="installCheckScript()"/>
    <volume-check script="volCheckScript()"/>
    <choices-outline>
        <line choice="EssentialSystemSoftware">
            <line choice="EssentialSystemSoftwareGroup"/>
            <line choice="AdditionalEssentials"/>
            <line choice="AdditionalSpeechVoices"/>
            <line choice="AsianLanguagesSupport"/>
            <line choice="MediaFiles"/>
            <line choice="JavaEssentials"/>
            <line choice="OxfordDictionaries"/>
            <line choice="X11"/>
        </line>
        <line choice="OSInstallScripts"/>
    </choices-outline>
    <choice id="EssentialSystemSoftware" title="EssentialSystemSoftware_title" description="EssentialSystemSoftware_description" start_enabled="false" start_visible="false"/>
    <choice id="EssentialSystemSoftwareGroup" start_visible="false" start_selected="true">
        <pkg-ref id="com.apple.pkg.BaseSystemBinaries"/>
        <pkg-ref id="com.apple.pkg.BaseSystemResources"/>
        <system-image id="com.apple.dmg.MacOSX"/>
        <pkg-ref id="com.apple.mpkg.OSInstall"/>
        <pkg-ref id="com.apple.pkg.Essentials"/>
        <pkg-ref id="com.apple.pkg.BSD"/>
        <pkg-ref id="com.apple.pkg.JavaTools"/>
    </choice>
    <choice id="AdditionalEssentials" start_visible="false" start_selected="true">
        <pkg-ref id="com.apple.pkg.AdditionalEssentials"/>
        <pkg-ref id="com.apple.pkg.OSUpgrade" active="!my.target.ignoreContents &amp;&amp; hasNetInfo() &amp;&amp; verCompare(10.3) &gt;= 0"/>
    </choice>
    <choice id="AsianLanguagesSupport" start_visible="false" start_selected="true">
        <pkg-ref id="com.apple.pkg.AsianLanguagesSupport"/>
    </choice>
    <choice id="JavaEssentials" start_visible="false" start_selected="true">
        <pkg-ref id="com.apple.pkg.JavaEssentials"/>
    </choice>
    <choice id="MediaFiles" start_visible="false" start_selected="true">
        <pkg-ref id="com.apple.pkg.MediaFiles"/>
    </choice>
    <choice id="OxfordDictionaries" start_visible="false" start_selected="true">
        <pkg-ref id="com.apple.pkg.OxfordDictionaries"/>
    </choice>
    <choice id="OSInstallScripts" start_visible="false" start_selected="true">
        <pkg-ref id="com.apple.pkg.OSInstall"/>
    </choice>
    <choice id="AdditionalSpeechVoices" start_visible="false" start_selected="true">
        <pkg-ref id="com.apple.pkg.AdditionalSpeechVoices"/>
    </choice>
    <choice id="X11" start_selected="true" start_visible="false">
        <pkg-ref id="com.apple.pkg.X11redirect" active="needsX11redirect()"/>
    </choice>
    <pkg-ref id="com.apple.pkg.AdditionalSpeechVoices" auth="root" installKBytes="286664" version="10.10.0.1.1.1425657145">AdditionalSpeechVoices.pkg</pkg-ref>
    <pkg-ref id="com.apple.pkg.AsianLanguagesSupport" auth="root" installKBytes="9761" version="10.10.0.1.1.1425657145">AsianLanguagesSupport.pkg</pkg-ref>
    <pkg-ref id="com.apple.pkg.BaseSystemBinaries" auth="root" installKBytes="627898" version="10.10.0.1.1.1425657145">BaseSystemBinaries.pkg</pkg-ref>
    <pkg-ref id="com.apple.pkg.BaseSystemResources" auth="root" installKBytes="373236" version="10.10.0.1.1.1425657145">BaseSystemResources.pkg</pkg-ref>
    <pkg-ref id="com.apple.pkg.BSD" auth="root" installKBytes="781675" version="10.10.0.1.1.1425657145">BSD.pkg</pkg-ref>
    <pkg-ref id="com.apple.pkg.Essentials" auth="root" installKBytes="5780612" version="10.10.0.1.1.1425657145">Essentials.pkg</pkg-ref>
    <pkg-ref id="com.apple.pkg.AdditionalEssentials" auth="root" installKBytes="152038" version="10.10.0.1.1.1425657145">AdditionalEssentials.pkg</pkg-ref>
    <pkg-ref id="com.apple.pkg.OSUpgrade" auth="root" installKBytes="0" version="10.10.0.1">OSUpgrade.pkg</pkg-ref>
    <pkg-ref id="com.apple.pkg.JavaEssentials" auth="root" installKBytes="6618" version="10.10.0.1.1.1425657145">JavaEssentials.pkg</pkg-ref>
    <pkg-ref id="com.apple.pkg.MediaFiles" auth="root" installKBytes="261657" version="10.10.0.1.1.1425657145">MediaFiles.pkg</pkg-ref>
    <pkg-ref id="com.apple.pkg.OSInstall" auth="root" installKBytes="0" version="10.10.0.1">OSInstall.pkg</pkg-ref>
    <pkg-ref id="com.apple.pkg.OxfordDictionaries" auth="root" installKBytes="99394" version="10.10.0.1.1.1425657145">OxfordDictionaries.pkg</pkg-ref>
    <pkg-ref id="com.apple.pkg.X11redirect" auth="root" installKBytes="3402" version="10.10.0.1.1.1425657145">X11redirect.pkg</pkg-ref>
    <pkg-ref id="com.apple.pkg.JavaTools" auth="root" installKBytes="92" version="10.10.0.1.1.1425657145">JavaTools.pkg</pkg-ref>
    <pkg-ref id="com.apple.mpkg.OSInstall" auth="root" version="10.10.0">OSInstall.mpkg</pkg-ref>
    <system-image id="com.apple.dmg.MacOSX">BaseSystem.dmg</system-image>
    <system-image id="com.apple.dmg.MacOSX" version="10.10.0.1.1.1425657145" sha1="34df9ba6a0ae45fbdf4df6bcb4dda28742c581e3"/>
</installer-gui-script>

Comments