Re: shell script 'touch' problem
Re: shell script 'touch' problem
- Subject: Re: shell script 'touch' problem
- From: Axel Luttgens <email@hidden>
- Date: Sat, 10 Mar 2012 09:05:24 +0100
Le 10 mars 2012 à 07:58, Brian Christmas a écrit :
> G'day scripters
>
> As the installer for GeeThree iMovieHD 6 add-ons no longer works with Lion, I thought I'd write an installer for myself.
>
> I find the extras become corrupted after a while, so wanted an installer to keep them updated.
>
> The following second line works in Snow Leopard, but not in Lion.
>
> Can someone set me straight on what's required please?
>
> Regards
>
> Santa
>
> if not (exists (ptl & "Preferences:com.apple.iLife08.plist") as text) then
> do shell script "touch /Library/Preferences/com.apple.iLife08.plist"
> set theFlag to true
> end if
Hello Brian,
Yes, permissions for various system folders have been tightened in Lion.
As a result, if the touch(1) command is to create an item in /Library/Preferences, this requires root privileges; the same way, if the plist already exists and has been created by a regular installer, it is very likely that it is changeable by root only as well.
In previous versions of the OS, members of the admin group (aka Administrator users in the GUI) were able to perform such things; which was not a very desirable state of affairs, as many Mac OS X users tend to run their box as an Administrator user for daily usage...
So, you would need to make use of the following:
do shell script "touch /Library/Preferences/com.apple.iLife08.plist"
with administrator privileges
This will prompt you for an Administrator name/password, and the shell script will be run as system user root.
This also means that the slightest error in such scripts (a path pointing to a wrong item, for example) may prove catastrophic for your system as a whole... Are you sure the cause of the extras corruption couldn't be tracked and remedied instead?
HTH,
Axel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden