From 854798a01020121a83e4a378e7b3686f8d445798 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Mon, 14 Mar 2022 15:26:12 -0700 Subject: [PATCH 01/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 38ab62e..7759c22 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Product installation failed. Use a compatible Mac or select a different build compatible with your current hardware and try again. You may also have success running the script in a VM; the InstallationCheck script in versions of the macOS installer to date skips the checks (and returns success) when run on a VM. ##### Important note for Catalina+ -Catalina privacy protections might interfere with the operation of this tool if you run it from ~/Desktop, ~/Documents, ~/Downloads or other directories protected in Catalina. Consider using /Users/Shared (or subdirectory) as the "working space" for this tool. +macOS privacy protections might interfere with the operation of this tool if you run it from ~/Desktop, ~/Documents, ~/Downloads or other directories protected in macOS Catalina or later. Consider using /Users/Shared (or subdirectory) as the "working space" for this tool. ##### Alternate implementations From a8a6f150c8153fa16f7790b115d56015d0dc13d4 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Tue, 5 Apr 2022 10:42:52 -0700 Subject: [PATCH 02/10] Python 3 fix for setting Seed Program xattr. --- installinstallmacos.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/installinstallmacos.py b/installinstallmacos.py index 46fc413..984cda0 100755 --- a/installinstallmacos.py +++ b/installinstallmacos.py @@ -634,7 +634,8 @@ def main(): if installer_app: print("Adding seeding program %s extended attribute to app" % seeding_program) - xattr.setxattr(installer_app, 'SeedProgram', seeding_program) + xattr.setxattr(installer_app, 'SeedProgram', + seeding_program.encode("UTF-8")) print('Product downloaded and installed to %s' % sparse_diskimage_path) if args.raw: unmountdmg(mountpoint) From 944a01cb06ef494af674e5d1c0f5dfdb15021550 Mon Sep 17 00:00:00 2001 From: scheblein Date: Fri, 7 Jul 2023 14:32:59 -0400 Subject: [PATCH 03/10] Update installinstallmacos.py (#115) added catalog url for Ventura --- installinstallmacos.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/installinstallmacos.py b/installinstallmacos.py index 984cda0..0c5d461 100755 --- a/installinstallmacos.py +++ b/installinstallmacos.py @@ -66,6 +66,9 @@ DEFAULT_SUCATALOGS = { '21': 'https://swscan.apple.com/content/catalogs/others/' 'index-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9' '-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog', + '22': 'https://swscan.apple.com/content/catalogs/others/' + 'index-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9' + '-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog' } SEED_CATALOGS_PLIST = ( From 1fc3224198d70d8ed0424544f5d59595a5a6b671 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Tue, 10 Oct 2023 11:34:57 -0700 Subject: [PATCH 04/10] Add default catalog URL for Sonoma --- installinstallmacos.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/installinstallmacos.py b/installinstallmacos.py index 0c5d461..fa0ff7a 100755 --- a/installinstallmacos.py +++ b/installinstallmacos.py @@ -68,6 +68,9 @@ DEFAULT_SUCATALOGS = { '-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog', '22': 'https://swscan.apple.com/content/catalogs/others/' 'index-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9' + '-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog', + '23': 'https://swscan.apple.com/content/catalogs/others/' + 'index-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9' '-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog' } From ba1eeab9d06a866d19c7b5d5f4656b74f9b5e36f Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Tue, 18 Jun 2024 13:42:17 -0700 Subject: [PATCH 05/10] Add munki_bundle_pkg_finder script --- munki_bundle_pkg_finder.py | 62 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 munki_bundle_pkg_finder.py diff --git a/munki_bundle_pkg_finder.py b/munki_bundle_pkg_finder.py new file mode 100755 index 0000000..3538774 --- /dev/null +++ b/munki_bundle_pkg_finder.py @@ -0,0 +1,62 @@ +#!/usr/local/munki/munki-python + +import os +import plistlib +import sys + +sys.path.append("/usr/local/munki") + +from munkilib import dmgutils +from munkilib import pkgutils + +if len(sys.argv) != 2: + print('Need exactly one parameter: path to a munki repo!', file=sys.stderr) + sys.exit(-1) + +repo_path = sys.argv[1] + +all_catalog = os.path.join(repo_path, "catalogs/all") + +with open(all_catalog, mode="rb") as FILE: + all_items = plistlib.load(FILE) + +dmg_items = [{"name": item["name"], + "version": item["version"], + "location": item["installer_item_location"], + "package_path": item.get("package_path", "")} + for item in all_items + if item.get("installer_item_location", "").endswith(".dmg") and + item.get("installer_type") is None] + +items_with_bundle_style_pkgs = [] +for item in dmg_items: + full_path = os.path.join(repo_path, "pkgs", item["location"]) + print("Checking %s..." % full_path) + mountpoints = dmgutils.mountdmg(full_path) + if mountpoints: + pkg_path = item["package_path"] + if pkg_path: + itempath = os.path.join(mountpoints[0], pkg_path) + if os.path.isdir(itempath): + print("***** %s--%s has a bundle-style pkg" + % (item["name"], item["version"])) + items_with_bundle_style_pkgs.append(item) + else: + for file_item in os.listdir(mountpoints[0]): + if pkgutils.hasValidInstallerItemExt(file_item): + itempath = os.path.join(mountpoints[0], file_item) + if os.path.isdir(itempath): + print("***** %s--%s has a bundle-style pkg" + % (item["name"], item["version"])) + items_with_bundle_style_pkgs.append(item) + break + dmgutils.unmountdmg(mountpoints[0]) + else: + print("No filesystems mounted from %s" % full_path) + continue + +print("Found %s items with bundle-style pkgs." + % len(items_with_bundle_style_pkgs)) +for item in sorted(items_with_bundle_style_pkgs, key=lambda d: d["name"]): + print("%s--%s"% (item["name"], item["version"])) + print(" %s" % item["location"]) From 77e507e4351bd35db771706c4f3d6955b6bce968 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Wed, 18 Sep 2024 08:45:38 -0700 Subject: [PATCH 06/10] Add Sequoia sucatalog URL --- installinstallmacos.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/installinstallmacos.py b/installinstallmacos.py index fa0ff7a..7ac8d44 100755 --- a/installinstallmacos.py +++ b/installinstallmacos.py @@ -71,6 +71,9 @@ DEFAULT_SUCATALOGS = { '-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog', '23': 'https://swscan.apple.com/content/catalogs/others/' 'index-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9' + '-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog', + '24': 'https://swscan.apple.com/content/catalogs/others/' + 'index-15-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9' '-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog' } From 85c643e68416c5bca9622baf007f51b980b6d7f4 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Tue, 24 Jun 2025 09:52:55 -0700 Subject: [PATCH 07/10] macOS 26 updates --- installinstallmacos.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/installinstallmacos.py b/installinstallmacos.py index 7ac8d44..c757202 100755 --- a/installinstallmacos.py +++ b/installinstallmacos.py @@ -74,6 +74,9 @@ DEFAULT_SUCATALOGS = { '-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog', '24': 'https://swscan.apple.com/content/catalogs/others/' 'index-15-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9' + '-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog', + '25': 'https://swscan.apple.com/content/catalogs/others/' + 'index-26-15-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9' '-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog' } @@ -152,7 +155,8 @@ def get_default_catalog(): def make_sparse_image(volume_name, output_path): '''Make a sparse disk image we can install a product to''' - cmd = ['/usr/bin/hdiutil', 'create', '-size', '16g', '-fs', 'HFS+', + # note: for macOS 26 Tahoe we needed to increase the size + cmd = ['/usr/bin/hdiutil', 'create', '-size', '20g', '-fs', 'HFS+', '-volname', volume_name, '-type', 'SPARSE', '-plist', output_path] try: output = subprocess.check_output(cmd) From a66413ec7e6112b4873048bf0fec332a3cab0cfd Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Sat, 12 Jul 2025 06:27:32 -0700 Subject: [PATCH 08/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7759c22..a38f77e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ might not. These are currently only supported using Apple's Python on macOS. There is no support for running these on Windows or Linux. -In macOS 12.3, Apple will be removing its Python 2.7 install. You'll need to provide your own Python to use these scripts. You may also need to install additional Python modules. +In macOS 12.3, Apple stopped providung Python as part of macOS. You'll need to provide your own Python to use these scripts. You may also need to install additional Python modules. #### getmacosipsws.py From 2cc8b899204838cfcf4d8c162a75182b3e32daab Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Sat, 12 Jul 2025 06:28:47 -0700 Subject: [PATCH 09/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a38f77e..f98b1d3 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Some scripts that might be of use to macOS admins. Might be related to Munki; might not. -These are currently only supported using Apple's Python on macOS. There is no support for running these on Windows or Linux. +These are only supported on macOS. There is no support for running these on Windows or Linux. In macOS 12.3, Apple stopped providung Python as part of macOS. You'll need to provide your own Python to use these scripts. You may also need to install additional Python modules. From 522fc7ff40fbd17839bf4714e103bc52fa232f59 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Wed, 20 Aug 2025 13:55:28 -0700 Subject: [PATCH 10/10] Workaround for issue with installer in macOS 15.6 --- installinstallmacos.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/installinstallmacos.py b/installinstallmacos.py index c757202..3b70da7 100755 --- a/installinstallmacos.py +++ b/installinstallmacos.py @@ -239,7 +239,12 @@ def install_product(dist_path, target_vol): # set CM_BUILD env var to make Installer bypass eligibilty checks # when installing packages (for machine-specific OS builds) os.environ["CM_BUILD"] = "CM_BUILD" - cmd = ['/usr/sbin/installer', '-pkg', dist_path, '-target', target_vol] + #cmd = ['/usr/sbin/installer', '-pkg', dist_path, '-target', target_vol] + # a hack to work around a change in macOS 15.6+ since installing a .dist + # file no longer works + dist_dir = os.path.dirname(dist_path) + install_asst_pkg = os.path.join(dist_dir, "InstallAssistant.pkg") + cmd = ['/usr/sbin/installer', '-pkg', install_asst_pkg, '-target', target_vol] try: subprocess.check_call(cmd) except subprocess.CalledProcessError as err: