<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<project mode="install">
  <target name="preinstall"/>
  <target name="install">
    <installMSIPackage>
      <hostList>
        <name>wx6</name>
      </hostList>
      <msiPackage>psqlodbc_x64.msi</msiPackage>
      <guidRegistryKey>HKEY_LOCAL_MACHINE\SOFTWARE\SAS Institute Inc.\SAS WIP ODBC Drivers\9.47</guidRegistryKey>
    </installMSIPackage>
    <installMSIPackage>
      <hostList>
        <name>w32</name>
      </hostList>
      <msiPackage>psqlodbc_x86.msi</msiPackage>
      <guidRegistryKey>HKEY_LOCAL_MACHINE\SOFTWARE\SAS Institute Inc.\SAS WIP ODBC Drivers\9.47</guidRegistryKey>
    </installMSIPackage>
    <extract source="native/lax" home="${ProductHome}" filename="native_lax.xml">
      <hostList>
        <name>lax</name>
      </hostList>
    </extract>
    <extract source="native/r64" home="${ProductHome}" filename="native_r64.xml">
      <hostList>
        <name>r64</name>
      </hostList>
    </extract>
    <extract source="native/s64" home="${ProductHome}" filename="native_s64.xml">
      <hostList>
        <name>s64</name>
      </hostList>
    </extract>
    <extract source="native/sax" home="${ProductHome}" filename="native_sax.xml">
      <hostList>
        <name>sax</name>
      </hostList>
    </extract>
    <extract source="native/w32" home="${ProductHome}" filename="native_w32.xml">
      <hostList>
        <name>w32</name>
      </hostList>
    </extract>
    <extract source="native/wx6" home="${ProductHome}" filename="native_wx6.xml">
      <hostList>
        <name>wx6</name>
      </hostList>
    </extract>
    <extract source="gen" home="${ProductHome}" filename="webinfdodbc_gen.xml"/>
  </target>
  <target name="postinstall">
    <editRegistration action="addKey">
      <hive>HKEY_LOCAL_MACHINE</hive>
      <key>SOFTWARE\SAS Institute Inc.\SAS WIP ODBC Drivers</key>
    </editRegistration>
    <editRegistration action="addKey">
      <hive>HKEY_LOCAL_MACHINE</hive>
      <key>SOFTWARE\SAS Institute Inc.\SAS WIP ODBC Drivers\9.47</key>
    </editRegistration>
    <editRegistration action="setValue">
      <hostList>
        <name>wx6</name>
      </hostList>
      <type>REG_SZ</type>
      <hive>HKEY_LOCAL_MACHINE</hive>
      <key>SOFTWARE\SAS Institute Inc.\SAS WIP ODBC Drivers\9.47</key>
      <name>ProductId</name>
      <data>{E9E63EDB-8B33-450C-B2E6-2BDBC6A323BF}</data>
    </editRegistration>
    <editRegistration action="setValue">
      <hostList>
        <name>w32</name>
      </hostList>
      <type>REG_SZ</type>
      <hive>HKEY_LOCAL_MACHINE</hive>
      <key>SOFTWARE\SAS Institute Inc.\SAS WIP ODBC Drivers\9.47</key>
      <name>ProductId</name>
      <data>{11EBD3BD-1B96-478C-A621-C386261BE2C3}</data>
    </editRegistration>
    <runFileUtility action="substitute">
      <fileList>
        <file>${home_base}/bin/sasenv.csh</file>
        <file>${home_base}/bin/sasenv.ksh</file>
        <file>${home_base}/bin/sasenv</file>
      </fileList>
      <substitution>
        <pattern>@POSTGRES_DRIVERS@</pattern>
        <value>${home_webinfdodbc}/Driver</value>
      </substitution>
      <substitution>
        <pattern>#P </pattern>
        <value> </value>
      </substitution>
    </runFileUtility>
    <runFileUtility action="delete">
      <ConstrainBy>
        <FileExist test="exist" path="${ProductHome}/Driver/psqlodbca.la" type="file"/>
      </ConstrainBy>
      <delete>
        <file>${ProductHome}/Driver/psqlodbca.la</file>
      </delete>
    </runFileUtility>
    <runFileUtility action="delete">
      <ConstrainBy>
        <FileExist test="exist" path="${ProductHome}/Driver/psqlodbcw.la" type="file"/>
      </ConstrainBy>
      <delete>
        <file>${ProductHome}/Driver/psqlodbcw.la</file>
      </delete>
    </runFileUtility>
    <runFileUtility action="delete">
      <ConstrainBy>
        <FileExist test="exist" path="${ProductHome}/Driver/libodbc.la" type="file"/>
      </ConstrainBy>
      <delete>
        <file>${ProductHome}/Driver/libodbc.la</file>
      </delete>
    </runFileUtility>
    <runFileUtility action="delete">
      <ConstrainBy>
        <FileExist test="exist" path="${ProductHome}/Driver/libodbcinst.la" type="file"/>
      </ConstrainBy>
      <delete>
        <file>${ProductHome}/Driver/libodbcinst.la</file>
      </delete>
    </runFileUtility>
    <runFileUtility action="delete">
      <ConstrainBy>
        <FileExist test="exist" path="${ProductHome}/Driver/libeay32.dll" type="file"/>
      </ConstrainBy>
      <delete>
        <file>${ProductHome}/Driver/libeay32.dll</file>
      </delete>
    </runFileUtility>
    <runFileUtility action="delete">
      <ConstrainBy>
        <FileExist test="exist" path="${ProductHome}/Driver/ssleay32.dll" type="file"/>
      </ConstrainBy>
      <delete>
        <file>${ProductHome}/Driver/ssleay32.dll</file>
      </delete>
    </runFileUtility>
    <runFileUtility action="delete">
      <ConstrainBy>
        <FileExist test="exist" path="${ProductHome}/Driver/libcrypto-1_1-x64.dll" type="file"/>
      </ConstrainBy>
      <delete>
        <file>${ProductHome}/Driver/libcrypto-1_1-x64.dll</file>
      </delete>
    </runFileUtility>
    <runFileUtility action="delete">
      <ConstrainBy>
        <FileExist test="exist" path="${ProductHome}/Driver/libssl-1_1-x64.dll" type="file"/>
      </ConstrainBy>
      <delete>
        <file>${ProductHome}/Driver/libssl-1_1-x64.dll</file>
      </delete>
    </runFileUtility>
    <runFileUtility action="delete">
      <ConstrainBy>
        <FileExist test="exist" path="${ProductHome}/Driver/libcrypto.so.3" type="file"/>
      </ConstrainBy>
      <hostList>
        <name>lax</name>
      </hostList>
      <delete>
        <file>${ProductHome}/Driver/libcrypto.so.3</file>
      </delete>
    </runFileUtility>
    <runFileUtility action="delete">
      <ConstrainBy>
        <FileExist test="exist" path="${ProductHome}/Driver/libssl.so.3" type="file"/>
      </ConstrainBy>
      <hostList>
        <name>lax</name>
      </hostList>
      <delete>
        <file>${ProductHome}/Driver/libssl.so.3</file>
      </delete>
    </runFileUtility>
    <editDeploymentRegistry action="removeInstall">
      <product>${12ByteCode}</product>
      <version>9.4</version>
      <host>${host}</host>
    </editDeploymentRegistry>
    <removeUninstallData version="9.4"/>
    <editDeploymentRegistry action="removeInstall">
      <product>${12ByteCode}</product>
      <version>9.41</version>
      <host>${host}</host>
    </editDeploymentRegistry>
    <removeUninstallData version="9.41"/>
    <editDeploymentRegistry action="removeInstall">
      <product>${12ByteCode}</product>
      <version>9.42</version>
      <host>${host}</host>
    </editDeploymentRegistry>
    <removeUninstallData version="9.42"/>
  </target>
</project>
