• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Duplicate package installation when using productbuild
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Duplicate package installation when using productbuild


  • Subject: Re: Duplicate package installation when using productbuild
  • From: Tanguy RAHUEL <email@hidden>
  • Date: Wed, 21 Aug 2013 09:36:24 +0200

Hi,

Thanks for your quick answer.

Our project distribution file is looks like when passed on the product build command line :
<installer-gui-script minSpecVersion="1.0">
<!-- Localization for the installer title -->
<title>INSTALLER_TITLE</title>
<!-- background image -->
<background file="background.jpg" scaling="tofit" alignment="bottomleft"/>
<!-- File used to fill the introduction pane -->
<welcome file="Welcome.txt"/>
<!-- File used to fill the license pane -->
<license file="License.rtf"/>
<!-- File used to fill the final pane -->
<!-- <conclusion file="Conclusion.rtf"/> -->
<!-- Indicates where the application can be installed -->
<!-- Indicates that our software can only be installed on the running OS -->
<domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true"/>
<!-- The end-user can not select which component to install, every selection is done in this script -->
<!-- Only valid on intel platforms (no ppc) -->
<options customize="never" hostArchitectures="i386"/>
<!-- Choices details -->
<choice id="choice_componentA" start_enabled="true" start_selected="true" title="choice_componentA_title" description="choice_componentA_description">
<pkg-ref id="com.identifier.componentA"/>
</choice>
<choice id="choice_componentB" start_enabled="true" start_selected="true"  title="choice_componentB_title" description="choice_componentB_description">
<pkg-ref id="com.identifier.componentB"/>
</choice>
<choice id="choice_componentC" start_enabled="true" start_selected="true"  title="choice_componentC_title" description="choice_componentC_description">
<pkg-ref id="com.identifier.componentC"/>
</choice>

<pkg-ref id="com.identifier.componentA">#PackageA.pkg</pkg-ref>
<pkg-ref id="com.identifier.componentB">#PackageB.pkg</pkg-ref>
<pkg-ref id="com.identifier.componentC">#PackageC.pkg</pkg-ref>
<!-- Installation story -->   
<choices-outline>
<line choice="choice_componentA"/>
<line choice="choice_componentB"/>
<line choice="choice_componentC"/>
</choices-outline>
<!-- Requirements that must be ok for the installer to run correctly -->
<installation-check script="installationCheck()"/>
<!-- Requirements that must be ok for a destination volume -->
<volume-check script="volumeCheck()"/>
<!-- _javascript_ used to change installer behaviour -->
<script>
...
</script>
</installer-gui-script>

If i uncompress the created installer.mpkg using pkgutil --expand, it then looks like 
<?xml version="1.0" standalone="no"?>
<installer-gui-script minSpecVersion="1">
    <!-- Localization for the installer title -->
    <title>INSTALLER_TITLE</title>
    <!-- background image -->
    <background file="background.jpg" scaling="tofit" alignment="bottomleft"/>
    <!-- File used to fill the introduction pane -->
    <welcome file="Welcome.txt"/>
    <!-- File used to fill the license pane -->
    <license file="License.rtf"/>
    <!-- File used to fill the final pane -->
    <!-- <conclusion file="Conclusion.rtf"/> -->
    <!-- Indicates where the application can be installed -->
    <!-- Indicates that our software can only be installed on the running OS -->
    <domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true"/>
    <!-- The end-user can not select which component to install, every selection is done in this script -->
    <!-- Only valid on intel platforms (no ppc) -->
    <options customize="never" hostArchitectures="i386"/>
    <!-- Choices details -->
    <choice id="choice_componentA" start_enabled="true" start_selected="true" title="choice_componentA_title" description="choice_componentA_description">
<pkg-ref id="com.identifier.componentA"/>
    </choice>
    <choice id="choice_componentB" start_enabled="true" start_selected="true"  title="choice_componentB_title" description="choice_componentB_description">
<pkg-ref id="com.identifier.componentB"/>
    </choice>
    <choice id="choice_componentC" start_enabled="true" start_selected="true"  title="choice_componentC_title" description="choice_componentC_description">
<pkg-ref id="com.identifier.componentC"/>
    </choice>
    <pkg-ref id="com.identifier.componentA" version="1.0.0" installKBytes="53">#PackageA.pkg</pkg-ref>
    <pkg-ref id="com.identifier.componentB" version="1.0.0" installKBytes="4403">#PackageB.pkg</pkg-ref>
    <pkg-ref id="com.identifier.componentC" version="1.0.0" installKBytes="6390">#PackageC.pkg</pkg-ref>
    <!-- Installation story -->   
    <choices-outline>
        <line choice="choice_componentA"/>
