Installing Snow Leopard on a Mac supplied with Leopard; the bottom line

Discussion in 'macOS' started by glossywhite, Sep 5, 2009.

  1. glossywhite macrumors 65816

    glossywhite

    Joined:
    Feb 28, 2008
    #1
    Okay folks, having waded through pages and pages of speculation, both on MacRumors and elsewhere via Google, I have concluded the following, and it makes sense. I have the Snow Leopard "Up-to-date" upgrade DVD, disc code: "2Z691-6557-A" which I purchased through the Apple store.

    Now, many people have said that this DVD will allow "erase and install", but noone seems to say why this is possible. One guy, CATEGORICALLY told me that the DVD searches for ANY volume on Macintosh HD, or any other connected disk, for a volume containing a Leopard installation, which then qualifies the machine for the "erase and install" method of deployment, and if it doesn't find an existing Leopard installation (on ANY disk or partition) it will fail and disallow the "erase and install".

    I *HAD* to test this theory out, because I believe that the installer scans the *HARDWARE* and compares the precise hardware ID for qualification... and it seems I am correct. I unplugged __ALL__ drives from my *2009* Mac mini, and proceeded to boot from the UTD DVD, partitioned the internal drive COMPLETELY AS ONE BLANK VOLUME, and installed Snow Leopard FRESH, without a single hitch.

    I therefore propose that the file "CheckForOSX" located at: /Volumes/Mac OS X Install DVD/System/Installation/CDIS/ is either checking for Leopard installs, OR it is checking the hardware ID if there is no previous system ( or possibly BOTH).

    Here is the perl code - can anyone work out what this script does?:

    Code:
    #!/usr/bin/perl
    
    ########################################################
    my $TARG                = $ARGV[0];
    my $SYSTEM_VERS         = $TARG . "/System/Library/CoreServices/SystemVersion.plist";
    my $EXIT_VALUE          = 0;
    ########################################################
    
    DO_CHECKS: {
        unless (-e $SYSTEM_VERS) {
                $EXIT_VALUE = 1;
                last;
        }
            
        if (CheckVersion("$SYSTEM_VERS", "8G1165", "ProductBuildVersion", "<")) {
                $EXIT_VALUE = 1;
                last;
        }
    
        unless(SystemPaths($TARG)) {
                $EXIT_VALUE = 1;
                last;
        }
    }
    
    exit($EXIT_VALUE);
    
    ########################################################
    
    sub SystemPaths {
    	my $targ = shift();
    
    	while(<DATA>) {
    		chomp();
    		if($_ eq "") {
    			next;
    		}
    		-e($targ . $_) || return(0);
    	}
    	return(1);
    }
    
    sub CheckVersion {
        my $path            = $_[0];
        my $version         = $_[1];
        my $keyName         = $_[2];
        my $operator        = $_[3];
    
        if (! -e $path) {
            return 0;
        }
    
        if (!$operator) {
            $operator = "==";
        }
    
        my $oldSeperator = $/;
        $/ = \0;
    
        open( PLIST, "$path") || do {
            return 0;
        };
    
        $plistData = <PLIST>;
        $plistData =~ /<dict>(.*?)<\/dict>/gis;
    
        @items = split(/<key>/, $plistData);
    
        shift @items;
        foreach $item (@items) {
            $item =~ /(.*?)<\/key>.*?<string>(.*?)<\/string>/gis;
            $versiondata{ $1 } = $2;
        }
    
        close(PLIST);
    
        $/ = $oldSeperator;
    
        # ProductBuildVersion style keys
        $versiondata{$keyName} =~ /(\d+)([A-Z])(\d+)/ && ($versiondata{$keyName} = "$1.".ord($2).".$3");
        $version =~ /(\d+)([A-Z])(\d+)/ && ($version = "$1.".ord($2).".$3");
    
        @theVersionArray = split(/\./, $versiondata{$keyName});
        for ($i = 0; $i < 3; $i++) {
            if(!$theVersionArray[$i]) {
                $theVersionArray[$i] = '0';
            }
        }
    
        @versionArray = split(/\./, $version);
        
        my $actualVersion;
    
        for ($i = 0; $i < 3; $i++) {
            if (($theVersionArray[$i] != $versionArray[$i]) or ($i == 2)) {
    
                $actualVersion = $theVersionArray[$i];
                $version = $versionArray[$i];
    
                last;
            }
        }
    
        my $expression = '$actualVersion ' . $operator . ' $version';
        if( eval ($expression) )
        {
            return 1;
        }
        else
        {
            return 0;
        }
    
    }
    
    __DATA__
    /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock
    /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder
    /System/Library/CoreServices/Automator Launcher.app/Contents/MacOS/Automator Launcher
    /System/Library/CoreServices/Certificate Assistant.app/Contents/MacOS/Certificate Assistant
    /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder
    /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow
    /System/Library/CoreServices/Network Setup Assistant.app/Contents/MacOS/Network Setup Assistant
    /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAgent
    /System/Library/CoreServices/SecurityAgent.app/Contents/MacOS/SecurityAgent
    /System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer
    /System/Library/PrivateFrameworks/ProKit.framework
    /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine
    /System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/QuartzComposer.framework/Versions/A/Resources/ExtraPatches.plugin/Contents/MacOS/ExtraPatches
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/Resources/SpeechSynthesisServer.app/Contents/MacOS/SpeechSynthesisServer
    I find it impossible to believe speculation, until I have tried something out for myself, ESPECIALLY when the speculation is as vague as it appears right now. It could also be possible that the script "CheckForOSX" is failing, but I doubt that somehow.

    You can check your Macs model ID by typing this into terminal:

    Code:
    sysctl hw.model
    
    (then press [RETURN])
     
  2. glossywhite thread starter macrumors 65816

    glossywhite

    Joined:
    Feb 28, 2008
    #2
    IMPORTANT - CHECK THIS POST I JUST MADE:

    http://forums.macrumors.com/showthread.php?p=8426341#post8426341

    This is the code that I think does the checking:

    Code:
    [COLOR="Red"]function earlyMachineCheck(machineType) {
    		var earlyIntelMachines = [ "iMac4,1", "iMac4,2", "iMac5,1", "iMac5,2", "iMac6,1", "iMac7,1",
    							  "MacBook1,1", "MacBook2,1", "MacBookPro1,1", "MacBookPro1,2",
    							  "MacBookPro2,1", "MacBookPro2,2", "MacBookPro3,1", "Macmini1,1",
    							  "Macmini2,1", "MacPro1,1", "MacPro2,1",
    							];
    	
    		if(machineType){
    			var length = earlyIntelMachines.length;
    			
    			for( var j = 0; j < length; j++ ){
    				if(machineType == earlyIntelMachines[j]){
    					return true;[/COLOR]
    				} 
    
    			}
    			
    		}
    	}
    
    	[COLOR="Red"]function installCheckScript(){
    			
    			try{
    				var machineType = system.ioregistry.fromPath('IODeviceTree:/')['compatible'];
    				
    				if ( typeof(machineType) == "string") {
    						if(!checkSupportedMachine(machineType)){
    							my.result.message = system.localizedStringWithFormat('IC_Machine_message');
    							my.result.type = 'Fatal';
    							return false;
    						}
    			
    						if(!checkSupportedBootRom(machineType)){
    							my.result.message = system.localizedStringWithFormat('IC_Firmware_message');
    							my.result.type = 'Fatal';
    							return false;
    						}
    				}
    				else {
    					for(var i = 0;i < machineType.length; i++){		
    						if(!checkSupportedMachine(machineType[i])){
    							my.result.message = system.localizedStringWithFormat('IC_Machine_message');
    							my.result.type = 'Fatal';
    							return false;
    						}
    			
    						if(!checkSupportedBootRom(machineType[i])){
    							my.result.message = system.localizedStringWithFormat('IC_Firmware_message');
    							my.result.type = 'Fatal';
    							return false;
    						}
    					}
    				}
    				if(!hasAtLeastRam(minRam)){
    					my.result.message = system.localizedStringWithFormat('IC_RAM_message');
    					my.result.type = 'Fatal';
    					return false;
    				}
    				
    				if (system.compareVersions(system.version.ProductVersion, '10.6') >= 0) {
    					if (earlyMachineCheck(machineType)) {
    						var checkResult = system.run('./OSCheck.pl');
    		                if(0 != checkResult){
    		                       my.result.message = system.localizedStringWithFormat('IC_Upgrade_message', '10.5');
    		                       my.result.type = 'Fatal';
    		                       return false;
    		                }
    					}
    				}[/COLOR]
     
  3. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #3
    Sorry but what is your point you're trying to make?

    edit: I like the legion before me successfully installed snowleopard on thier macs that had leopard already installed.
     
  4. glossywhite thread starter macrumors 65816

    glossywhite

    Joined:
    Feb 28, 2008
    #4
    The point I am making is to say that the installer DOES check hardware IDs and more, and it does not ONLY check to see if Leopard is installed. Simple - are you lost? - never mind, I'm not!.
     
  5. iLog.Genius macrumors 601

    iLog.Genius

    Joined:
    Feb 24, 2009
    Location:
    Toronto, Ontario
    #5
    I think what he's asking is what's the point? I mean unless someone is really trying to find ways to workaround now paying the low price of Snow Leopard, there's no real reason other than self-interest to show which disc can install Snow Leopard and how.

    Just to "dumb it down":

    Upgrade (through Up-To-Date): obviously you have Leopard, so it's a no brainer that the UPGRADE disc will require Leopard - who really cares how it checks it, Leopard is required.

    Retail: Works like everything else, install options are open to what you want.

    That's really what people need to know, not what goes behind the scenes. Hey it's cool you want to know how Apple checks for things but for the most part, no one really has an interest - all users want to know is which disc to buy.
     
  6. Infrared macrumors 68000

    Infrared

    Joined:
    Mar 28, 2007
    #6
    Two very nice posts, glossywhite. This is quite important because a lot
    of people are getting the details wrong. Thank you for looking into this.
     
  7. glossywhite thread starter macrumors 65816

    glossywhite

    Joined:
    Feb 28, 2008
    #7



    And yet you STILL don't understand??. No, on Macs sold WITH Leopard, their HARDWARE ID will qualify them to the Upgrade DVD, and for those models that were sold with Tiger AND Leopard, the Leopard install MAY be needed. Machines that were bought with Leopard ONLY are know to Apple, and hence, Leopard IS NOT REQUIRED TO BE INSTALLED AT ALL!. Can I put that any plainer?.


    Your logic is severly flawed - why would the person just be trying to avoid paying the higher price?. Perhaps, like me, they have a Mac with a QUALIFYING HARDWARE ID that tells the installer "Yes this was a machine that we supplied WITH Leopard, so no further checks needed - install away", WITHOUT having to have ANY volume, internal or external with ANY OS installed on it. What you're trying to say (wrongly) is that anyone who wants Snow Leopard on their Mac which was purchased with preload of Leopard, HAS to install Leopard FIRST (somewhere) and THEN upgrade... WRONG!!!!.

    Do you REALLY not understand, still??...
     
  8. Liqwid macrumors newbie

    Joined:
    Aug 28, 2009
    #8
    Thanks glossywhite for taking the time to look into this. Its good to know that I don't have to mess around with Leopard when I want to do a clean install of SL with my UTD disc.
     
  9. glossywhite thread starter macrumors 65816

    glossywhite

    Joined:
    Feb 28, 2008
    #9
    Your appreciation is appreciated also!. You are more than welcome. I cannot stand vague comments and FUD, so I decide to find out for myself, and make facts known!.
     
  10. calderone macrumors 68040

    calderone

    Joined:
    Aug 28, 2009
    Location:
    Seattle
    #10
    This is what I expected. I didn't have a UTD disc to check though.

    Removing that section of code, or removing your machine or all the machines from the list in the Distribution file, and then reburning would allow you to install on an older machine without anything, just like the "full" $29 disc. This is documented elsewhere here on Leopard, and will be the same for Snow Leopard.
     
  11. jjk454ss macrumors 601

    jjk454ss

    Joined:
    Jul 10, 2008
    #11
    I installed Snow Leopard on a brand new SSD, never had Leopard installed, and didn't need to install it first. This was with the $29 upgrade disc in a late 2008 unibody macbook.
     
  12. glossywhite thread starter macrumors 65816

    glossywhite

    Joined:
    Feb 28, 2008
    #12
    Indeed so :) - others seem to find this hard to grasp!
     
  13. justaregularjoe macrumors 6502

    Joined:
    Nov 28, 2008
    #13
    :eek:~~~~!!!!NO!!!!~~~~:eek:
    YOU CANNOT REMOVE THAT SECTION OF CODE!
    Yes, you can remove the Machine Strings but Never, EVER, remove a section of code from something as complicated as this without explicit knowledge and intimate understanding of every other line of code in the program EVER.

    Gratsy, Glossy. You found it. Well done.

    BTW, here is a link to all Macs ever, by Model ID.
     
  14. calderone macrumors 68040

    calderone

    Joined:
    Aug 28, 2009
    Location:
    Seattle
    #14
    Wrong. This has been done in the past by myself with the Leopard installer and by others.

    All you are doing is removing a "function." I removed the speed function, like you see here in SL, from the Leopard installer. Worked fine.

    You say, "you cannot remove that section," then proceed to say it shouldn't be done without an "intimate" understanding. First of all saying "you cannot do it," suggests you have an intimate understanding and that you know what will happen it is removed, in which case you should share that. Second, you assume that I do not have an intimate understanding.

    I am not trying to start an argument, but claiming knowledge while not claiming knowledge is rather frustrating. Just because you don't know, does not me I or others also don't know.
     
  15. Scottsdale macrumors 601

    Scottsdale

    Joined:
    Sep 19, 2008
    Location:
    U.S.A.
    #15
    I have to agree with you. I think the up to date disk will work on a Mac based on the hardware id and not whether Leopard is presently installed on the system. I think the concept makes a world of sense.

    I read where one up to date disk holder tried it on a different Mac than it came for with a new drive and it didn't work. He concluded the system needed Leopard, but I had no such conclusion. It would be simple enough for the up to date DVD to check to ensure the hardware id or serial number meets requirement for install.

    This other guy went on to install SL with the retail disk and concluded he was right. I think he should have tried installing Leopard on new drive for an older Mac that wasn't the up to date computer. Then tried SL upgrade disk to tell whether was searching for Leopard or certain hardware the upgrade disk would be for. I am not stating each disk is specific to a single Mac but just that the hardware must be right or serial number match.

    Of course anyone could try upgrading their older Mac with Leopard and the update disk from a newer Mac to see if it installs.

    I suppose this is all just me wondering how too. Oh well.
     
  16. glossywhite thread starter macrumors 65816

    glossywhite

    Joined:
    Feb 28, 2008
    #16
    Please clarify this statement - I find the wording very confusing, thanks.




    You will notice that the "Santa Rosa" MacBook is NOT included in the checking mechanism (MacBook3,1) as it was shipped with Leopard pre-installed. The same applies for the Mac Pro, etc. Check the machines ID, and then check the script - you will see! ;). All the information correlates correctly, IF you look at the list http://www.everymac.com/systems/by_capability/macs-by-machine-model-machine-id.html and think back to when that model first released, and with which OS it *first* sold.

    For example, the VERY FIRST Aluminium iMac was shipped with Tiger, initially. The ID for this machine and the others released with it, is "iMac7,1" which, as we can see, is the last iMac version to be included in the script as having an ID which does NOT qualify it automatically without a Leopard installation, because it was transitional, but SOME of that exact model ID were supplied during the transitional period Tiger-Leopard, either with a "Drop-in disc" or, later on, with Leopard pre-installed, either of which scenario would then qualify the iMac7,1 for Snow Leopard upgrade, by checking for the Leopard install (the hardware ID iMac7,1 would fail, as we can see, because it is in the list of early Intel Macs, within the script).

    I am now going to do the following:

    1/ Backup my internal drive to Disk image (in case I forget later :eek:)

    2/ Restore my Up-to-date DVD to external partition (DVD no: 2Z691-6557-1)

    3/ Modify the Snow Leopard installer script, to include Macmini3,1 (2009 model) as an early Intel Mac, which SHOULD be rejected from auto-qualification, IF the Leopard volume is erased (which I will do in step 4/)

    Code:
    function earlyMachineCheck(machineType) {
    		var earlyIntelMachines = [ "iMac4,1", "iMac4,2", "iMac5,1", "iMac5,2", "iMac6,1", "iMac7,1",
    							  "MacBook1,1", "MacBook2,1", "MacBookPro1,1", "MacBookPro1,2",
    							  "MacBookPro2,1", "MacBookPro2,2", "MacBookPro3,1", "Macmini1,1",
    							  "Macmini2,1", "MacPro1,1", "MacPro2,1",[COLOR="Red"]"Macmini3,1"[/COLOR]
    							];
    4/ ERASE the internal drive, and attempt to ERASE AND INSTALL, with the modified installer script listing my Mac mini as unqualified by ID.


    I shall post my results, later on today.

    [EDIT] Seems like I have a strange result - people have speculated that the installer looks for *Leopard* or later - from what I have just seen, I think that the Snow Leopard *UPGRADE* DVD ___ONLY___ looks for *Leopard*, and Snow Leopard doesn't SEEM to validate, because I did this:

    1/ Modified the installer script as outlined in step 3/ of the GREEN list above...

    2/ Booted from the partition to which I restored my UTD DVD (and had added Macmini3,1 to the installer script as an OLDER Intel Mac)...

    3/ Went to try and erase the internal drive, but I couldn't even get that far (remember, this is a MODIFIED installer script - I'd normally have NO issues!) and it told me I needed 10.5 or higher to install :p

    NOW I don't understand why the script has seen my Macmini3,1 as OLD Intel, but failing this, it still SHOULD let me install regardless, seeing as I have an existing Snow Leopard partition... :confused:


    I'm suspicious of this part of the UTD installer script, which MAY be stopping the install from a HDD, but it is more probable that this is just checking to see if the Mac has a DVD drive, because the Leopard DVD uses this part of the code, also, and I can install from a DVD restore to partition in Leopard :).

    Code:
    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;
    	}

    Makes TOTAL sense, and I hope someone is going to give me the credit for finding this out?!.
     
  17. pratap21 macrumors member

    Joined:
    Oct 27, 2008
  18. glossywhite thread starter macrumors 65816

    glossywhite

    Joined:
    Feb 28, 2008
    #18
    That's GLOSSYwhite to you! :p:D

    Next Step (aah the PUN!):

    1/ Erase disk with LEOPARD installer, and try to run the modded SNOW LEOPARD installer again...

    2/ If SNOW LEOPARD fails to install on a BLANK drive with blacklisted Macmini3,1...

    3/ Install bare Leopard installation, and attempt to upgrade it, remembering that Macmini3,1 is STILL BLACKLISTED WITHIN THE MODDED SL UTD INSTALL SCRIPT!.



    Hope this isn't gonna take all day :D

    [EDIT] I decided the above (blue) is futile & inaccurate, as I have modified the installer script. Summary; Snow Leopard Up-to-date DVD *DOES* check your hardware ID, and if it matches the hardware ID of a machine sold with Leopard pre-installed, the Snow Leopard install will go ahead, REGARDLESS of whether or not it is an upgrade OR an erase and install. Fact.
     
  19. Infrared macrumors 68000

    Infrared

    Joined:
    Mar 28, 2007
    #19
    Is there any actual difference between the "Up To Date" disc and retail
    upgrade disc, apart from price, packaging, licensing and possibly printing?

    I mean, has anyone actually checked to see if the two are bitwise identical?
     
  20. glossywhite thread starter macrumors 65816

    glossywhite

    Joined:
    Feb 28, 2008
    #20
    How could they be identical?. The upgrade DVD checks for qualifying models, and the retail doesn't - the retail DVD doesn't have that script in it.
     
  21. Infrared macrumors 68000

    Infrared

    Joined:
    Mar 28, 2007
    #21
    I'm not sure what you mean by that. Some upgrade DVDs are retail DVDs.
     
  22. glossywhite thread starter macrumors 65816

    glossywhite

    Joined:
    Feb 28, 2008
    #22
    How are they?. They have different DVD numbers.
     
  23. Infrared macrumors 68000

    Infrared

    Joined:
    Mar 28, 2007
    #23
    The $29 Snow Leopard DVD is a retail DVD. It is also an upgrade DVD.
     
  24. calderone macrumors 68040

    calderone

    Joined:
    Aug 28, 2009
    Location:
    Seattle
    #24
    Your posts are very erratic. Would you mind slowing down and cut the big red and green text. Anyhow.


    Code:
    if (system.compareVersions(system.version.ProductVersion, '10.6') >= 0) {
    					if (earlyMachineCheck(machineType)) {
    						var checkResult = system.run('./OSCheck.pl');
    		                if(0 != checkResult){
    		                       my.result.message = system.localizedStringWithFormat('IC_Upgrade_message', '10.5');
    		                       my.result.type = 'Fatal';
    		                       return false;
    You are still getting caught here. My guess is the perl script is what is getting you. You are removing that machine from the list, but it is double checking with that script. The earlyMachineCheck is returning something other than a 0 and it is flagging you with the IC_Upgrade_Message is in Localizable.strings in the OSInstall.mpkg.

    You need to edit this section. checkResult is the output of the OSCheck.pl, change "system.run('./OSCheck.pl');" to simply 0; Let me know what happens.

    Also, you asked for credit, but what you have done is not original. There is a long standing thread here with all the information you have used to do this. Someone would have done it, hell, I would have if I had a UTD disc.
     
  25. glossywhite thread starter macrumors 65816

    glossywhite

    Joined:
    Feb 28, 2008
    #25
    The upgrade DVD has slightly different scripts, but can me modified to work as a retail DVD... but I doubt the MD5 sums would ever match. Well of COURSE Snow Leopard RETAIL is also an upgrade DVD - imagine how annoyed you would be, if you could ONLY erase and install with it! :D







    Thanks but no - I'll use whatever text formatting I wish :)

    Hindsight is a wonderful thing; "someone WOULD have done it" - very true, but did they?... NO!. I would have been the first man on the moon, if I was a different person, born in a different era. What is stopping you saying "well done, you did it" like someone else has?. There's gratitude for you; dance round it all you want, and be as pedantic as possible, but the bottom line here is you DIDN'T discover this, hey!.
     

Share This Page