<?xml version="1.0" standalone="no"?>
<installer-gui-script minSpecVersion="1">
  <title><%= friendly_name %></title>
  <background file="background.png" alignment="bottomleft" mime-type="image/png"/>
  <welcome file="welcome.html" mime-type="text/html"/>
  <license file="license.html" mime-type="text/html"/>

  <!-- Generated by productbuild - - synthesize -->
  <pkg-ref id="<%= identifier %>"/>
  <options customize="never" require-scripts="false" allow-external-scripts="true" hostArchitectures="x86_64,arm64"/>
  <choices-outline>
    <line choice="default">
      <line choice="<%= identifier %>"/>
    </line>
  </choices-outline>
  <choice id="default"/>
  <choice id="<%= identifier %>" visible="false">
    <pkg-ref id="<%= identifier %>"/>
  </choice>
  <pkg-ref id="<%= identifier %>" version="<%= version %>" onConclusion="none"><%= component_pkg %></pkg-ref>
  <domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true" />
  <installation-check script="chefdk_check()"/>
  <script><![CDATA[

function chefdk_check () {
    // Check if ChefDK is installed.
    if (! system.run('/usr/sbin/pkgutil', '--pkgs=com.getchef.pkg.chefdk')) {
        // need to set error type
        my.result.type = "Warning"
        my.result.title = "ChefDK Installed"
        my.result.message = "You're using ChefDK. It will be upgraded to Chef Workstation."
        return false
    }
    return true
}

]]></script>
</installer-gui-script>