<line choice="choice_componentB"/>
<line choice="choice_componentC"/>
    </choices-outline>
    <!-- Requirements that must be ok for the installer to run correctly -->
    <installation-check script="installationCheck()"/>
    <!-- Requirements that must be ok for a destination volume -->
    <volume-check script="volumeCheck()"/>
    <!-- _javascript_ used to change installer behaviour -->
    <script>
....
    </script>
    <pkg-ref id="com.identifier.componentAr">
        <bundle-version/>
    </pkg-ref>
    <pkg-ref id="com.identifier.componentB">
        <bundle-version>
            <bundle CFBundleVersion="2.0.0" id="com.identifier.appB" path="Applications/AppB.app"/>
        </bundle-version>
    </pkg-ref>
    <pkg-ref id="com.identifier.componentC">
        <bundle-version>
            <bundle CFBundleVersion="2.0.0" id="com.identifier.appC" path="Applications/AppB.app/Contents/MacOS/AppC.app"/>
        </bundle-version>
    </pkg-ref>
    <product id="com.identifier.installer" version="2.0.0"/>
</installer-gui-script>

We can see the all pkg-ref structures have been detailed during the productbuild process. Even if those structures are duplicated, they keep exactly their ids.
Hope this is not the cause of my problem ?

Best regards,

Tanguy RAHUEL.

Le 21 août 2013 à 07:18, Stephane Sudre <email@hidden> a écrit :

The first thing to do would be to look what the distribution.dist file looks like.


On Tue, Aug 20, 2013 at 7:35 PM, Tanguy RAHUEL <email@hidden> wrote:
Hi,

For project purposes, we changed our installer creation process to 'productbuild'. Our installer (Distribution style .mpkg) contains multiple packages (.pkg). When looking at the install.log file in the console utility, each of our packages is processed twice. This brings some odd behaviors when pre-install/post-install scripts are contained in some packages such as an application is started twice and so on.

To create our installer we use the following command line:
productbuild --identifier "myinstaller" --version "1.2.3" --distribution "mydistribution.dist" --resources "myresources" --package-path "pathToAllPackages" "installer.mpkg"
Our my distribution.dist file already exists and contains some information on the installer such as the license file, the background image ...

Using the following command lines, we can reproduce this behavior :
# move to temp folder
cd /tmp
mkdir Packages

# Copy some known applications
cp -r /Applications/Calculator.app Calculator.app
cp -r /Applications/TextEdit.app TextEdit.app

# Build each packages
pkgbuild --component Calculator.app/ Packages/Calculator.pkg
pkgbuild --component TextEdit.app/ Packages/TextEdit.pkg

# Build distribution installer
productbuild --synthesize --package Packages/Calculator.pkg --package Packages/TextEdit.pkg  distribution.dist
productbuild --identifier "myIdentifier" --version "1.0.0" --distribution distribution.dist --package-path Packages/ myInstaller.mpkg

# In the console utility / install.log :
Two packages seen at the beginning
 ================================================================================
Installer[4367]: User picked Standard Install
Installer[4367]: Choices selected for installation:
Installer[4367]:  Mise à jour: ""
Mise à jour: "(null)"
myInstaller.mpkg#Calculator.pkg : com.apple.calculator : 10.8.0
myInstaller.mpkg#TextEdit.pkg : com.apple.TextEdit : 1.8.0
Installer[4367]: 
================================================================================

BUT a little further, we can see

installd[4378]: PackageKit: ----- Begin install -----
installd[4378]: PackageKit: request=PKInstallRequest <4 packages, destination=/>
installd[4378]: PackageKit: packages=(
    "PKLeopardPackage <file://localhost/tmp/myInstaller.mpkg#Calculator.pkg>",
    "PKLeopardPackage <file://localhost/tmp/myInstaller.mpkg#Calculator.pkg>",
    "PKLeopardPackage <file://localhost/tmp/myInstaller.mpkg#TextEdit.pkg>",
    "PKLeopardPackage <file://localhost/tmp/myInstaller.mpkg#TextEdit.pkg>"


Has anyone crossed this already ? How can i avoid duplicate packages at the installation time ?

Thanks in advance,

Tanguy RAHUEL

 _______________________________________________
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



--
Packaging Resources - http://s.sudre.free.fr/Packaging.html

 _______________________________________________
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

  • Follow-Ups:
    • Re: Duplicate package installation when using productbuild
      • From: Stephane Sudre <email@hidden>
References: 
 >Duplicate package installation when using productbuild (From: Tanguy RAHUEL <email@hidden>)

  • Prev by Date: Duplicate package installation when using productbuild
  • Next by Date: Installing in different directories, according to system version
  • Previous by thread: Duplicate package installation when using productbuild
  • Next by thread: Re: Duplicate package installation when using productbuild
  • Index(es):
    • Date
    • Thread