To run a shell command with sudo
privileges you have 2 options:
- With [the usual GUI] password prompt:
do shell script "installer -verbose -pkg your_installer_file.pkg -target /" ¬
with administrator privileges
- Fully automated, with sudo (username and) password hard-coded into your statement [NOT RECOMMENDED for obvious reasons]:
do shell script "installer -verbose -pkg your_installer_file.pkg -target /" ¬
user name "{SudoUserHere}" password "{PasswordHere}" ¬
with administrator privileges
If the executing user is the desired sudo user, the user name
clause is optional.