Hello Everyone,
Looking for guidance on creating a simple script that will streamline pkg files within an application bundle. I need there to be a progress bar though. Doesnt have to be real-time but needs to stop (alert) when all pkgs have been installed. I know its not possible with AppleScript so my current script below may have to be converted over to bash. Here's what i got in AppleScript thus far:
Looking for guidance on creating a simple script that will streamline pkg files within an application bundle. I need there to be a progress bar though. Doesnt have to be real-time but needs to stop (alert) when all pkgs have been installed. I know its not possible with AppleScript so my current script below may have to be converted over to bash. Here's what i got in AppleScript thus far:
Code:
tell application "Finder"
set myFolder to (quoted form of (POSIX path of ((path to me) as string))) & "Contents/Resources/Installers/"
end tell
do shell script ¬
"installer -allowUntrusted -pkg " & myFolder & ¬
"autoupdate.pkg -target /" with administrator privileges
do shell script ¬
"installer -allowUntrusted -pkg " & myFolder & ¬
"excel.pkg -target /" with administrator privileges
do shell script ¬
"installer -allowUntrusted -pkg " & myFolder & ¬
"onenote.pkg -target /" with administrator privileges
do shell script ¬
"installer -allowUntrusted -pkg " & myFolder & ¬
"powerpoint.pkg -target /" with administrator privileges
do shell script ¬
"installer -allowUntrusted -pkg " & myFolder & ¬
"word.pkg -target /" with administrator privileges
tell application "Finder"
display dialog "Script has completed successfully!" buttons {"Restart", "Cancel"} default button "Cancel" with icon caution
if button returned of result is "Restart" then
do shell script "(sleep 5 ; shutdown -r now) &>/dev/null &" with administrator privileges
end if
end tell