Hi,
I have created a sample "MyApp.app" and I am creating the Installer for it.
Case 1: Creating Installer.pkg [myapp folder contains MyApp.pkg]
$pkgbuild --analyze --root myapp myApp.plist
$pkgbuild --root myapp --component-plist myApp.plist --identifier "com.mycompany.myapp.pkg" --install-location "/Applications/" MyApp.pkg
$productbuild --synthesize --package MyApp.pkg Distribution.xml
$productbuild --distribution Distribution.xml --package-path . Installer.pkg
If I install Installer.pkg, I get following in the /var/log/install.log
Dec 9 20:11:33 RAJEKUMAR-MBP.local Installer[22102]: InstallerStatusNotifications plugin loaded
Dec 9 20:11:34 RAJEKUMAR-MBP.local Installer[22102]: ================================================================================
Dec 9 20:11:34 RAJEKUMAR-MBP.local Installer[22102]: User picked Standard Install
Dec 9 20:11:34 RAJEKUMAR-MBP.local Installer[22102]: Choices selected for installation:
Dec 9 20:11:34 RAJEKUMAR-MBP.local Installer[22102]: Upgrade: ""
Dec 9 20:11:34 RAJEKUMAR-MBP.local Installer[22102]: Upgrade: "(null)"
Dec 9 20:11:34 RAJEKUMAR-MBP.local Installer[22102]: Installer.pkg#MyApp.pkg : com.mycompany.myapp.pkg : 0
Dec 9 20:11:34 RAJEKUMAR-MBP.local Installer[22102]: ================================================================================
Dec 9 20:11:40 RAJEKUMAR-MBP.local installd[557]: PackageKit: ----- Begin install -----
Dec 9 20:11:40 RAJEKUMAR-MBP.local installd[557]: PackageKit: request=PKInstallRequest <1 packages, destination=/>
Dec 9 20:11:40 RAJEKUMAR-MBP.local installd[557]: PackageKit: packages=(
"PKLeopardPackage <file://localhost/Users/rajekumar/Library/Developer/Xcode/DerivedData/MyApp-excgqrqzmxujpyfruiyzersgsjlq/Build/Products/Debug/Installer.pkg#MyApp.pkg>"
)
Full Log :
http://pastebin.com/ZhxhdzSTCase 2: Creating Installer.mpkg [myapp folder contains MyApp.pkg]
$pkgbuild --analyze --root myapp myApp.plist
$pkgbuild --root myapp --component-plist myApp.plist --identifier "com.mycompany.myapp.pkg" --install-location "/Applications/" MyApp.pkg
$productbuild --synthesize --package MyApp.pkg Distribution.xml
$productbuild --distribution Distribution.xml --package-path . Installer.mpkg
If I install Installer.mpkg , I get following in the /var/log/install.log
Dec 9 20:15:44 RAJEKUMAR-MBP.local Installer[22132]: InstallerStatusNotifications plugin loaded
Dec 9 20:15:45 RAJEKUMAR-MBP.local Installer[22132]: ================================================================================
Dec 9 20:15:45 RAJEKUMAR-MBP.local Installer[22132]: User picked Standard Install
Dec 9 20:15:45 RAJEKUMAR-MBP.local Installer[22132]: Choices selected for installation:
Dec 9 20:15:45 RAJEKUMAR-MBP.local Installer[22132]: Upgrade: ""
Dec 9 20:15:45 RAJEKUMAR-MBP.local Installer[22132]: Upgrade: "(null)"
Dec 9 20:15:45 RAJEKUMAR-MBP.local Installer[22132]: Installer.mpkg#MyApp.pkg : com.mycompany.myapp.pkg : 0
Dec 9 20:15:45 RAJEKUMAR-MBP.local Installer[22132]: ================================================================================
Dec 9 20:15:50 RAJEKUMAR-MBP.local installd[557]: PackageKit: ----- Begin install -----
Dec 9 20:15:50 RAJEKUMAR-MBP.local installd[557]: PackageKit: request=PKInstallRequest <2 packages, destination=/>
Dec 9 20:15:50 RAJEKUMAR-MBP.local installd[557]: PackageKit: packages=(
"PKLeopardPackage <file://localhost/Users/rajekumar/Library/Developer/Xcode/DerivedData/MyApp-excgqrqzmxujpyfruiyzersgsjlq/Build/Products/Debug/Installer.mpkg#MyApp.pkg>",
"PKLeopardPackage <file://localhost/Users/rajekumar/Library/Developer/Xcode/DerivedData/MyApp-excgqrqzmxujpyfruiyzersgsjlq/Build/Products/Debug/Installer.mpkg#MyApp.pkg>"
)
Full Log :
http://pastebin.com/isNBNW6HAs you can see when I am installing the Installer.mpkg the MyApp.pkg is getting installed twice. If there are some pre/post install script associated to it , then they are also executing twice. [In this run I have removed the scripts to keep things simple]
I am not able to understand this behavior .
Any help would be appreciated.
Rajeev