Jump to content
Welcome to InsanelyMac Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.


How to patch programs to install on almost any machine!

2 posts in this topic

Recommended Posts


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




Then I opened Distribution with TextEdit:




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.

Share this post

Link to post
Share on other sites

I think it might be worth mentioning that the install script itself (not the entire XML distribution file, but the portion in between ) 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. :)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Twml
      I have an HP Elitebook 8460P running High Sierra 10.13.1


      I'm trying to get battery status working and if I'm understanding it right I need to patch my DSDT.aml to get it working.

      I have attempted this and can't seem to get it to compile, always an error. 


      Also i have managed to brick the system a few times attempting edits. I cant seem to figure it out


      I need to patch the DSDT to get battery status working even before patching, if attempting a compile with MaciASL I have 2 errors.


      Im fairly new to getting Mac running on Intel Based PCs. 

      any help would be greatly appreciated.


      Attached is my DSDT.aml file pulled from: EFI/Clover/ACPI/origin/DSDT.aml 

      generated by using clover bootloader help menu, via the F4 option. 


      I used MaciASL to attempt the edits.

      using battery patches from here: https://github.com/RehabMan/Laptop-DSDT-Patch


      Is it possible for someone to patch the file for me, or is it something i have to do?

      As i said im fairly new to mac and would like to get this working


    • By deejaystage
      Hola chicos!
      Mi sistema sólo muestra 7 mb de vram y no tengo aceleración en mi gráfica. He probado infinidad de remedios pero no he encontrado la solución.
      ¿Alguien podría ayudarme?
      Gracias por adelantado
    • By dark_hacker
      I did in my dsdt application of the RehabMan patch for brightness correction in AppleBacklight.kext but what happens and the brightness works but my internal screen of the laptop stays with the image with a transparent white background barely can see the image, but I do the shine and it works and it's just a problem in the image, I do not know why this happens, thanks.
    • By grisno
      Hi people,
      This is a preliminary installer to activate the sound card REALTEK ALC282-v2 (10ec:0282) with LayoutID 1 or 3 in MacOS. This installer does not contain AppleHDA patched Kext. To work properly, it must be installed over vanilla AppleHDA.kext.
      I want to thank the whole community for their efforts and content provided, because without these it would not be possible to create this installer.
      I would appreciate comments and suggestions!!
      Speakers : OKHeadphones : OKHDMI Audio : OK (Intel HD4K Tested)LineIn : N/A (Model Without LineIn)MicInt : OKMicIntNoiseReduction : OKMicExt : N/A (Model Without MicExt)AutoDetectLineIn : N/A (Model Without LineIn)Sleep : OKWakeUp : OKAutoSleep : OKHibernate : OKSiri : OK
      Tested Laptops:
      - HP Pavillion 15-D002SS
      Coming Soon:
      - Unified installer for the different supported operating systems.
      - Support model with LineIn jack.
      Modified Verbs:
      01271C20 01271D00 01271EA0 01271F9001471C10 01471D00 01471E17 01471F9001871CF0 01871D00 01871E00 01871F40 01E71CF0 01E71D00 01E71E00 01E71F4002171C30 02171D10 02171E21 02171F0001470C02
      Patch to apply with MaciASL in your DSDT
      ######################################### HDEF v1.00######################################## into method label _DSM parent_label HDEF remove_entry;into device label HDEF insertbeginMethod (_DSM, 4, NotSerialized)\n{\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "layout-id", Buffer() { 0x01, 0x00, 0x00, 0x00 },\n //"layout-id", Buffer() { 0x03, 0x00, 0x00, 0x00 },\n "hda-gfx", Buffer() { "onboard-1" },\n "PinConfigurations", Buffer() { },\n })\n}\nend;