dan-snelson / dialog-scripts

Scripts with leverage Bart Reardon's swiftDialog
MIT License
110 stars 35 forks source link

Feature Request: Restart button #15

Closed mvught closed 1 year ago

mvught commented 1 year ago

Is your feature request related to a problem? Please describe. Option to enable Reboot after completed enrollment

dan-snelson commented 1 year ago

Thanks for the Feature Request, @mvught.

Is something like Forced and Dismissible Log Out, Restart or Shut Down Prompts over-kill?

(I'm thinking of just adding these options to Parameter 6: Completion Action.)

riddl0rd commented 1 year ago

Hallo Dan,

It would be nice to precent the enduser with a option to restart after enrollment complete!!!

Also thanks for the hard work you put in this project

dan-snelson commented 1 year ago

Greetings, @mvught and @riddl0rd!

What level of interest do either of you have in testing in-progress, not-for-production code?

dan-snelson commented 1 year ago

@mvught and @riddl0rd:

Will you both please test drive 1.3.1? (Located in the issue-15 branch.)

(As you can imagine, testing forced-restarts is fairly inconvenient.)

Version 1.3.1 (17-Nov-2022)

iDrewbs commented 1 year ago

Hi @dan-snelson Tested out 1.3.1 using the default wait completionAction, but after clicking the Quit button the script continues to run and has to be manually terminated. The final output when it hangs is Honoring wait behavior I also tested with the Sleep behavior for 5 seconds. The script ended after 5 seconds, but the Dialog window remained and the Quit button needed to be clicked in order for it to close.

dan-snelson commented 1 year ago

Thanks for the feedback, @iDrewbs.

Let me double-check and better document what I'm observing.

master-vodawagner commented 1 year ago

I’m interested in this feature too, happy to help.

could this be extended to the failure dialog if presented?

dan-snelson commented 1 year ago

Just committed a change; please re-re-try now, @iDrewbs.

Thanks for the offer, @master-vodawagner; please do.

Yes, this change has been added to both successful and failure dialogs.

Currently, a hard-coded wait command has been added here and here.

(To me, if anything fails, the user should be required to manually acknowledge the failure; I'm interested in every one's feedback.)

dan-snelson commented 1 year ago

Made another commit; thanks for all the assistance.

mobofixer commented 1 year ago

first thanks for the adjustment. this is a game changer for this script:

second:

dan-snelson commented 1 year ago

Thanks for the feedback, @jared-a-young.

  1. So, on a successful completion, if you're using Restart for completionActionOption, you'd also like to require user-interaction? (My initial thought is that for this use-case, you'd use Restart Confirm for completionActionOption.)

  2. Good idea on having the button reflect the setting of completionActionOption; I'll take a look.

dan-snelson commented 1 year ago

When capturing an Asset Tag and clicking Quit, ignore the completionActionOption.

dan-snelson commented 1 year ago

When using Restart for completionActionOption via Self Service, a Cocoa error 132001 is observed.

owainiorwerth commented 1 year ago

Thanks, both!

Just to expand on this slightly - the restart/logout confirm parameter relies on the user to hit the relevant option in the macOS pop-up dialogue - which they could easily dismiss (I don't trust end users one bit!)

Using just the restart or logout parameter ensures that the action requested is carried out but it would be great if it only did it once the user clicked the button, which displayed the text of what was going to happen next i.e. logout or restart.

I can envisage new employees not paying attention to their macs and then turning back around to see the mac restarting or logged out without expecting that to happen (then contacting us needlessly to say 'hey this just happened, is everything ok?')

dan-snelson commented 1 year ago

Setup Your Mac 1.3.1 RC2

iDrewbs commented 1 year ago

I did some testing of the new Completion Action Options in RC2:

CompletionActionOption Feedback:

The remaining options work as expected:

dan-snelson commented 1 year ago

Thanks for your thorough testing and detailed feedback, @iDrewbs!

If I haven't warn out my welcome, please test 1.3.1 RC3. (Also paging @mvught, @riddl0rd, @master-vodawagner and @owainiorwerth.)

I previously observed your findings with the "Confirm" flavors, but couldn't replicate them just now on physical hardware running macOS 13.0.1 (22A400) with Jamf Pro 10.42.1.

iDrewbs commented 1 year ago

Just tested all of the new options and everything looks great! All the verbiage matches the CompletionActionOptions perfectly. The behavior with the "Confirm" flavors may just be a symptom of my test Mac since I have been doing a lot of various testing. I'll try it with a few more, but I don't think it needs to be considered a blocker. Let me know if I can do any further testing!

riddl0rd commented 1 year ago

Just tested the Restart Confirm option configured within the paramater 6 option in the policy, and it works perfect with macOS 13.0.1.

Also will test out the other triggers in the morning.

Thank you!

dan-snelson commented 1 year ago

Feature Request completed with v1.3.1

owainiorwerth commented 1 year ago

@dan-snelson just did some testing. So far I'm having no luck with the attend option (in either logout or restart). I end up back at the desktop. (Running 13.0 / M1 Air / Jamf 10.42.1)

Testing with 1.5.0

dan-snelson commented 1 year ago

Thanks for the feedback, @owainiorwerth.

What behavior are you seeing if you run v1.5.0-rc1 as-is via Terminal?

owainiorwerth commented 1 year ago

OK did a fair bit of testing today with different setups but concluded that...

Restart and Log Out Attended work fine if running the script locally (in both Debug True / or False) - hard coded variables.

Restart and Log Out Attended work fine if manually calling the policy via Self-Service (in both Debug True / or False) - hard coded variables.

Restart and Log Out Attended don't work if automatically calling the policy, which kicks in at Enrollment Complete in our environment. It's a simple policy which just calls the script - hard coded variables. The swift dialog pkg is installed at pre-stage enrollment.

dan-snelson commented 1 year ago

Thanks for the additional details, @owainiorwerth.

Please see Implementation Notes; I'm not testing using enrollmentComplete (but right off I can't see why it wouldn't work).

Will you please open a fresh issue? Thanks.