LSUIElement option on Panther

  • Jon,

    Once on the macos list you declared:

    > Yup - Panther appears to cache a lot of the LaunchServices information
    > about an app, even across logout/login.  I had an app that offered an
    > option to show its icon in the Dock or not, and had to change the way
    > I implemented that because I could no longer change the app's plist on
    > the fly (which was already on the bug list as a Bad Thing anyway).
    >
    > - Jon

    Could you give me some infos about your solution ? Because I have the
    same problem, and I don't know how to solve it.

    Luc.

    Luc Regnault
    Alwan Color Expertise
    Research & Development
    http://www.alwancolor.com/
    http://regnault.luc.free.fr/
  • On Mon, Nov 03, 2003 at 09:32:59PM +0100, Luc Regnault wrote:
    [snip]
    > Could you give me some infos about your solution ? Because I have the
    > same problem, and I don't know how to solve it.

    From SSHKeychain's codebase:

    /* Change the bundle's modification time to let LaunchServices know we've
    * changed something. */
    if(utime([[[NSBundle mainBundle] bundlePath] cString], NULL) == -1)
    {
    /* Apparantly, the user hasn't got write access to the application
        * bundle. */
    ...
    }

    As you can see, this trick will fail if the user hasn't got access to the
    application bundle.

    Cheers,

    Bart

    --
    Bart Matthaei                    <bart...>

    Correction does much, but encouragement does more.
                    -- Goethe
  • "touch" (update the modification time) of the main app bundle.

    // In 10.3 we have to touch the app bundle, or this won't work
    [[NSFileManager defaultManager] changeFileAttributes:[NSDictionary
    dictionaryWithObject:[NSDate date] forKey:NSFileModificationDate]
                                                  atPath:[[NSBundle
    mainBundle] bundlePath]];

    Karl

    On Nov 3, 2003, at 12:32 PM, Luc Regnault wrote:

    > Jon,
    >
    > Once on the macos list you declared:
    >
    >> Yup - Panther appears to cache a lot of the LaunchServices
    >> information about an app, even across logout/login.  I had an app
    >> that offered an option to show its icon in the Dock or not, and had
    >> to change the way I implemented that because I could no longer change
    >> the app's plist on the fly (which was already on the bug list as a
    >> Bad Thing anyway).
    >>
    >> - Jon
    >
    > Could you give me some infos about your solution ? Because I have the
    > same problem, and I don't know how to solve it.
    >
    > Luc.
    >
    > Luc Regnault
    > Alwan Color Expertise
    > Research & Development
    > http://www.alwancolor.com/
    > http://regnault.luc.free.fr/
    >
    > _______________________________________________
    > MacOSX-dev mailing list
    > <MacOSX-dev...>
    > http://www.omnigroup.com/mailman/listinfo/macosx-dev
    >
    >
    --

    Soon you will be ready for the dark side. Soon, you will take your
    place at my side as a light and airy piece of clothing. Soon, I will
    stop my repetitive sentence structure. Soon, God willing, I will get
    some sleep.

    Homepage:
          http://homepage.mac.com/khsu/index.html
  • Thank you. This tip works very well !...

    Luc.

    mardi 4 novembre 2003, à 12:50  am, Hsu a écrit :

    > "touch" (update the modification time) of the main app bundle.
    >
    > // In 10.3 we have to touch the app bundle, or this won't work
    > [[NSFileManager defaultManager] changeFileAttributes:[NSDictionary
    > dictionaryWithObject:[NSDate date] forKey:NSFileModificationDate]
    > atPath:[[NSBundle
    > mainBundle] bundlePath]];
    >
    > Karl
    >
  • At 12:49 PM +0100 11/5/03, Luc Regnault wrote:
    > Thank you. This tip works very well !...

    No it doesn't - as Bart pointed out, this will fail if the user
    doesn't have write-access to your app.  What I did is re-engineered
    my app to be a bundle (it's incredibly easy - you just have to take
    care of the fact that your nibs and resources are not loading from
    the main bundle) and then made two "shell" applications that load the
    same bundle.  One shell app has the LSUIElement flag set, and the
    other has it cleared.  I run the appropriate app depending upon the
    user's settings.

      - Jon
    --
    ________________________________________________________________________
            Jon Gotow                    <gotow...>
        St. Clair Software              http://www.stclairsoft.com/
        Fax (540)552-5898              ftp://ftp.stclairsoft.com/