Re: How to change NSApplication name on the fly?



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
.



Relevant Pages

  • Re: How to change NSApplication name on the fly?
    ... > distributing multiple applications. ... >> We have an OEM application that needs to have a different name for each ... the app name only, I think it does complicate distribution. ... > - Glenn Reid builds an app that knows about all his OEM customers. ...
    (comp.sys.mac.programmer.help)
  • Re: CEditView app
    ... you have to route these yourself. ... int high; ... I'm trying to learn programming with MFC. ... I generated an app with Doc/View and made the ...
    (microsoft.public.vc.mfc)
  • Re: Question about DeLorme Street Atlas 2005
    ... If your using a database and want to import it into the app ... select records from it to route to all at once (no need to place individual ... better maps in most metro areas, but much worse maps in rural areas and off ... and the app will order them in a logical progression from the ...
    (sci.geo.satellite-nav)
  • Re: IP Routing
    ... Using command line apps isn't the easiest way to use a PocketPC, ... You could then build the route.exe app from the sources that are released ... >>> After the VPN connection is established, ... This default route will have a ...
    (microsoft.public.pocketpc.developer.networking)
  • Re: How to change NSApplication name on the fly?
    ... Glenn Reid wrote: ... > Thanks, Michael. ... > the app has already launched and read in the Info.plist. ... Prev by Date: ...
    (comp.sys.mac.programmer.help)

Loading