Re: How to change NSApplication name on the fly?
- From: Reinder Verlinde <reinder@xxxxxxxxxxxxxxxx>
- Date: Sat, 23 Jul 2005 12:27:37 +0200
In a discussion on on-the-fly changing of the application name shown in
the Apple menu ( "Glenn Reid" <gr@xxxxxxxxxxxxxx>,article
<1122057009.108014.70280@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>), Patrick
Machielse (in article <1h05h43.octyjh1bhf53mN%noreply@xxxxxxxxxxxx>)
gave a way to do just that by changing the plist file in 'main' before
calling 'NSApplicationMain'.
I replied:
> note that this will not work if the current user does not have
> write permissions on the property list file. This is reasonably common,
> for instance in a scenario where an administrator installs the
> application and a non-administrator runs it.
Patrick replied:
> True. But maybe the administrator could run it once, maybe to activate /
> register the copy. Assuming the OP needs only one brand on each
> deployment site and that the administrator's account provides enough
> information to determine the correct app name...
If one would go that route, the next step would be to have some way to
enforce that the administrator ran the application. In that case, an
installer would be the more logical route.
I also said:
> I also think that, if you nevertheless go this route, you would want to
> compare the current string with the one you are going to write there,
> and not write out the file if they match.
To which Patrick replied:
> Well, I did say 'quick and dirty', didn't I?
> [...]
> This is a 'proof of concept'; there _is_ a way to change the displayed
> name of an application at runtime. I didn't claim it was elegant or
> without hazard :-)
I understood that, but wanted to warn the original poster that this is
not the route to take.
I still do not understand why Glenn Reid has so much aversion to
distributing multiple applications. His original post said:
> We have an OEM application that needs to have a different name for each
> OEM and it's almost impossible to manufacture it with different names
> using XCode, and I can't find a way to rename the app at runtime
> either.
There are several solutions to this. The easiest (for his users) one is
to ship multiple versions of the application (this might also provide
other opportunities for adapting the application to different OEM's, for
instance by providing an URL to the OEM's site in the about box, putting
their logo in, or whatever)
This possibly also is easiest for the poster. Let us consider the
alternative of an application that magically changes the apple menu
title:
- Glenn Reid builds an app that knows about all his OEM customers.
- the application magically sets the name in the apple menu correctly
- Glenn Reid distributes a perfect version 1.0 of this app to his
clients.
At this stage, all is fine. Suppose that, some time later, Glenn Reid
gets a new customer. What does he do? Release a new variant of version
1.0 that also knows about this client, or release version 1.01 just for
this simple update? If he does the former, he has two different versions
1.0 out there. If he does the latter, he will find that existing users
start hitting his web servers to download the 'new' version 1.01.
Reinder
.
- Follow-Ups:
- Re: How to change NSApplication name on the fly?
- From: Glenn Reid
- Re: How to change NSApplication name on the fly?
- From: Patrick Machielse
- Re: How to change NSApplication name on the fly?
- References:
- How to change NSApplication name on the fly?
- From: Glenn Reid
- Re: How to change NSApplication name on the fly?
- From: Michael Ash
- Re: How to change NSApplication name on the fly?
- From: Glenn Reid
- Re: How to change NSApplication name on the fly?
- From: Patrick Machielse
- Re: How to change NSApplication name on the fly?
- From: Patrick Machielse
- Re: How to change NSApplication name on the fly?
- From: Glenn Reid
- Re: How to change NSApplication name on the fly?
- From: Patrick Machielse
- Re: How to change NSApplication name on the fly?
- From: Reinder Verlinde
- Re: How to change NSApplication name on the fly?
- From: Patrick Machielse
- How to change NSApplication name on the fly?
- Prev by Date: Re: How to change NSApplication name on the fly?
- Next by Date: Re: How to change NSApplication name on the fly?
- Previous by thread: Re: How to change NSApplication name on the fly?
- Next by thread: Re: How to change NSApplication name on the fly?
- Index(es):
Relevant Pages
|
Loading