From 51cad91a3140456b5b4a1407cf725fdc219bf998 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Tue, 6 Dec 2022 08:39:21 -0800 Subject: [PATCH] When running startosinstall, better handle the case where SharedSupport.dmg doesn't mount for whatever reason. Addresses #1165 --- code/client/munkilib/osinstaller.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/client/munkilib/osinstaller.py b/code/client/munkilib/osinstaller.py index 093089627..f92ccf133 100644 --- a/code/client/munkilib/osinstaller.py +++ b/code/client/munkilib/osinstaller.py @@ -280,6 +280,9 @@ def start(self): app_path, 'Contents/Resources/startosinstall') os_vers_to_install = get_os_version(app_path) + if not os_vers_to_install: + display.display_warning( + 'Could not get OS version to install from application bundle.') # run startosinstall via subprocess @@ -312,7 +315,7 @@ def start(self): '--rebootdelay', '300', '--pidtosignal', str(os.getpid())]) - if pkgutils.MunkiLooseVersion( + if os_vers_to_install and pkgutils.MunkiLooseVersion( os_vers_to_install) < pkgutils.MunkiLooseVersion('10.14'): # --applicationpath option is _required_ in Sierra and early # releases of High Sierra. It became optional (or is ignored?) in @@ -320,13 +323,13 @@ def start(self): # so don't add this option when installing Mojave cmd.extend(['--applicationpath', app_path]) - if pkgutils.MunkiLooseVersion( + if os_vers_to_install and pkgutils.MunkiLooseVersion( os_vers_to_install) < pkgutils.MunkiLooseVersion('10.12.4'): # --volume option is _required_ prior to 10.12.4 installer # and must _not_ be included in 10.12.4+ installer's startosinstall cmd.extend(['--volume', '/']) - if pkgutils.MunkiLooseVersion( + if os_vers_to_install and pkgutils.MunkiLooseVersion( os_vers_to_install) < pkgutils.MunkiLooseVersion('10.13.5'): # --nointeraction is an undocumented option that appears to be # not only no longer needed/useful but seems to trigger some issues