• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get installer path from plugin
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get installer path from plugin


  • Subject: Re: How to get installer path from plugin
  • From: Wrekso Wibowo <email@hidden>
  • Date: Fri, 24 Apr 2009 10:01:42 -0700


On 24-Apr-09, at 1:36 AM, Iceberg-Dev wrote:


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

That works! Thanks for your help.

_______________________________________________
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


  • Follow-Ups:
    • Modifying Strings on the Installing Dialog
      • From: "William Smith" <email@hidden>
References: 
 >How to get installer path from plugin (From: Wrekso Wibowo <email@hidden>)
 >Re: How to get installer path from plugin (From: Iceberg-Dev <email@hidden>)

  • Prev by Date: Re: "This package contains a program that determines..."
  • Next by Date: Modifying Strings on the Installing Dialog
  • Previous by thread: Re: How to get installer path from plugin
  • Next by thread: Modifying Strings on the Installing Dialog
  • Index(es):
    • Date
    • Thread