My company provides an eclipse based development environment which needs some environment variables setting up for the underlying toolchain so multiple versions can be installed concurrently and not take over the system.
I want to provide an icon in finder or the dock which sets these then launches eclipse so customers cannot accidentally launch eclipse without the environment being set. This is what I have tried so far:
Setting environment in Info.plist for eclipse:
This should be a nice way to do it but I cannot make it add to the existing path (like export PATH=/myapp/bin:$PATH).
bash script wrapping eclipse:
I created a bash script called eclipse.command to set the environment then launch eclipse. This opens a terminal window as well as the eclipse icon and allows people to "Keep on dock" for the bare eclipse. I cannot put eclipse.command on the dock as it is not an application.
Applescript wrapping eclipse.command:
An Applescript wrapper around eclipse.command makes it look like an app and prevents the terminal window appearing. Unfortunately I now get a dock icon for the applescript and one for eclipse so can still keep the bare eclipse on the dock.
Any suggestions? Am I going about this in completely the wrong way?
See Question&Answers more detail:os