Cody
May 27, 2004, 12:25am
#1
I want to install all packages in a folder, and i’m using the command line installer to do it so I dont have to click agree on each one… here’s what i have so far…:
–Open this script in a new Script Editor window.
set targ to “Domo:Cody:Packages:”
set dest to POSIX path of “Volumes:Domo:”
tell application “Finder”
set pkglist to every package in folder targ
repeat with counter from 1 to number of items of pkglist
set pkg to POSIX path of (item counter of pkglist as alias )
set cmd to "sudo installer -pkg " & pkg & " -target " & dest
do shell script cmd
end repeat
end tell
[This script was automatically tagged for color coded syntax by Convert Script to Markup Code
Help? Suggestions? Easier way?
Cody
May 27, 2004, 9:42pm
#2
Learned some new stuff, made a few changes. It tells me I have the wrong password, but I don’t. Does I need to be in the sudoers file?
–Open this script in a new Script Editor window.
–set targ to choose folder
set targ to “Domo:Cody:Packages:Test:”
set pass to display dialog “Administrator Privileges Required. Enter Password:” default answer “[]”
tell application “Finder” to set pkglist to every package in folder targ
repeat with counter from 1 to number of items of pkglist
set pkg to POSIX path of (item counter of pkglist as alias )
set cmd to "installer -pkg " & (text 1 thru -2 of pkg )
display dialog “This command will be executed with admin privileges:” & {return } & cmd
do shell script cmd password pass with administrator privileges
end repeat
[This script was automatically tagged for color coded syntax by Convert Script to Markup Code ]