Jump to content
Deltac0

How to patch programs to install on almost any machine!

2 posts in this topic

Recommended Posts

tzmqz.png

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

 

KyJoN.png

 

Then I opened Distribution with TextEdit:

 

Mg1eh.png

 

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
Advertisement

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 hacking2apple
      It's been known that there is indeed support for VGA in Coffe Lake and that support for prior iGPUs was deprecated as the VGA port was removed since Sierra. However, using port patches in Devices Properties (Open Core), I made the VGA port to work again with graphics acceleration.
      But there's a catch, the port is glitchy. Once macOS displays the accounts, you can see the Enter Password box with the blur effect. But after some seconds, the whole display will turn to another color (depends on the background). I'm not sure why that happens.
      I would suggest learning what are Ports, Connectors, Indexes, Types, and BusIDs before continuing, otherwise, you would get lost.
      These are the patches that are supposed to enable the VGA port according to the Whatevergreen Intel guide:
      06020000 02000000 30000000 // Option 1 06020000 01000000 30000000 // Option 2 None of those ports seem to work. The first problem is that the Index is 6, which does not make any sense as the Azul framebuffer only supports up to 3 Indexes (software ports). So we first have to change the Index for the VGA port on your motherboard, which is 2 (physical port is 0x06)) for me.
      So that means that the target port is the Index 2, which is 02040A00 00040000 87000000.
      bus-id 4 is for DP so we would change that to 2, which is VGA. That is according to what Hackintool says. I also proved other bus-ids but none of the other ones seem to work.
      I have no idea what pipe does so I just type zeros.
      I think pipe is basically another way group ports. So later I changed that to 10, which is 0A in hex. That means pipe remains the same as it was originally.  02020A00 01000000 87000000
      The next part is the connector-type, for which I used 02000000.
      I tried the VGA connector-types that Hackintool suggested but I noted some weird differences whereas 02000000 and 01000000 seem to work okay.
      Finally, I don't know what flags do so I tried with 30000000 and 87000000. The only difference is that with 87000000 I'd gain more seconds before the whole screen turns to another color.
       
      This is the final configuration:
      AAPL,ig-platform-id <0300220D> framebuffer-con1-alldata <02020A00 0100000 87000000> framebuffer-con1-enable <01000000> framebuffer-patch-enable <01000000> This is the video proof:
      https://i.imgur.com/bd6jtFh.mp4
       
      macOS Catalina 10.15.3
      Kexts: Whatevergreen 1.3.7
      Boot loader: OpenCore 0.5.6
      PC Specs:
      Intel Core i5 4460
      Intel HD Graphics 4600
      ECS H81H3-M4
      4GB RAM DDR3
      bd6jtFh.mp4
    • By welker
      Hello people,
      I'm having trouble enabling the battery status. I already installed Kext ACPIBatteryManager and tried to apply a ready-made RehabMan patch for Dell models, the patch compiles without errors but does not correct the problem.
      The percentage is stuck at 99% and the icon is as if it were charging, Can someone help me?
       
      My laptop is a Dell Inspiron 14 Series, model i14-5458
    • By ishraqiyun77
      Hi, first post here and pretty new to Hackintoshing.
       
      Specs:
      Lenovo ThinkPad X1 Extreme (laptop) i7-8850H (Coffee Lake) Intel UHD630 GTX 1050 Ti with Max-q 4K Touchscreen 2x 2TB EVO 970 SSD (one for Windows and one for macOS) 2x 32GB DATARAM 2666Mhz DDR4 RAM (max for laptop, works in Windows and Ubuntu) Haven't replaced the Wifi card yet for macOS compatible, just using Ethernet for now Everything else is stock macOS Mojave 10.14.4  
      Was stuck several days just trying to get passed End RandomSeed. What finally worked was the following:
      Clover 4910 (instead of using RehabMan's versions) The attached EFI zip Leaving only one RAM module (1x 32GB) in the first slot on the mobo (the right slot if the laptop is upside down and the back is facing you)  
      Was able to install macOS to the SSD. Well, I am at the phase where I need to get macOS to boot from the SSD  without the USB. Struggling with that, but will make a different thread regarding it.
       
      Thought I'd give it a go again with both RAM modules installed since I read somewhere once macOS is installed, you can change the RAM freely. Again, with both modules installed it just hangs at End RandomSeed.
       
      What I have tried:
      AptioMemoryFix-64 or OsxAptioFix3Drv-64 or OsxAptioFixDrv-64 or OsxAptioFix2Drv-free2000
      AptioMemoryFix-64 plus OsxAptioFix3Drv-64 or OsxAptioFixDrv-64 or OsxAptioFix2Drv-free2000 (read somewhere that having a combination of AptioMemoryFix plus one of the others worked for some people)
      Adding RAM entries in SMBIOS (see attached)
       
      Unfortunately, none have seem to have had an effect. 
       
      Any suggestions?
       
      Thank you in advance for the help!
       

      EFI.zip
    • By grisno
      Hi people,
       
      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!!
       
      Status:
      Speakers : OK Headphones : OK HDMI Audio : OK (Intel HD4K Tested) LineIn : N/A (Model Without LineIn) MicInt : OK MicIntNoiseReduction : OK MicExt : N/A (Model Without MicExt) AutoDetectLineIn : N/A (Model Without LineIn) Sleep : OK WakeUp : OK AutoSleep : OK Hibernate : OK Siri : 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 01271F90 01471C10 01471D00 01471E17 01471F90 01871CF0 01871D00 01871E00 01871F40 01E71CF0 01E71D00 01E71E00 01E71F40 02171C30 02171D10 02171E21 02171F00 01470C02   DSDT:
       
      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;  
×