Re: icon in Dock
Re: icon in Dock
- Subject: Re: icon in Dock
- From: Andrew Keller <email@hidden>
- Date: Fri, 13 Dec 2013 14:21:17 -0500
Doing anything in the user domain is tricky. If you do it from the installer itself, you're likely to do it only for the current user, not any others. If you use a system-level user agent (the recommended approach), then you agent has to be smart enough to both *not* blindly add the icon upon every login (the user may remove the icon, and you don't want to add it back), and at the same time, smart enough *to* add the icon the first time after a new install.
So, here's what it boils down to: You can add the icon for the current user only, and the code is simple. Or, you can add it for all users (including network accounts, and accounts which may not yet exist), and the code would be complicated. Or, you can just not do it at all. That's what I typically do.
To help you with your original question, emmett adds the icon to the *current* user's dock. If you run emmett as-is in an installer script, it will add your icon to the Dock for the root user. If you sign in as the root user, you will see the icon. To add the icon for the user performing the install, prefix the command with `su "$USER" -c`.
- Andrew
On Dec 12, 2013, at 9:00 PM, Oakman wrote:
> Hello,
>
> Before I begin I should say, I am a certifiable newbie at creating installer packages.
>
> Some background: My manager dropped this project in my lap, being the only Mac user in the organization and I have no real choice in the matter.
> We have an application that could be a drag & drop install, but will be installed using Installer.app. Only reason being the manager wants the app's icon in the Dock.
>
> Problem is I am not a programmer and only have some basic knowledge of applescripting and even less of shell scripting.
>
> To create a .mpkg I used Packages and am trying to use emmett to put the icon in the Dock by using a postinsall.sh to do the lifting. Nothing I have tried so far has worked. From Terminal I use
> 'path/to/emmett add /Applications/foo.app'
> which works a treat. If I use the same code in the postinstall.sh it fails.
>
> Please, can one of you folks point me in the right direction?
>
> Thanks for your help.
>
> /Oak
> _______________________________________________
> 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
_______________________________________________
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