Skip to content

Commit

Permalink
When running startosinstall, better handle the case where SharedSuppo…
Browse files Browse the repository at this point in the history
…rt.dmg doesn't mount for whatever reason. Addresses #1165
  • Loading branch information
gregneagle committed Dec 6, 2022
1 parent 929a7e9 commit 51cad91
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions code/client/munkilib/osinstaller.py
Expand Up @@ -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

Expand Down Expand Up @@ -312,21 +315,21 @@ 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
# later releases of High Sierra and causes warnings in Mojave
# 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
Expand Down

0 comments on commit 51cad91

Please sign in to comment.