<?xml version="1.0" encoding="UTF-8"?>
<packages:packages xmlns:packages="http://www.wpkg.org/packages">

  <package  id="acrobatx" name="Adobe Acrobat X" revision="%version%" reboot="false" priority="66">
    <variable name="version" value="10116" />
    <variable name="mstpath" value="%WPKGSHAREBASE%\%WPKGINSTITUTION%-config\Adobe\AcrobatX\adobe_proX_%WPKGINSTITUTION%.mst" />
    <check type="uninstall" condition="exists" path="Adobe Acrobat X Pro - English, Français, Deutsch" />
    <check type="logical" condition="or">
      <check type="file" condition="versiongreaterorequal" path="%PROGRAMFILES%\Adobe\Acrobat 10.0\Acrobat\Acrobat.dll" value="10.1.16.13" />
      <check type="file" condition="versiongreaterorequal" path="%PROGRAMFILES(x86)%\Adobe\Acrobat 10.0\Acrobat\Acrobat.dll" value="10.1.16.13" />
    </check>
    <!-- Version numbers for authplay.dll can be found before installation by examining the
    msp or by looking at the latest Flash update or just install it on a test pc and then find the version number -->
    <check type="logical" condition="or">
      <check type="file" condition="versiongreaterorequal" path="%PROGRAMFILES%\Adobe\Acrobat 10.0\Acrobat\authplay.dll" value="10.3.183.20" />
      <check type="file" condition="versiongreaterorequal" path="%PROGRAMFILES(x86)%\Adobe\Acrobat 10.0\Acrobat\authplay.dll" value="10.3.183.20" />
    </check>

    <install cmd='msiexec /l* %WPKGLOGDIR%\adobe_acrobat_%version%_install.log /qn /norestart /i "%WPKGSOFTWARE%\adobe\AcrobatX\AcroPro.msi" TRANSFORMS="%mstpath%"' >
      <condition>
        <check type="file" condition="exists" path="%mstpath%" />
      </condition>
      <exit code="3010" />
    </install>

    <install cmd='msiexec /l* %WPKGLOGDIR%\adobe_acrobat_%version%_install.log /qn /norestart /i "%WPKGSOFTWARE%\adobe\AcrobatX\AcroPro.msi"' >
      <condition>
				<check type="logical" condition="not">
	        <check type="file" condition="exists" path="%mstpath%" />
				</check>
      </condition>
      <exit code="3010" />
    </install>

    <install cmd='msiexec /qn /norestart /update "%WPKGSOFTWARE%\adobe\AcrobatX\AcrobatX_updates\AcrobatUpd10116.msp"' ><exit code="3010" /></install>

    <upgrade include="remove" />
    <upgrade include="install" />

    <remove cmd='msiexec /qn /norestart /x {AC76BA86-1033-F400-7760-000000000005} /l* %WPKGLOGDIR%\adobe_acrobat_%version%_uninstall.log' >
      <exit code="1614" />
      <exit code="1605" /> <!-- already removed somehow -->
      <exit code="3010" />
    </remove>

  </package>
</packages:packages>

<!--
Updates = http://www.adobe.com/support/downloads/product.jsp?product=1&platform=Windows

When Acrobat is part of a Creative Suite, Acrobat X HAS to be installed first.

Use 'Adobe Customisation Wizard X' to make a .mst file.  Use the serial number for Acrobat X, not the Creative Suite number (1118-1293-1006-0556-2044-0122)

To make an MST transform for MATHS, install and start the Adobe Customization Wizard from http://www.adobe.com/support/downloads/thankyou.jsp?ftpID=4950&fileID=4595.  Start it, then 'Open Package, look for the file AcroPro.msi.  Customise settings, i.e.

Installation Options:
    Run Installation: silently
    If reboot required at end of installation: Suppress reboot
    Make Reader the default viewer if both acrobat and Reader are installed
    remove previous version of Acrobat Pro, Standard or Elements

Shortcuts:
    Remove desktop icon

Adobe PDF Printer:
    Ask to replace existing PDF file

EULA and Document Status:
    Suppress display of EULA

Online and Acrobat.com:
    Disable all updates
    Disable Registration
    When launching pdf in browser, offer Open/Save dialog
    Disable Help > Digital editions
    Disable product improvment program

    Disable all Acrobat.com access

