Install a 3rd party framework using AppleScript from a package

813 Views Asked by At

My application depends on another third-party framework and I need to make sure the framework is installed before my application runs. I am using AppleScript to check whether the framework is installed or not. I am packaging my application using PackageMaker.

How do I package the other framework's pkg file in my PackageMaker project and run my AppleScript if the package is not already installed?

Thanks

Note: the pkg file along with adding the framework adds some other stuff to the Applications folder too. So I need to run the pkg file rather than just get the framework in my app's resources

1

There are 1 best solutions below

2
On BEST ANSWER

Don't try installing the framework in the system - it's better to keep a copy in your application bundle.

To use the 3rd party framework, drag in Xcode -> Frameworks -> Linked Frameworks.

Then create a "Copy Files" phase under the targets to have your 3rd party framework copied onto Contents/Frameworks within your application bundle.

For more details and a step-by-step example, check out Sparkle framework's documentation