Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Restart button #15

Closed
mvught opened this issue Nov 16, 2022 · 24 comments
Closed

Feature Request: Restart button #15

mvught opened this issue Nov 16, 2022 · 24 comments
Assignees
Labels
enhancement New feature or request

Comments

@mvught
Copy link

mvught commented Nov 16, 2022

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

@mvught mvught added the enhancement New feature or request label Nov 16, 2022
@mvught mvught changed the title Reboot button After completed Restart button Nov 16, 2022
@mvught mvught changed the title Restart button Feature Request: Restart button Nov 16, 2022
@dan-snelson
Copy link
Owner

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
Copy link

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
Copy link
Owner

Greetings, @mvught and @riddl0rd!

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

@dan-snelson
Copy link
Owner

@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)

  • Added a completionAction function (i.e., Wait, Sleep, Logout, Restart or Shutdown)
  • Removed jamfDisplayMessage function and reverted dialogCheck function to use osascript (with an enhanced error message)
  • Swapped blurscreen for moveable in Debug Mode
  • Replaced "Installing …" with "Updating …" for recon-flavored trigger
  • Changed "Updating Inventory" to "Computer Inventory" in final listitem
  • Increased Debug Mode speed

@iDrewbs
Copy link

iDrewbs commented Nov 18, 2022

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
Copy link
Owner

Thanks for the feedback, @iDrewbs.

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

@master-vodawagner
Copy link

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

could this be extended to the failure dialog if presented?

@dan-snelson
Copy link
Owner

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
Copy link
Owner

Made another commit; thanks for all the assistance.

@mobofixer
Copy link

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

second:

  • the restart kicks off automatically without button interaction. An interaction would be nice vs auto running
    for the selected completionAction selection.
  • In the parameter can it change the name of the button from Quit to what the parameter is? The select command also kicks off in debug mode. maybe default to quit in debug?
    otherwise i am loving how quick and easy this was to set up

@dan-snelson
Copy link
Owner

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
Copy link
Owner

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

@dan-snelson
Copy link
Owner

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

@owainiorwerth
Copy link

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
Copy link
Owner

dan-snelson commented Nov 19, 2022

Setup Your Mac 1.3.1 RC2

  • Significantly enhanced Completion Action options
    • ✅ Addresses Issue 15 (thanks, @mvught, @riddl0rd, @iDrewbs and @master-vodawagner)
    • 🕺 Dynamically set button1text based on the value of completionActionOption (thanks, @jared-a-young)
    • 🆕 Three new flavors: Shut Down, Restart or Log Out
      • 🚨 Forced: Zero user-interaction
        • Added brute-force killProcess "Self Service"
        • Added hack to allow Policy Logs to be shipped to Jamf Pro server
      • ⚠️ Attended: Forced, but only after user-interaction (thanks, @owainiorwerth)
        • Added hack to allow Policy Logs to be shipped to Jamf Pro server
      • 👤 Confirm: Displays built-in macOS user-dismissible dialog box
    • Sleep
    • Wait (default)
  • Improved Debug Mode behavior
    • 🐛 DEBUG MODE | now only displayed as infotext (i.e., bottom, left-hand corner)
    • completionAction informational-only with simple dialog box (thanks, @_____?)
    • Swapped blurscreen for moveable
    • General peformance increases
  • Miscellaneous Improvements
    • Removed jamfDisplayMessage function and reverted dialogCheck function to use osascript (with an enhanced error message)
    • Replaced "Installing …" with "Updating …" for recon-flavored trigger
    • Changed "Updating Inventory" to "Computer Inventory" for recon-flavored listitem
    • Changed exit code to 1 when user quits "Welcome" screen
    • Changed welcomeIcon URLs
    • Add way too many emojis to ChangeLog

@dan-snelson dan-snelson added the testing needed On-hold, awaiting feedback label Nov 19, 2022
@iDrewbs
Copy link

iDrewbs commented Nov 20, 2022

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

CompletionActionOption Feedback:

  • Wait - When using this option, Button1 text says "Wait" at the end, which could confuse the user thinking they need to wait for something. It would be better to read "Quit" or "Close"
  • Log Out Confirm - The logout confirmation prompt is triggered before clicking the "Log Out" button. Should this be updated, so the logout confirmation is triggered once the button is clicked?
  • Restart Confirm - The Restart confirmation prompt is. being triggered before clicking the "Restart" button. Should this be updated, so the Restart confirmation is triggered once the button is clicked?
  • Shut Down Confirm - The Shut Down confirmation prompt is triggered before clicking the "Shut Down" button. Should this be updated, so the Shut Down confirmation is triggered once the button is clicked?
  • Shut Down Attended - This works as expected. However, the progresstext at the bottom includes "Complete! Please restart..." instead of "Complete Please Shut Down"
  • Shut Down - This works as expected, however, the progresstext at the bottom includes "Complete! Please Restart...". It should probably indicate something like "Complete! Shutting Down your Mac..."

The remaining options work as expected:

  • Sleep - This works great. It might be helpful to change the button to read "Please Wait" but either works :)
  • Log Out Attended - This works great.
  • Log Out - this works great.
  • Restart Attended - This works great.
  • Restart - this works great.

@dan-snelson
Copy link
Owner

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
Copy link

iDrewbs commented Nov 20, 2022

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
Copy link

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 dan-snelson removed the testing needed On-hold, awaiting feedback label Nov 21, 2022
@dan-snelson
Copy link
Owner

Feature Request completed with v1.3.1

@owainiorwerth
Copy link

owainiorwerth commented Nov 21, 2022

@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
Copy link
Owner

dan-snelson commented Nov 21, 2022

Thanks for the feedback, @owainiorwerth.

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

@owainiorwerth
Copy link

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

7 participants