How do you make a program run when any user logs in?

I have an application which will need to run when any users logs in.
Such that Joe downloads and installs the application, logs out, then Sally logs in and the application runs for Sally.
Does anyone know how to do this?

Hey Steve, thanks for that link. It seems to be what
I am looking for. What is the meaning of the
~/Library vs /Library ? They are definitely
different folders.
Yes, they are definitely different folders. The "~" character represents the current users home folder, so "~/Library" represents the Library folder that's located inside a users home folder. Anything placed in there will only affect the one user whose home folder you've accessed.
The "/Library" folder is the Library folder that exists at to root of the boot volume. Things placed in this Library folder will affect all users of the system. Basically it's sort of a "global" Library.
Also, from a script, how do I add an item to execute
for that kind of PList?
That could be tricky based on the structure of that particular plist file. I haven't really looked at it closely but one place you could start is to read the "man" page for the "defaults" command... enter "man defaults" in Terminal. The "defaults" command allows you to read/write plist files, but defaults is not very good at accessing deeply nested plist items.
Related to that, how do I tell if the logging item
for my App is already there? I do not want to keep
adding to the list if it is there. If someone
deletes my app and then reinstalls it, I do not want
it to run twice, three times, etc..
Again, you could possibly read the plist using the defaults command and determine whether your item was already present or not.
Do you know of the one in the ~/Library path, what
user it execute as? Since it is all users, it
probably is root or something like that.
No, the one in ~/Library is in each individual user home folder. It will execute with the current user's privileges. This is where Login Items normally go when you go through the GUI... "Sys.Prefs -> Accounts -> Login Items" and add a login item for one user.
Even items placed in /Library, which should execute for all users, will execute with the current user's privileges.
In the near
future we might need root privileges, so I might need
a program to startup for all users as root instead of
the user.
Is your app, that needs to run at login time, a GUI application or is it a faceless shell script (or something similar). Your original post gave me the impression that you needed to launch a GUI application. However, if it's a shell script then you probably want to look at doing a LoginHook instead of using the Login Items procedure at the web page I posted earlier. I believe a LoginHook will also give you the ability to run the script as root.
Check out this link at the ADC website.
or
Take a look at this information and this utility at Mike Bombich's website.
Steve

