What is the best way  install a .pkg on a Mac and force a reboot when complete? I want to ensure users have the ability to snooze the install which will reboot the system.
Answer Summary:
0 Comments   [ - ] Hide Comments


Please log in to comment

Answer this question or Comment on this question for clarity


Create a install.sh script that will run the install and then the reboot command. It will look like this:

installer -pkg package.pkg -target /
shutdown -r now

Make sure the script is set as executable using the chmod command. Place the script in the same folder as the pkg and compress both of them into an archive. Upload this archive to the software title. When you create the distribution use the custom command option and enter the following:

unzip -o archive.zip && install.sh

I use this technique for complicated installs regularly although I don't force a reboot.

Answered 01/26/2015 by: chucksteel
Red Belt

Please log in to comment
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja