>*-- Check in the registry whether MySQL odbc driver is installed. >*-- This is my own registry handler, you have to use your class for this. >*-- The location of the key is: "Software\ODBC\ODBCINST.INI\ODBC Drivers\" >lcValue = "" >DoGetRegKey("MySQL ODBC 5.1 Driver",@lcValue) >llODBCInstalled = UPPER(lcValue) == "INSTALLED" >* >IF NOT llODBCInstalled > * > *-- Copy the ODBC files into the system32 directory. > lcODBCPath = ADDBS(GETENV("windir")) + "System32" > * > *-- Our installation source files must have been copied to the install folder > *-- under the program directory in a folder called Install\MySQL\ODBC. > * > *-- The following files must be present in this folder: > *-- myodbc5.dll > *-- myodbc5.lib > *-- myodbc5.pdb > *-- myodbc5S.dll > *-- myodbc5S.lib > *-- myodbc5s.pdb > *-- myodbc-installer.exe > *-- myodbc-installer.pdb > * > lcODBCSourcePath = ADDBS(SYS(5)+CURDIR())+"Install\MySQL\ODBC" > * > LOCAL lnODBDFiles, lnNr > * > *-- Create a list of the required ODBC driver files that we find in the > *-- MySQL\ODBC folder in the installation directory. > lnODBCFiles = ADIR(laODBCFiles,FORCEPATH("*.*",lcODBCSourcePath)) > * > FOR lnNr = 1 TO lnODBCFiles > * > *-- Copy these files to the odbc directory. > COPY FILE (FORCEPATH(laODBCFiles[lnNr,1],lcODBCSourcePath)) ; > TO ; > (FORCEPATH(laODBCFiles[lnNr,1],lcODBCPath)) > * > ENDFOR > * > *-- Newest version is now 5.1 > lcODBCDrivername = ["MySQL ODBC 5.1 Driver" -t "DRIVER=myodbc5.dll;SETUP=myodbc5S.dll"] > RUN myodbc-installer -d -a -n &lcODBCDriverName > * >ENDIF >