Re: Need to do some logic in a component pkg which is specific to the integrated distribution pkg
Re: Need to do some logic in a component pkg which is specific to the integrated distribution pkg
- Subject: Re: Need to do some logic in a component pkg which is specific to the integrated distribution pkg
- From: Xochitl Lunde <email@hidden>
- Date: Wed, 17 Mar 2010 15:47:06 -0500
<installer-dev-bounces+xochitl_lunde=email@hidden>
wrote on 03/17/2010 05:38:52 AM:
> Hi All,
>
> I am developing a component pkg and the same component package will
> be delivered to many other products teams. All products will
> integrate this component package and create their own distribution
> product package.
>
> Here in component pkg i need to identify in which distribution
> package it is running and do some logic some thing like creating a
> file based on the distribution package. This logic should be inside
> my component package's preinstall and postinstall.
>
> Can this be done ?
>
> I am thinking that if Product distribution package, which is
> integrating my component package can set some environment variables
> such that the component pacakge's preinstall and post install can
avail.
>
> Thanks And Regards,
> -Sra1.
While I do not know the exact answer, I think I know
a way that you can figure out a little more. When the scripts are
called from the installer, they will have certain environment variables
set, including things like the name of the package. I do not know
if it sets the name of a distribution in addition to this, but it might.
Using a verbose command line installation, you can see the environment
variables set in all of your scripts using the 'env' command in the script.
Then you can check if a distribution environment variable is set
for you.
So in your script just add a line: env
Then on the command line, run your distribution package
verbosely.
$> installer -verbose -dumplog -pkg path/to/yourdistpkg
-target /Volumes/YourMacHDName
The installer should then print out the result of
your script running the 'env' command. There's the environment variable
INSTALL_PKG_SESSION_ID, but that will probably have the name of your component.
If there's a distribution environment variable set, then you probably
can do this without problem.
_______________________________________________
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