HP pkg fails to install because it checks for os less then 12.0
expand contents of pkg into folder
pkgutil --expand HewlettPackardPrinterDrivers-10.6.0.1.1.1602826228.pkg HewlettPackardPrinterDrivers-10.6.0.1.1.1602826228
Modify distribution file:
if (system.compareVersions(system.version.ProductVersion, '12.0') > 0) {
to be 13.0 or something higher
turn folder back into pkg
pkgutil --flatten HewlettPackardPrinterDrivers-10.6.0.1.1.1602826228 HewlettPackardPrinterDrivers-10.6.0.1.1.1602826228.pkg
Edited to add a script:
Bash:
#!/bin/bash
curl -o ~/Downloads/hpdrivers.dmg https://updates.cdn-apple.com/2020/macos/001-41745-20201210-DBC9B46B-88B2-4032-87D9-449AF1D20804/HewlettPackardPrinterDrivers.dmg
hdiutil attach ~/Downloads/hpdrivers.dmg
pkgutil --expand /Volumes/HP_PrinterSupportManual/HewlettPackardPrinterDrivers.pkg ~/Downloads/hp-expand
hdiutil eject /Volumes/HP_PrinterSupportManual
sed -i '' 's/12.0/13.0/' ~/Downloads/hp-expand/Distribution
pkgutil --flatten ~/Downloads/hp-expand ~/Downloads/HP_Drivers_12.pkg
rm -R ~/Downloads/hp-expand
Brilliant. Worked first time!!! (Even thought I REALLY didn't think it would!).
For total neophytes and non-techies, here is a step-by-step guide of the whole process:
1. Connect your HP printer to your Mac, and turn it on so that it is ready for the drivers to find it.
2. In your Mac, open the 'Terminal' program.
3. In the dialog box, copy and past the following code into Terminal:
#!/bin/bash
curl -o ~/Downloads/hpdrivers.dmg
https://updates.cdn-apple.com/2020/...449AF1D20804/HewlettPackardPrinterDrivers.dmg
hdiutil attach ~/Downloads/hpdrivers.dmg
pkgutil --expand /Volumes/HP_PrinterSupportManual/HewlettPackardPrinterDrivers.pkg ~/Downloads/hp-expand
hdiutil eject /Volumes/HP_PrinterSupportManual
sed -i '' 's/12.0/13.0/' ~/Downloads/hp-expand/Distribution
pkgutil --flatten ~/Downloads/hp-expand ~/Downloads/HP_Drivers_12.pkg
rm -R ~/Downloads/hp-expand
4. Hit Return key to start it running. Your Mac will then download the drivers (takes a few minutes), open the software, make the changes to the code, and close the software. This code works for OS Monterey 12.x (I have v12.5.1, and it worked fine for me)
5. When it has completed, the last line of code will be " rm -R ~/Downloads/hp-expand~ " and the program will stop. You can now close Terminal.
6. This code will have created a new driver package called HP_Drivers_12.pkg in your Downloads folder. Run this as normal, and it will install the HP drivers.
7. Go to System Preferences > Printers & Scanners. Add New Printer (click the "+" of bottom left hand side), and your connected printer should be listed by Name and Connection Type (probably 'USB' if it is connected to the computer's USB port).
8. Select the printer, rename it if you so desire and select Add. You should be good to go.
hope this helps!