Installing in BIN folder...

martinatkinson

Registered
Hello!

I would like to create an installer that would copy a file into a users "bin" folder. How would I do this? When I tried installing it manually I had to change ownership of bin and then copy it. I do not want my users to have to go thru this.

Thanks!

Albert
 
You'll need to have the user authenticate as an admin user (u might need root to edit /bin, but I don't remember off hand).

HTH,
F-bacher
 
You're trying to install into ~/bin, right? Not /bin? Most users don't have ~/bin, so you'll have to create it first. Check out Cocoa's NSPipe call or maybe the tutorial on wrapping Unix commands at http://www.cocoadevcentral.com.

If you're trying to install into /bin, may I recommend that you install into /usr/local/bin instead? /bin is for things that are totally essential to the operating system, /usr/bin is for things that aren't essential, but are installed with the operating system. /usr/local/bin is for things installed by 3rd parties.

I think...
 
Hello!

Pretty much all I would need to do is have the terminal set the owner information and the sharing information and then make the folder visible. Then it would copy my file into the folder. If someone could post the actuall terminal code for this I would greatly appreciate it.

Thanks!

Albert
 
doesn't /Developer/Applications/Packagemaker do everything you could ask for? why re-invent the wheel?

or do you want to do anything it can't do?
 
you seem to have forgotten to check the "requires authentication" checkbox. unless you use pacifist, there's no way you can do this with apple's installer because unless you checked that option, it won't show you the padlock during the installation.

no installation into /bin without authentication.
 
looks good, it tells me the version and the switches available.

is this a new version? what's changed?

makes life for people without office (like me) a lot easier... :)

oh, just a cosmetic thing, but now you got a ".DS_Store" in the pkg...

i always use pacifist to look at pkgs before installing them, you never know...
 
Hello!

Whew, finally got that step out of the way. Now I can move on to more important things in my app.

Thank you so much for all your help and thanks to the rest of you as well!

Albert
 
Hello!

Just thought I would point out something interesting. Now I know most of you Unix GURU's are all rolling your eyes that I just now found this out. But, I am hoping that some newbie might benifit from this.

Before now, I thought that in order to run a script (say antiword) from the terminal I would have to install the script in the BIN folder and then run it by typing "antiword" in the terminal.

I found out that this is (thankfully) not true. For example, I can keep my antiword program anywhere I want and run it by just typing "path/to/antiword" in the terminal and it will run it.

Now I no longer need to change the permissions and visibility of the BIN folder using ROOT (which in my experience is very scary as I can mess up something with a simple misspelling) access.

You can also just drag the antiword script on top of a visible terminal window and it will enter the path for you!

Have a great day!

Albert
 
the nicest thing you can do is this:

put the script into you application bundle and run it there. people can move your app around, even to another machine and it'll still work.

that's how i did the regular expression search in locator -- very nice mechanisms!
 
Back
Top