views:

268

answers:

1

Hi

I want to run a pkg file added as a component in my package based on certain conditions. How can I run the pkg file from AppleScript?

Thanks?

Edit: I am now able to run the pkg file using open pkgFile.pkg I want to embed this AppleScript as part of a package along with some other packages as the components of this pakage. Where do I mention this script so it is executed before the main application installation starts.

I tried adding the script as the preinstall script for the main app package but it gives an exception The following install step failed: run preupgrade script

Any tips? Thanks.

+2  A: 

I'm not an AppleScript programmer, so this is probably not the best way to do it, but this should work:

do shell script "open file.pkg"
Adam Rosenfield