Re: Associating files in Packages
Re: Associating files in Packages
- Subject: Re: Associating files in Packages
- From: Greg Neagle <email@hidden>
- Date: Fri, 30 May 2014 07:06:57 -0700
Apart from any syntax issues, scripts in installation packages generally run as root. So your "defaults" command below is most likely affecting _root_'s com.apple.LaunchServices preferences.
This would explain why it works when you run it manually in Terminal -- you are probably running it in your own user context.
-Greg
On May 30, 2014, at 1:58 AM, James Pritchard <email@hidden> wrote:
> Has anyone had experience associating a file type during an install? I have a script as shown below:
>
> #!/bin/sh
>
> defaults write com.apple.LaunchServices LSHandlers -array-add '{ LSHandlerContentType = "net.company.software.file"; LSHandlerRoleAll = "net.company.software.app"; }'
>
> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
>
> When I run this script from Terminal it works fine but when I add it to my Packages installer. The second part of the script doesn't seem to run. The file associations aren't changed until I restart the computer.
>
> Does anyone know what might be happening?
>
> Thanks,
> James
> _______________________________________________
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden