<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
    Copyright 2021 Teradici Corporation; © Copyright 2022 HP Development Company, L.P.
-->
<installer-gui-script minSpecVersion="1">
    <title>PCoIP Graphics Agent</title>
    <allowed-os-versions>
        <os-version min="11.0"/>
    </allowed-os-versions>
    <welcome file="Welcome.txt"/>
    <license file="License.rtf"/>
    <domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true"/>
    <options allow-external-scripts="no" customize="never" hostArchitectures="x86_64,arm64"/>
    <installation-check script="install_check();"/>
    <script><![CDATA[
function x86_cpu_check() {
  var cpu = system.sysctl('hw.cputype');
  if(cpu == 7) {
    return true;
  }
  return false;
}

function macos_version_check(minimum) {
  if((system.compareVersions(system.version.ProductVersion, minimum) >= 0)) {
    return true;
  }
  return false;
}

function install_check() {
  if (x86_cpu_check()) {
    if (!macos_version_check('11.0')) {
      my.result.title = 'Unsupported OS Version';
      my.result.message = 'Only macOS 11.0 or later is supported';
      my.result.type = 'Fatal';
      return false;
    }
  } else {
    if (!macos_version_check('12.0')) {
      my.result.title = 'Unsupported OS Version';
      my.result.message = 'Only macOS 12.0 or later is supported on Apple Silicon';
      my.result.type = 'Fatal';
      return false;
    }
  }

  var rosetta = system.sysctl('sysctl.proc_translated');
  if(rosetta == 1) {
    my.result.title = 'Rossetta not supported';
    my.result.message = 'Running the installer on an emulated chipset is not supported.';
    my.result.type = 'Fatal';
    return false;
  }
  return true;
}
]]></script>
    <options allow-external-scripts="no" customize="allow" rootVolumeOnly="false"/>
    <choices-outline>
        <line choice="graphicsChoice"/>
    </choices-outline>
    <choice id="graphicsChoice" title="graphics" start_selected="true" start_enabled="true" start_visible="true">
        <pkg-ref id="com.teradici.pcoip-agent.graphics"/>
    </choice>
    <pkg-ref id="com.teradici.pcoip-agent.graphics" version="23.04.1" installKBytes="181357" auth="Admin" onConclusion="None">#pcoip-agent-graphics_23.04.1-graphics.pkg</pkg-ref>
    <pkg-ref id="com.teradici.pcoip-agent.graphics">
        <bundle-version>
            <bundle CFBundleShortVersionString="23.04.1" CFBundleVersion="23.04.1" id="com.teradici.pcoip-agent" path="Applications/PCoIP Agent.app"/>
            <bundle SourceVersion="261370000" CFBundleShortVersionString="1.0" CFBundleVersion="1.0" id="com.teradici.teradiciPcoipAuthPlugin" path="Library/Security/SecurityAgentPlugins/teradiciPcoipAuthPlugin.bundle"/>
        </bundle-version>
    </pkg-ref>
    <product version="23.04.1"/>
</installer-gui-script>