Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Repair Permissions info needed



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

This email sent to email@hidden
References: 
 >Repair Permissions info needed (From: John Stiles <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.