Re: Script help
Re: Script help
- Subject: Re: Script help
- From: Bill Coderre <email@hidden>
- Date: Mon, 11 Jun 2012 12:52:07 -0700
1) It is pretty OK for what it is, but, most importantly, you should ALWAYS use the same capitalizations as the real files have, such as Firefox.app. Some users set their Macs to use "case sensitive file systems, and your script will fail on their machines.
1.5) Also, always use the full path to unix commands.
2) You could use this line instead:
> /usr/bin/killall Firefox
3) Your /bin/rm will not work if the user moves Firefox. Also, it's probably unnecessary.
5) Whenever you write a script, return the value 0. If you return an error, installation will stop. This might seem like a good idea, but
a) The user will see a scary error message and call you and complain;
b) if you have multiple packages being installed as part of one big distribution, it could result in some preflights being run, without the files being copied, which might result in bad things.
6) In bundle packages, there were six scripts run:
> preflight preinstall preupgrade
> postflight postinstall postupgrade
In flat packages, there are two:
> preinstall postinstall
7) There are differences in the package layouts, so if you have a script call another tool that might change.
There's probably more, but this should get you started.
(And why is all this so important? Well, because installers have to be perfect, or you have a bigger problem than when you started.)
On Jun 11, 2012, at 11:36 AM, vishnu kulkarni <email@hidden> wrote:
> I'm pretty new to scripting. I have written a script to be included as
> preflight script while packaging Firefox App. I have used the below
> script to Kill the app before it installs and to remove the app before
> installing the App. Can some one please validate the Script if it's
> right? Script works fine with the package.
>
> #!/bin/sh
> ps -ef | awk '/firefox/ && !/awk/ {print $2}'|xargs kill -9
>
> rm -rf /Applications/firefox.app
>
>
> Thanks,
>
> Vishnu
> _______________________________________________
> 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
- Follow-Ups:
- WWDC?
- From: "Michele Corum -X (mcorum - aap3 at Cisco)" <email@hidden>
References: | |
| >Script help (From: vishnu kulkarni <email@hidden>) |