Re: Environment variables available only from Cocoa apps
Re: Environment variables available only from Cocoa apps
- Subject: Re: Environment variables available only from Cocoa apps
- From: Wrekso Wibowo <email@hidden>
- Date: Wed, 22 Apr 2009 17:14:49 -0700
On 21-Apr-09, at 6:02 PM, Wrekso Wibowo wrote:
On 21-Apr-09, at 3:07 AM, Iceberg-Dev wrote:
On Apr 21, 2009, at 12:06 AM, Wrekso Wibowo wrote:
On 20-Apr-09, at 1:27 PM, Iceberg-Dev wrote:
On Apr 20, 2009, at 7:28 PM, Wrekso Wibowo wrote:
Hi all,
I have a postinstall executable as part of an installer. The
installer can be launched in one of three ways:
- manually (ie. user launching installer by double clicking)
- as part of custom installer built by Assistant-like app
- using Apple Remote Desktop
I'd like to distinguish how it was launched, and behave slightly
differently when the Installer is launched manually. As it
appears, the postinstall is separate process from the Installer
and I haven't found a way to indicate in the postinstall that
the Installer is launched manually by user (instead of via ARD).
I'm thinking perhaps there is an environment variable that is
available and can be checked only within Cocoa apps under Tiger
and up. Does anyone know if such thing exists? Any help is
appreciated. I am cross-posting to Cocoa-dev in the hope that
somebody may have a solution.
There is one:
COMMAND_LINE_INSTALL
It can also be accessed from JavaScript.
How and where can I access the above environment variable? I tried
using getenv() as well as [[NSProcessInfo processInfo]
environment] from command line tool and cocoa app respectively
without success. Ideally I would have some code in my postinstall
that should know how the installer is called.
If you're not able to retrieve it from your tool, you can retrieve
it from the postinstall script and pass it to the app or tool as an
argument.
For whatever reason, my postinstall doesn't see COMMAND_LINE_INSTALL
being defined. I guess I'll try to find another way. Thanks for your
help.
Thanks to everyone for the help. I am able to use the above env
variable, which is available when installer is being pushed by ARD
(originally I thought executing cmd line would have it defined by
default).
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden