REM ####################################################################### REM # REM # Licensed Material - Property Of IBM REM # REM # "Restricted Materials of IBM" REM # REM # IBM Informix Dynamic Server REM # REM # (c) Copyright IBM Corporation 1996, 2004 All rights reserved. REM # REM # Description: REM # build the administrative database and load initial data REM # REM ######################################################################/ REM ### REM #inherit the message constants REM ### call %INFORMIXDIR%\etc\conv\strmaps.bat REM ### REM # setup the WINROOT path REM ### set WINROOT=%SystemRoot% if "x%WINROOT%" == "x" set WINROOT=C:\WINNT REM ### REM # remove emergency boot file since it's data is now obsolete REM ### copyboot REM ### REM # where to put output REM ### set OUTFILE=%INFORMIXDIR%\etc\bldutil.%INFORMIXSERVER%.out set BLDUTL_STATFILE=%INFORMIXDIR%\etc\bldutil.%INFORMIXSERVER%.sql REM # Put something in output file, so user knows something happened type %INFORMIXDIR%\etc\bldutil.1in > %OUTFILE% 2>&1 REM # Since we don't know if the database already exists, try to drop it. REM # Ignore errors, since we don't care if we couldn't drop a REM # non-existent database REM # Drop sysutils in the current server instance. set DBPATH_PREV=%DBPATH% set DBPATH= echo "About to drop the old sysutils database" >> %OUTFILE% 2>&1 dbaccess - < %INFORMIXDIR%\etc\bldutil.2in > nul 2>&1 REM # Restore the DBPATH set DBPATH=%DBPATH_PREV% REM ### REM # build the sysutils database REM ### echo "About to run sysutils.sql" >> %OUTFILE% 2>&1 dbaccess - %INFORMIXDIR%\etc\sysutils.sql >> %OUTFILE% 2>&1 REM # Check to see that there were no errors REM # Make sure find.exe runs from \winnt\system32 and not from a DOS directory %WINROOT%\System32\find /V "%INFORMIXDIR%" %OUTFILE% | %WINROOT%\System32\find /I "error" REM # 0 means found and error so sysutils.sql failed if ERRORLEVEL 1 goto SUCCESS if ERRORLEVEL 0 goto FAILURE :SUCCESS REM ### REM # else it was successful, so remove OUTFILE and ... REM # put s_sysutil_succ msg into sysmaster 'logmessage' table. REM # See olmsg.src for msg. REM ### echo "Inserting success msg into logmessage table" >> %OUTFILE% 2>&1 echo insert into logmessage(message_num) values (%S_SYSUTIL_SUCC%); > %BLDUTL_STATFILE% dbaccess sysmaster %BLDUTL_STATFILE% >> %OUTFILE% 2>&1 del %OUTFILE% goto exit :FAILURE REM ### REM # was there an error? REM # If yes, then drop sysutils and ... REM # put s_sysutil_err msg into the sysmaster 'logmessage' table. REM # See olmsg.src for msg. REM # always exit with 0 for buildsmi REM ### echo Cleaning up whatever was successfully created >> %OUTFILE% dbaccess - - < %INFORMIXDIR%\etc\bldutil.2in >> %OUTFILE% 2>&1 echo insert into logmessage(message_num) values (%S_SYSUTIL_ERR%); > %BLDUTL_STATFILE% dbaccess sysmaster %BLDUTL_STATFILE% >> %OUTFILE% 2>&1 :exit del %BLDUTL_STATFILE% del %INFORMIXDIR%\etc\vermsg.sql