Generate the MST tranform (transform menu) ="\\mathsdom\wpkg7\server\WPKG-1.1.2\programs\Adobe_CS5.5\maths_config\adobe_proX_maths.mst"

Save the msi package (file menu).

Do this for 32 and 64 bit versions

To work out the version number of the new updates, unpack the msp file, look for the directory with 'CAB' in its name, this is a cab file.  Unpack this, look for Acrobat.dll or authplay.dll, look at the files properties, obtain the version number, change the 'check's below to reflect this

-->

<!--<install cmd='msiexec /qn /norestart /update "%WPKGSOFTWARE%\adobe\AcrobatX\AcrobatX_updates\AcrobatUpd1001_Tier1.msp"' ><exit code="3010" /></install>
<install cmd='msiexec /qn /norestart /update "%WPKGSOFTWARE%\adobe\AcrobatX\AcrobatX_updates\AcrobatSecUpd1002.msp"' ><exit code="3010" /></install>
<install cmd='msiexec /qn /norestart /update "%WPKGSOFTWARE%\adobe\AcrobatX\AcrobatX_updates\AcrobatSecUpd1003.msp"' ><exit code="3010" /></install>
<install cmd='msiexec /qn /norestart /update "%WPKGSOFTWARE%\adobe\AcrobatX\AcrobatX_updates\AcrobatUpd1010.msp"' ><exit code="3010" /></install>
<install cmd='msiexec /qn /norestart /update "%WPKGSOFTWARE%\adobe\AcrobatX\AcrobatX_updates\AcrobatUpd1011.msp"' ><exit code="3010" /></install>
<install cmd='msiexec /qn /norestart /update "%WPKGSOFTWARE%\adobe\AcrobatX\AcrobatX_updates\AcrobatUpd1012.msp"' ><exit code="3010" /></install>
<install cmd='msiexec /qn /norestart /update "%WPKGSOFTWARE%\adobe\AcrobatX\AcrobatX_updates\AcrobatUpd1013.msp"' ><exit code="3010" /></install>
<install cmd='msiexec /qn /norestart /update "%WPKGSOFTWARE%\adobe\AcrobatX\AcrobatX_updates\AcrobatUpd1014.msp"' ><exit code="3010" /></install>
<install cmd='msiexec /qn /norestart /update "%WPKGSOFTWARE%\adobe\AcrobatX\AcrobatX_updates\AcrobatUpd1015.msp"' ><exit code="3010" /></install>
<install cmd='msiexec /qn /norestart /update "%WPKGSOFTWARE%\adobe\AcrobatX\AcrobatX_updates\AcrobatSecUpd1016.msp"' ><exit code="3010" /></install>
<install cmd='msiexec /qn /norestart /update "%WPKGSOFTWARE%\adobe\AcrobatX\AcrobatX_updates\AcrobatUpd1017.msp"' ><exit code="3010" /></install>
<install cmd='msiexec /qn /norestart /update "%WPKGSOFTWARE%\adobe\AcrobatX\AcrobatX_updates\AcrobatUpd1018.msp"' ><exit code="3010" /></install>
<install cmd='msiexec /qn /norestart /update "%WPKGSOFTWARE%\adobe\AcrobatX\AcrobatX_updates\AcrobatUpd1019.msp"' ><exit code="3010" /></install>
<install cmd='msiexec /qn /norestart /update "%WPKGSOFTWARE%\adobe\AcrobatX\AcrobatX_updates\AcrobatUpd10110.msp"' ><exit code="3010" /></install>
<install cmd='msiexec /qn /norestart /update "%WPKGSOFTWARE%\adobe\AcrobatX\AcrobatX_updates\AcrobatSecUpd10111.msp"' ><exit code="3010" /></install>
<install cmd='msiexec /qn /norestart /update "%WPKGSOFTWARE%\adobe\AcrobatX\AcrobatX_updates\AcrobatUpd10112.msp"' ><exit code="3010" /></install>
<install cmd='msiexec /qn /norestart /update "%WPKGSOFTWARE%\adobe\AcrobatX\AcrobatX_updates\AcrobatUpd10113.msp"' ><exit code="3010" /></install>
-->