Re: Getting real file path from installer plugin or script
Re: Getting real file path from installer plugin or script
- Subject: Re: Getting real file path from installer plugin or script
- From: Adam Peck <email@hidden>
- Date: Wed, 5 Nov 2008 08:34:39 -0700
- Thread-topic: Getting real file path from installer plugin or script
In a script you can use
DIR=`dirname $0`
This can be called from a distribution script or from a post/pre script. It
will most likely get you the Contents/Resources directory but at least you
are in the package and can use that to get where you want.
On 04/11/08 4:36 PM, "Iceberg-Dev" <email@hidden> wrote:
>
> On Nov 4, 2008, at 6:33 PM, Neal Sidhwaney wrote:
>
>> I was never able to figure this out, unfortunately. If your plugin
>> happens to run after preinstall, the preinstall script is passed
>> some vars indicating where the original package is, and you can
>> forward that to the plugin.
>
>
> Use at your own risk.
>
> ---------------------------------
>
> #import <Cocoa/Cocoa.h>
> #import <InstallerPlugins/InstallerPlugins.h>
>
> @interface HowToMakeAnAppleEngineerScream : InstallerPane
> {
> }
>
> @end
>
> #import "HowToMakeAnAppleEngineerScream.h"
>
> @interface PageController : NSObject
> {
> }
>
> - (id)distribution;
>
> @end
>
> @interface IFDocument : NSObject
> {
> }
>
> - (id)path;
>
> @end
>
>
> @implementation HowToMakeAnAppleEngineerScream
>
> - (NSString *)title
> {
> return [[NSBundle bundleForClass:[self class]]
> localizedStringForKey:@"PaneTitle" value:nil table:nil];
> }
>
> - (void) didEnterPane:(InstallerSectionDirection) inDirection
> {
> NSWindow * tWindow;
> PageController * tPageController;
>
> tWindow=[NSApp keyWindow]; // This should be improved IMHO
>
> tPageController=(PageController *) [tWindow delegate];
>
> if (tPageController!=nil)
> {
> NSLog(@"This is the package path: %@",[[tPageController
> distribution] path]);
> }
> }
>
> @end
>
> ---------------------------------
>
>
> _______________________________________________
> 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
>
_______________________________________________
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