Scripting Question

Whats the best way to deploy a package to a Mac and force a reboot?

01/23/2015 1510 views
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   [ + ] Show comments


All Answers

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

This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