You've inspired me to come up with something similar. This is a lot
better than nothing :) Thanks for the pointer!
BTW, I highly recommend you switch to "quoted form of POSIX path of
myFolder." Otherwise, a ' or " or $1 in your path is going to lead to
big trouble.
On Nov 30, 2005, at 11:41 AM, Michael Shopsin wrote:
John Stiles & etc,
One of our highest tech-support issues is application permissions
and ownership. Our customers will reinstall their OS or add/remove
users, and suddenly they're no longer able to patch their games
because they only have read permission on the enclosing folder.
I've had this problem as well and I did come up with a creative
solution. I created a permissions fixing AppleScript that would
only run in my own directory. The script is as follows:
set myFolder to path to me
set myFolder to POSIX path of myFolder
if myFolder contains "EdGCM" and myFolder contains "Applications" then
display dialog "You will need to enter an administrator password
to repair permissions for EdGCM. Please continue when you have the
password." buttons {"Cancel", "Continue"} default button "Continue"
with icon note
set myFolder to myFolder & "../.."
set myUserID to do shell script "id -u"
set myGroupID to do shell script "id -g"
set myChmod to "chmod -R 777 \"" & myFolder & "\""
set myChown to "chown -R " & myUserID & ":" & myGroupID & " \"" &
myFolder & "\""
do shell script myChmod & ";" & myChown with administrator privileges
display dialog "Permissions and ownership have been repaired for
the current user for EdGCM." buttons {"OK"} with icon note
else
display dialog "You cannot repair permissions if this program is
moved from it's original location." buttons {"OK"} with icon stop
end if
While this code does render the folder world readable it seems an
OK compromise since the default location for my app is inside the
users home directory.
Michael
--
----------------------------------------------------------------------
--------
Michael Shopsin;MacProgrammer;If it's not on fire then it's a
software problem
EdGCM: explore the climate in your classroom, http://www.edgcm.com
Email: email@hidden; Office: Room 560; Phone: (212) 678-5642
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden