Getting path to pkg
Getting path to pkg
- Subject: Getting path to pkg
- From: Lora Lozano via Installer-dev <email@hidden>
- Date: Thu, 1 Aug 2019 11:41:32 -0700
Hi,
In my plugin code, I’m leveraging the code in
https://lists.apple.com/archives/Installer-dev/2008/Nov/msg00017.html
<https://lists.apple.com/archives/Installer-dev/2008/Nov/msg00017.html> to get
the path to my installer pkg. This has been working for me for the past few
years on all the Mac OSes that have been released, but it’s not working for me
on Catalina. I tried this on the latest Catalina beta release (currently beta
5), but the NSWindow window, and thus its delegate, turns out to be null, which
then causes my installer to crash with [NSURL initFileURLWithPath:]: nil string
parameter when my code calls initFileURLWithPath.
As a test, I copied Apple's Installer application
(/System/Library/CoreServices/Installer.app) from my Mojave machine to my
Catalina machine and launched my installer on Catalina using that, and the
crash doesn't happen. The NSWindow and its delegate are not null.
Was there a change to the Catalina Installer.app that requires me to update my
code?
Here’s the code from
https://lists.apple.com/archives/Installer-dev/2008/Nov/msg00017.html
<https://lists.apple.com/archives/Installer-dev/2008/Nov/msg00017.html> that my
code is based off of:
#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]);
}
}
Any help would be greatly appreciated. Thanks in advance.
-Lora
_______________________________________________
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