Skip to content

Commit

Permalink
Merge pull request #49 from MichalMMac/fix-userland
Browse files Browse the repository at this point in the history
Change userland detection to reflect all item types
  • Loading branch information
erikng committed Dec 6, 2019
2 parents e3b2695 + fcd2778 commit 78cda3d
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions payload/Library/installapplications/installapplications.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,18 @@ def main():
continue
iaslog('%s processing %s %s at %s' % (stage, type, name, path))

# On userland stage, we want to wait until we are actually
# in the user's session.
if stage == 'userland':
if len(iajson['userland']) > 0:
while (getconsoleuser()[0] is None
or getconsoleuser()[0] == 'loginwindow'
or getconsoleuser()[0] == '_mbsetupuser'):
iaslog('Detected SetupAssistant in userland '
'stage - delaying install until user '
'session.')
time.sleep(1)

if type == 'package':
packageid = item['packageid']
version = item['version']
Expand All @@ -627,17 +639,6 @@ def main():
download_if_needed(item, stage, type, opts,
depnotifystatus)

# On userland stage, we want to wait until we are actually
# in the user's session.
if stage == 'userland':
if len(iajson['userland']) > 0:
while (getconsoleuser()[0] is None
or getconsoleuser()[0] == 'loginwindow'
or getconsoleuser()[0] == '_mbsetupuser'):
iaslog('Detected SetupAssistant in userland '
'stage - delaying install until user '
'session.')
time.sleep(1)
iaslog('Installing %s from %s' % (name, path))
if opts.depnotify:
if stage == 'setupassistant':
Expand Down

0 comments on commit 78cda3d

Please sign in to comment.