Re: How to get installer path from plugin
Re: How to get installer path from plugin
- Subject: Re: How to get installer path from plugin
- From: Iceberg-Dev <email@hidden>
- Date: Fri, 24 Apr 2009 10:36:19 +0200
On Apr 24, 2009, at 4:09 AM, Wrekso Wibowo wrote:
Hi,
I'm trying to get the .pkg installer's path from Installer Plugin.
Let's say my plugin is called Register.bundle and it is kept within
MyInstaller.pkg/Contents/Plugins/. I also have a file that I need
access to from the plugin and postinstal. The file is stored in
MyInstaller.pkg/Contents/Resources/MyFile
From my installer plugin code, I can do
- (void)willEnterPane:(InstallerSectionDirection)dir
{
:
:
NSBundle * registerPaneBundle = [[self section] bundle];
NSString * registerBundlePath = [registerPaneBundle bundlePath];
NSRange range = [bundlePath rangeOfString:@"Plugins/
Registration.bundle"];
if (range.location != NSNotFound)
{
NSString * myfilePath = [NSString stringWithFormat:@"%@Resources/
MyFile",
[registerBundlePath substringWithRange:NSMakeRange(0,
range.location)]];
:
:
}
registerBundlePath should be set to /Users/wwibowo/
MyInstaller.pkg/Contents/Plugins/Register.bundle, and
myFilePath should be set to /Users/wwibowo/MyInstaller.pkg/
Contents/Resources/MyFile
This is all good if the installer is located on local drive (boot
volume or partition). However if I have the installer on a mounted
disk image or on USB key, the installer bundle seems to be moved
out of the .pkg file. What I am getting instead is
registerBundlePath = /tmp/com.apple.installerulrZkLhr/
Register.bundle
range = {NSNotFound, 0}
I know PACKAGE_PATH holds the path to the package, unfortunately it
is only available in postinstall. Is there another environment
variable, or a way to get the package's path from plugin and
postinstall? I wonder if installing from network drive or read-only
media (CD, DVD) produce different behavior with regards to the
plugin being detached from the installer, and if so, how would I
know the installer's path.
http://lists.apple.com/archives/Installer-dev/2008/Nov/msg00016.html
_______________________________________________
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