Similar Messages

  • How do you make to program the radio station on my remote contol ?

    how do you make to program the radio station on my remote contol ?

    Programming the radio stations (in hifi-mode) is explained in the "getting started" manual. Be aware of the fact that when you unplug the power cable all memory settings are lost.
    JaDi.

  • How do you make Motion templates availabe for all users for FCPX?

    How do you make Motion templates availabe for all users for FCPX?

    Copy your Motion Templates folder that is in your Movies folder to the movies folder of your other users.

  • How do you make the program repeat itself?

    How would I make it so that when the if statement at the end of the code the program starts over from the begining?
    Any help appreciated. Here is the code if you wanna see it.
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    class SuperTester{
         public static void main ( String[] args ){
         // Create array that will hold deck
         Deck[] decko = new Deck[52];     
         // Fill the array with a deck
         decko = Deck.makeDeck();
         // Print new deck
         System.out.println( "PRINT NEW DECK" );
         System.out.println( "" );
         Deck.printDeck( decko );
         // Shuffle the deck ( simulated riffle shuffling )!
         decko = Deck.shuffleDeck( decko );
         // Print the shuffled deck
         System.out.println( "" );
         System.out.println( "PRINT SHUFFLED DECK" );
         System.out.println( "" );
         Deck.printDeck( decko );
         // Print first 5
         System.out.println( "" );
         System.out.println( "PRINT TOP 5" );
         System.out.println( "" );
         Deck.printFirstFive( decko );
         // Print single card
         System.out.println( "" );
         System.out.println( "PRINT SINGLE CARD" );
         System.out.println( "" );
         Deck.printCard ( decko [2] );
         System.out.println( "" );     
         BufferedReader in = new BufferedReader( new InputStreamReader (System.in));
         int input;
         System.out.println( " Do you want to re-run program? " );
         System.out.println( " Push 1 for yes " );
         System.out.println( " Push 2 for no " );
         System.out.println( "" );
    try
         input = Integer.parseInt( in.readLine() );
    catch( Exception e ){
    if ( input == 1 ){
    //WHAT DO I PUT HERE TO MAKE THE PROGRAM REPEAT ITSELF?
         } // end method
    } // end class

    So i should just do something like?
    int x = 0;
    while (x == 0){
    //code
    if (inpu == 1) {
        x == 0;
    }else{ x == 1; }                                                                                                                                                                                                                                                       

  • How can I make my program Run forever?

    I would like to know how can I make my program execute some method while the GUI still open. I have something like this.
      public static void main(String args[]) {
        System.out.println("****************************");
        System.out.println("    PACKET READER CONSOLE   ");
        System.out.println("****************************");
        IPDetector window = new IPDetector(); // IPDetector is the JFrame
        window.setTitle("IPDetector Analyzer");
        window.pack();
        window.show();
        PortListener pl = new PortListener();// Is my portlistener class
        PacketReader c = new PacketReader();
        while(JFrame still open){// I dont know how to put a statemente here
          pl.start();// this method reads from a port and returns a string
          String cc = pl.data;// gets the string from the port listener
          while(!cc.equals("")){
            c.portWriter(cc);// writes the string into a file
      }I want that my portlistener keeps reading all the time, and if is something in the socket information.
    Should I use a thread? Any ideas? thanks.
    Chris

    I still not understanding how to make it thread. My main class is this one IPDetector. and it looks like this.
    public class IPDetector extends JFrame {
      // Declaration of the instance variables
      private static ArrayofDisplay  ad = new ArrayofDisplay();
      private ArrayofCreators database = new ArrayofCreators();
      JLabel sourceLabel;//etc..
      public IPDetector() {
        IPDetectorLayout customLayout = new IPDetectorLayout();
        getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
        getContentPane().setLayout(customLayout);
        sourceLabel = new JLabel("Source IP Add.");
        getContentPane().add(sourceLabel); 
        addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            System.exit(0);
      // I get confused here...
      private boolean alive; // Do I need to declared here?
      public void setAlive(boolean val) { // This one also?
        alive = val;
      // IPDetector Methods...
      public void displayCaller(ArrayofDisplay aD){  }
      public void setAndReplace(String text)  {    }
      public void refresh(){ }
      public boolean action(Event evt, Object arg){ }
      //etc...
      public static void main(String args[]) {
        System.out.println("***********************************************");
        IPDetector window = new IPDetector();
        window.setTitle("IPDetector");
        window.pack();
        window.show();
        PortListener pl = new PortListener();
        PacketReader c = new PacketReader();
        while (alive) {// Is this correct here?
          pl.start();
          String cc = pl.data;
          while(!cc.equals("")){
            c.portWriter(cc);
            window.refresh();
            cc = "";
    class IPDetectorLayout implements LayoutManager {
      public IPDetectorLayout() {  }
      public void addLayoutComponent(String name, Component comp) {  }
      public void layoutContainer(Container parent) {  }
    }

  • How to undo the automatically start program to when a user logs on

    I have followed this following directions (http://technet.microsoft.com/en-us/library/cc736643%28v=ws.10%29.aspx#BKMK_TSC) :
    "Using Terminal Services Configuration
    Open Terminal Services Configuration.
    In the console tree, click Connections.
    In the details pane, right-click the connection for which you want to specify an initial program, and then click
    Properties.
    On the Environment tab, under Initial program, select
    Start the following program when the user logs on. This option allows you to configure an initial program for the connection.
    If you select Do not allow an initial program to be launched. Always show desktop, then Terminal Services cannot start a specified initial program automatically when a client connects to a terminal server. Instead, the user must start programs
    by using the default desktop that is displayed during the Terminal Services session.
    If you select Run initial program specified by user profile and Remote Desktop Connection or Terminal Services client, then the program that is specified in the default user profile and in Remote Desktop Connection or the Terminal Services
    client will run when the client connects to the terminal server.
    If you selected Start the following program when the user logs on, in
    Program path and file name, type the path and file name of the program that you want to start when the user logs on to the terminal server.
    In Start in, type the working directory path for the program, and then click
    OK."
    the problem is that now all of the server users get the specific program automatically starts when logged on and i cant undo it because i cant get to the desktop or to the "tscc.msc"
    is there a way to fix it?

    Hi,
    Thanks for posting in Windows Server Forum.
    As this thread has been quiet for a while, we assume that the issue has been resolved. At this time, we will mark it as ‘Answered’ as the previous steps should be helpful for many similar scenarios. If the issue still persists, please feel free to  reply
    this post directly so we will be notified to follow it up. 
    BTW,  we’d love to hear your feedback about the solution. By sharing your experience you can help other community members facing similar problems. 
    Thanks for your Support & understanding.
    Regards.
    Dharmesh Solanki
    TechNet Community Support

  • How do you make a .java run on a desktop

    I'm fairly new to java, only 2 semesters worth, and I did a final project this past semester that tied into our tutoring lab at school. Although I completed it for the class, it needs more for the lab.
    I need to know what I need to do so that the lab can just run the program from the desktop and not have to run the compiler each time. I'll be dealing with non-computer people. I'm still developing the GUI and need to add time stamps and a couple of other things that I'm relaying on books for, but I'm looking now for this answer in case I have to redue a lot of stuff.
    Like I said, I'm new to java and have been told that I can't just make the program a .exe. I also understand that all java needs to run is the language installed on the machine. So anyone know how I can do this?
    Thanks

    hi,
    Can NetBeans package into a jar file for
    me? If not what do I use? I dont know for sure, but IDE's normally provide this feature.
    I know it will be running on a Win, at least 2k, machine, but I would rather do
    the first method you suggested
    grins good decision, especially since urs is an academic project.....BUT, if u ever (in the future), go for a java-based project that u wud want to distribute, then remember that the "users" of ur project wud hv to have JRE installed for this, something which ppl dont always like.
    is the JRE available for download on the Sun website? Do I just install
    it like I did to set up NetBeans on my machine and
    the program will call it when run?Since u already have JDK installed, there is no need for additionally installing JRE. but if u want to run this application on some other system where JDK is not installed (and neither required ;), then u have to download and install JRE from Sun's download site.
    it is pretty straightforward to install the JRE. make sure that u hv the correct version of JRE, for example, if u developed ur project using JDK1.5, then download JRE1.5
    ======
    Kiran

  • How Do You Make OS X Run Strictly Only 64-bit?

    Hi. I've set OS X to run on 64-bit on boot (editing the plist. Apple should have a control panel for 32 and 64-bit mode. I hope Lion will have those) but how is it running a 32-bit of Flash on Safari? I thought on this mode it strictly runs only 64-bit programs? So if you're using 32-bit mode, that's really the same as when you're on 64-bit mode coz' on 32-bit mode it'll still use 64-bit apps when it's available (or 64-bit programs won't run when you're on 32-bit mode?).
    Is Safari 5 64-bit by the way? There's a preview of the 64-bit Flash player which might be good to try on a 64-bit OS and Safari. Thank you in advance.
    Gbu.

    Do not confuse user mode application programs with the kernel and device drivers. This is NOT Windows, and does NOT have the limitations that Windows has.
    The 32-bit Mac OS X kernel can run both 32 and 64 bit applications. Just launch Applications -> Utilities -> Activity Monitor and the "Kind" column will show you that with the 32-bit kernel you are currently running tons of 64-bit programs.
    Today, the only reasons for booting a 64-bit kernel are:
    o You are a developer writing a 64-bit device driver
    o You need to use a special limited edition 64-bit device driver and have no choice
    o You have one of the newest Mac Pros or Xserver boxes and have put more than 32GB of RAM in the box
    o You would like to blaze a 64-bit trail testing all the beta 64-bit device drivers so the above mentioned developers get some real world field testing.
    Otherwise, the 32-bit kernel gives you all the benefits, and none of the hassles.
    Apple released a 64-bit capable operating system that by default boots into a 32-bit kernel so that developers had a nice long period of time to develop and test their 64-bit drivers and applications. I suspect that 10.7 may default boot 64-bit kernels on Macs that are 64-bit kernel capable (ie. they have 64-bit CPUs and have 64-bit firmware), but that is only a guess.
    And with respect to a 64-bit kernel running 32-bit apps, yea, Apple can do that too, so again you do not need to get new apps just because you are booting a 64-bit kernel.
    Message was edited by: BobHarris

  • How can I make a program run in the background?

    I'm working on a custom console program. I plan to have the commands as seperate applications and create a server/client relationship so they can communicate with each other. However whenever I call a command I don't want to have a console window pop up, flicker out, etc. I want it to look like it's one complete app. So I'm wondering how can I have the app run in the background?

    If you're using a unix system, use the "&" argument (or character, what is its name anyway?) at the end of the command line.
    I think you can use javaw in the MS-Windows world.

  • How do you shut off programs running in the background

    The programs you use keep running. You used to be able to totally close them. How do you now?  I hate ISO7!

    Tap the HOME button twice and then swipe up to delete each one. 
    I was sooooo frustrated until i learned this.

  • How do you make the program start?

    I have installed PSE 11 twice, now; the second time after an uninstallation of the first installation.  Both times, the program started immediately FROM the installation.  After exiting from the program, I have not been able to restart the program.  I click on it; I double click on it (which should start 2 copies of the program!); I right click and click Open; I right click and click "open as administrator".  Absolutely NOTHING happens.  Is there some sort of glitch that means you have to leave the program open permanently?  Please, how do I open the program? 
    Thank you.
    Cherie Brumfield

    Thanks so much for responding.  As it happens, I had already tried that
    approach, with no results.  I also spent some time last evening with a tech
    on the Adobe Chat page, also with no results.  So I just reloaded my PSE 8
    program, which does still work!  And this morning I get a notice of an
    Adobe update to PSE 11 and, guess what?!--NOW PSE 11 works just fine!!  Go
    figure!
    All of which has nothing to do with you having responded to my plea for
    help.  I really appreciate someone responding; it's nice to know that
    people "out there" really do care.  Thank you.
    Cherie
    On Wed, Feb 6, 2013 at 4:55 AM, bridge_mastero

  • I am new to Mac.  How do you make an app available to all users so you only have to go through set up once?

    I am new to Mac.  How do you share an app with all users so you only have to install once?

    You only have to install applications once, after which are available to all users on your Mac.  But each user account will have its own individual preferences to set and may have some initialization to do the first time the application runs in each account.
    Also, most applications that require entry of a license code accept the code once and apply it to all user accounts on your Mac.  But there are some exceptions, some applications, that don't seem to do this (or don't do it well)  and you may have to enter your license code in each user account the first time you run those applications in each account.  For example, iTunes will ask you to accept the license the first time you run it in each user account.

  • How can I make a JButton enabled when the user types smthg in a JTextField?

    Hello,
    I have a JButton and a JTextField on a frame. The JButton is disabled, myButton.setEnabled(false).
    How can I enable the button when the user types something in the text field? Just typing, not pressing enter.
    Thank you

    There isn't one, actually. What you need is a DocumentListener and you have to associate it with the document object associated with the field i.e.
    field2.getDocument().addDocumentListener() (new DocumentListener() {
    });

  • How can I make my program run faster ? (changing colour indicators quicker)

    Hi everyone, I have a program with 100 indicator colour backgrounds that change according to 100 temperatures. A case structure (with 100 cases) sets the background colours one after the other and runs in a while loop with no timing (as fast as possible). The temperatures are loaded up from an array that is initialized at the beginning of the program. The idea is to have an overall view of the change of temperatures (just by looking at the change of colours). Everything works fine except that it doesn’t run fast enough... The change of colours is not smooth at all ... you can really see the increments. It works fine with 20 temperatures for instance. 1) Would anybody have a solution to improve this? I was wondering if Labview perhaps actualises all of the values each time one changes (just like with the excel cells: an option that you can desactivate and make things run quicker when you use a macro) which would make a big loss of time....  
    There is no data saving this is just a post treatment program. So My my program isn't doing anything else.
     2) I have attached a screen print of a problem a faced when making up the VI I attached. Why can’t I wire directly to the Index Array that is in the For Loop in my VI… I had to go throw a shift register to make up the example. When going back to my original program I couldn’t use the index array a second time (screen shot). Thanks a lot for any help, Regards, User  
    Solved!
    Go to Solution.
    Attachments:
    Forum question.vi ‏13 KB
    forum.JPG ‏50 KB

    Here's a possible solution:
    Ton
    Message Edited by TCPlomp on 11-03-2010 11:16 AM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    Forum question.png ‏23 KB

  • How do you make the volume louder when you export music from garageband?

    Hey everytime I export my music from garageband the volume seems to die down.. Is there a way to fix this? Thank you

    There's two things that are being called "volume": one is the output level of your audio file. Go to GB's preferences and see if the auto-normalize function is checked - if yes, it will automatically adjust the master volume so the maximum level of your output file is 0 dB. If you uncheck it, you can crank up your volume more, but your audio might clip in some places.
    The other thing is loudness – audio files with the same peak level have a very different perceivable loudness. That is a question of mastering, i.e. applying compressors and limiters to make the sound more "dense". But that's a whole different story.

Maybe you are looking for