Re: need to run a ln command for every boot
Re: need to run a ln command for every boot
- Subject: Re: need to run a ln command for every boot
- From: Fritz Anderson <email@hidden>
- Date: Wed, 05 Oct 2011 10:27:03 -0500
On 5 Oct 2011, at 3:53 AM, kiran kumar wrote:
> i am using this below script for creating a shortcut icon for my test application on my desktop, when i install my package.
>
> #!/bin/sh
> `chmod -R 777 /Applications/test.app`
> `ln -s /Applications/test.app ~/Desktop/`
>
> First time when i install my package it creates a shortcut icon on desktop ,when i uninstall and install again (second time)
> there is no shortcut icon on my desktop.
You may be caught in the distinction between post-update, post-install, and post-flight scripts in installer packages. Refer your question to email@hidden for more guidance.
Bear in mind that an installer package may not have access to users' home directories. $HOME may not be defined (or may be defined as /var/root) at install time. Accessing user directories in an installer is not recommended.
One way to accomplish what you literally intend is to install a global launch agent that performs your script upon user logins.
However, if you mean to do what I think you mean, DO NOT PURSUE THIS.
This is not Windows. Forcing an alias into the user's directory structure, especially into the Desktop, is a hostile act in the Mac user experience. You will get angry support calls. People will delete your application. People will go on message boards and Twitter recommending that nobody purchase your product. The user is the master of the Mac desktop. Nothing — not even system icons — appears there without his consent. If you want the user to find your application immediately upon installation, there are ways to call attention to it, such as by having Finder open the parent directory and select the icon.
Installing a launch agent just to promote your product is an outright declaration of war. Users who want to opt out of your forcing them to run your script will find that they have to do some abstruse deletions and shell commands. This will lead to more forum and mailing-list posts, and your customers will be livid with rage.
In-house applications that are mandatory for all employees might be an exception. Having an inexperienced manager with a fetish for making everything work like Windows is not.
— F
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden