Re: How can I get path to install package from distribution script?
Re: How can I get path to install package from distribution script?
- Subject: Re: How can I get path to install package from distribution script?
- From: Yun Zhi Lin <email@hidden>
- Date: Wed, 19 Sep 2007 17:52:20 +0800
Hi Jack
Thanks.It works with my mpkg.
But I am a little confused. During installation, I thought the scripts are copied to a tmp dir and run there.It is strange that we can get the path to the original script. Is my understanding wrong?
Jack Repenning ---2007-09-19 04:39:19---On Sep 18, 2007, at 3:01 AM, Yun Zhi Lin wrote: > Hi all
From: |
Jack Repenning <email@hidden> |
To: |
Yun Zhi Lin/China/IBM@IBMCN |
Cc: |
email@hidden |
Date: |
2007-09-19 04:39 |
Subject: |
Re: How can I get path to install package from distribution script? |
On Sep 18, 2007, at 3:01 AM, Yun Zhi Lin wrote:
Hi all
Currently I have one distribution package and I do installation check in distribution script.
The structure of my install disk image is like:
<root of disk>
dist.mpkg
install.configuration
During installation, I need to read the install.configuration file and do some configuration jobs based on the content of this file. If the file is missing, I would like to stop the installation and give users some information about the error.
I try to check the existence of install.configuration in installation check. But unfortunately,I could not get the path to install package from distribution script.I search developer.apple.com but could not find answer. Does anyone know how to do this? Is there any other possible ways to solve my problem?
Your install.configuration file may be found based on the path to your executing InstallationCheck script. If it's in bash, for example, your installation.configuration file is in
"${0% /*}/../../../installation.configuration"
where
- ${0} is the full path to your script
- ${0%/*} means "everything in $0 but the last / and anything that comes after that", which is to say the directory where your script lives, which of course is .../dist.mpkg/Contents/Resources/.
- ../../../ gets you to the directory that contains dist.mpkg
I may not have that exactly right -- I checked on a simple pkg, not an mpkg -- but you can explore the layout of your mpkg and fix up the ../../ part appropriately.
To figure this out, I added this line to my own InstallationCheck script:
echo > /tmp/InstallationCheck.log PWD="$PWD" 0="$0" PKG="$PKG" DEST="$DEST" MOUNT="$MOUNT" ROOT="$ROOT"
-==-
Jack Repenning
email@hidden
Project Owner
SCPlugin
http://scplugin.tigris.org
"Subversion for the rest of OS X"
_______________________________________________
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