macadmins / installapplications

A tool for dynamically using installapplication
Apache License 2.0
286 stars 62 forks source link

If a user script fails, InstallApplications should stop running #74

Open erikng opened 4 years ago

erikng commented 4 years ago

if root scripts fail multiple times, the run will stop, however if a user script fails, the run will keep going.

This is could be problematic for environments that need the user section to complete successfully. With https://github.com/macadmins/installapplications/commit/5218c9683c0ec72e784106611a93eafb5b0ed20f I fixed the infinite looping when not exiting 0, but introduced this issue.

This will be a difficult one to solve since the user side runs in a different process and we cannot capture the state of the run itself.

bfreezy commented 3 years ago

I've been pondering this as well in my testing...

Currently, I've been unloading IA's LaunchDaemon from within the user script if it fails. That method is less than ideal and requires some hacking.

An idea (haven't tested this):

erikng commented 3 years ago

That's a pretty good idea.