You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When the erase-install script is called by Munki on an M1 Mac and it shows an AppleScript dialog, you can interact with some parts of the dialog but not others. For example, when it asks for the user's password, you can click the Enter and Stop buttons but when you try to type in the text box you hear error sounds and no text appears.
To Reproduce
Call erase-install.sh from a postinstall_script in Munki on a computer running Big Sur (does not happen in 12.2)
Expected behavior
You should be able to interact with the entire AppleScript dialog
Code/log output
Full command: /Library/Management/erase-install/erase-install.sh --erase --depnotify
Environment (please complete the following information):
OS: 11.6.1
Erase-install version 23, 24, 24.1, and 25
The fix
In the ask_for_shortname function, change /usr/bin/osascript to sudo -u "$current_user" /usr/bin/osascript
In the ask_for_password function, change /usr/bin/osascript to sudo -u "$current_user" /usr/bin/osascript
Add between the lines starting with “current_user=“ and "location=": current_uid=$(/usr/bin/id -u "$current_user")
In the open_osascript_dialog function, change /usr/bin/osascript to /bin/launchctl asuser $current_uid /usr/bin/osascript
The last two were originally to fix the dialog in free_space_check not working in v23/24 before that was moved to the separate open_osascript_dialog function but I'm pretty sure the same fix still applies, and it can't hurt to have any other dialogs run at the current user as well. There may be some other places that osascript is used but those are the ones I encountered when testing the erase-install script initially last year.
The text was updated successfully, but these errors were encountered:
It's been a long time since I tested the drive space part, but I remember being surprised the same method didn't work there. But I just rolled my test machine back to Big Sur and tried it again, and it seems to work with no modifications so never mind on those last two fixes!
ask_for_shortname and ask_for_password definitely don't work without being modified, though
Describe the bug
When the erase-install script is called by Munki on an M1 Mac and it shows an AppleScript dialog, you can interact with some parts of the dialog but not others. For example, when it asks for the user's password, you can click the Enter and Stop buttons but when you try to type in the text box you hear error sounds and no text appears.
To Reproduce
Call erase-install.sh from a postinstall_script in Munki on a computer running Big Sur (does not happen in 12.2)
Expected behavior
You should be able to interact with the entire AppleScript dialog
Code/log output
Full command:
/Library/Management/erase-install/erase-install.sh --erase --depnotify
Environment (please complete the following information):
The fix
/usr/bin/osascript
tosudo -u "$current_user" /usr/bin/osascript
/usr/bin/osascript
tosudo -u "$current_user" /usr/bin/osascript
current_uid=$(/usr/bin/id -u "$current_user")
/usr/bin/osascript
to/bin/launchctl asuser $current_uid /usr/bin/osascript
The last two were originally to fix the dialog in free_space_check not working in v23/24 before that was moved to the separate open_osascript_dialog function but I'm pretty sure the same fix still applies, and it can't hurt to have any other dialogs run at the current user as well. There may be some other places that osascript is used but those are the ones I encountered when testing the erase-install script initially last year.
The text was updated successfully, but these errors were encountered: