Re: How to get installer path from plugin
site_archiver@lists.apple.com Delivered-To: installer-dev@lists.apple.com 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 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.
That works! Thanks for your help. _______________________________________________ Do not post admin requests to the list. They will be ignored. Installer-dev mailing list (Installer-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/installer-dev/site_archiver%40lists.a... - (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)]]; : : } http://lists.apple.com/archives/Installer-dev/2008/Nov/msg00016.html This email sent to site_archiver@lists.apple.com
participants (1)
-
Wrekso Wibowo