Jump to content

How to patch programs to install on almost any machine!

patch lion snow leopard programs incompatible processor ram

  • Please log in to reply
1 reply to this topic

#1
Deltac0

Deltac0

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 263 posts
  • Gender:Male
  • Location:Finland
  • Interests:Caffeine, OS X, AMD Hackintosh
Posted Image
Installing Command Line Tools for Lion on Snow Leopard


I've encountered many programs which won't just install on my Mac, so I decided to find out how to install them.
One way is to just extract the installer and install the packages straight from there, but then the scripts won't run and this is horrible pain with big installations.

*.mpkg files usually have a file called "Distribution" inside. That file is just simple XML script, which tells the installer where the software can be installed.
By editing the Distribution file, you can easily get OS X 10.8 install on an AMD machine, but of course it won't run because of the kernel. Another example is XCode's Command Line Tools.
I only found CTL for Lion available in the Apple Download Center, so I decided to patch it for SL.

I tried with Flat Package Editor (comes with XCode), but it couldn't save the file, so I did it the manual way:

First I created an copy of the DMG file with Disc Utility, to make it writable.
Then I executed few commands:


bash-3.2# cd /Volumes/Command*
bash-3.2# mkdir patch
bash-3.2# cp Command* patch
bash-3.2# cd patch
bash-3.2# mv Com* CTL.mpkg
bash-3.2# xar -x -f CTL.mpkg

Posted Image

Then I opened Distribution with TextEdit:

Posted Image

Well, well, well... Look what we got there ;)

var majorOSVersion = '10.7';
var lessThanOSVersion = '10.8';

So, I just changed the majorOSVersion to 10.6 and voilà!

Sometimes the script is a little more complicated (like the OS install script), which checks for supported machines, 64/32-bit, etc.
Then you will just need to edit some functions output to true or otherwise just find a way around the checks.

The language used in Distribution file is very easy to understand in my opinion, it can require a little bit of coding knowledge though.

#2
PookyMacMan

PookyMacMan

    InsanelyMac Legend

  • Moderators
  • 1,464 posts
  • Gender:Male
  • Location:Earth–Western Hemisphere, specifically
  • Interests:Computer science, engineering, trumpet performance, and a host of others. :D
I think it might be worth mentioning that the install script itself (not the entire XML distribution file, but the portion in between <script> and </script>) is written in JavaScript, for those interested in the coding language.

Also, great job! It'll be worth remembering, I will have great use for this guide. :)





Also tagged with one or more of these keywords: patch, lion, snow, leopard, programs, incompatible, processor, ram


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy