Re: Preflight script opens rather than executing
Re: Preflight script opens rather than executing
- Subject: Re: Preflight script opens rather than executing
- From: Karl Kuehn <email@hidden>
- Date: Fri, 22 Apr 2011 22:08:42 -0700
On Apr 21, 2011, at 2:52 PM, Tim Streater wrote:
> I want my app to be installed in the user's Applications folder. Normally this works fine but if that folder is absent then the installer runs anyway and just dumps the files into the user's home directory. So, I'm thinking I should run a pre-install Action for the whole package which will check for the existence of the user's Applications folder and create it if it is absent. I have a PHP script which can do that; it has execute permission and its first line is #!/usr/bin/php. Runs fine from the command line.
Sorry about the delayed response, but I want to sound the note of caution here: if you run scripts, then you have to think through every situation that your script could be run in. Just a quick brainstorm comes up with the following situations that you don't seem to be thinking of:
1) What if your installer is used via Apple Remote Desktop when no-one is logged in?
2) What if someone is trying to use your installer and is targeting another volume?
3) Are you absolutely sure that there is only one user who is going to use your application on a given computer? Remember, while most computers have only a single user, those in computer labs can have hundreds of users. And computers in large organizations often have people who install software for end users (and can be logged in with their own accounts when doing so).
4) Are you going to take care of all the myriad of situations that you are going to have to deal with like the ~/Applications folder being chmod'ed so you can't install there? Or there being a file at ~/Applications, or an alias (different than a symlink)? Or the user has their computer set to non-english... or... or...
My point here is that the moment you start introducing scripts into the install process you are opening a huge can of worms. Despite being someone who earns his living writing scripts, I am only a fan of them when you can be reasonably certain about the environment you are running on, and installers (other than ones written for in-house use) are things that go out into the wild.
If your .app can go into the users home directory, then I don't think you should be using an installer to distribute it. A .dmg is the better way of going. Not perfect, but better.
[1] I don't know if ~/Applications uses the .localized system, and if so then from the command-line you might have to set this up.
--
Karl Kuehn
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