Difference between revisions of "ODBC Connection"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
(Created page with 'Category:Silent Installers ==A WPKG Package to create an ODBC Connection== <code type="xml"> <package id="ODBC_CONN_X" name="Create ODBC Connect to DB XYZ on SQL …')
 
Line 2: Line 2:
 
==A WPKG Package to create an ODBC Connection==
 
==A WPKG Package to create an ODBC Connection==
  
<code type="xml">
+
<pre>
 
<package id="ODBC_CONN_X"
 
<package id="ODBC_CONN_X"
 
           name="Create ODBC Connect to DB XYZ on SQL 2008 Server ABC..."
 
           name="Create ODBC Connect to DB XYZ on SQL 2008 Server ABC..."
Line 42: Line 42:
 
      
 
      
 
   </package>
 
   </package>
</code>
+
</pre>

Revision as of 02:17, 18 October 2010

A WPKG Package to create an ODBC Connection

<package id="ODBC_CONN_X"
           name="Create ODBC Connect to DB XYZ on SQL 2008 Server ABC..."
           revision="1.1"
           reboot="false"
           execute="always">

    <depends package-id="SETUP" />
    <depends package-id="SETUPTOOLS" /> <!-- TxtReplace.exe -->
    <depends package-id="SQL_SERVER_NATIVECLIENT_10.0" />
    
    <variable name="LOCALDOWNLOADS" value="C:\downloads\provisioning" />
    <variable name="WPKGHOME"       value="\\enterprise\development\infrastructure\provisioning\wpkg-1.1.2\" />
    <variable name="tools"          value="c:\tools" />

    <variable name="ODBC_DSN_NAME"      value="ODBC_CONN_Z" />
    <variable name="ODBC_DBSERVER"      value="SQLDEV-2005-A" />
    <variable name="ODBC_DBNAME"        value="AutomationTest" />
    <variable name="ODBC_DESC"          value="A test of blah for blah" />
    <variable name="ODBC_DRIVERNAME"    value="SQL Server" />
    <variable name="ODBC_TEMPLATE_FILE" value="ODBC_template_SQL2K5_int_auth_no_db.reg" />

    <check type="registry" condition="equals" path="HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources\%ODBC_DSN_NAME%" value="%ODBC_DRIVERNAME%" />
    <!--
    <check type="registry" condition="exists" path="HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\%ODBC_DSN_NAME%\Server" />
    -->
    <!--
    <install cmd="cmd /c %tools%\reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources" /v "%ODBC_DSN_NAME%" /t REG_SZ /d "SQL Server" "  />
    <install cmd="cmd /c %tools%\reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\%ODBC_DSN_NAME%"" />
    -->
    <!-- HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\__ODBC_DSN_NAME__ -->
    
    <install cmd="xcopy /Y "%WPKGHOME%\ODBC\%ODBC_TEMPLATE_FILE%" "%LOCALDOWNLOADS%\"" />
    <install cmd="%tools%\TxtReplace\TxtReplace.exe -i "%LOCALDOWNLOADS%\%ODBC_TEMPLATE_FILE%" -r __ODBC_DSN_NAME__ "%ODBC_DSN_NAME%" -r __ODBC_DESCRIPTION__ "%ODBC_DESC%" -r __ODBC_DBSERVER__ "%ODBC_DBSERVER%" -r __ODBC_DBNAME__ "%ODBC_DBNAME%" " />
    <install cmd="%tools%\reg.exe import "%LOCALDOWNLOADS%\%ODBC_TEMPLATE_FILE%"" />

    <remove cmd="cmd /c %tools%\reg.exe DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources" /v "%ODBC_DSN_NAME%" /f" />
    <remove cmd="cmd /c %tools%\reg.exe DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\%ODBC_DSN_NAME%" /f" />
    
  </package>