- @echo off
- REM Install the Net-SNMP Project files on the local machine.
- REM
- REM Run this script from the base Net-SNMP source directory
- REM after the successful build has completed.
- REM **** IMPORTANT NOTE ****
- REM The value for INSTALL_BASE in win32net-snmpnet-snmp-config.h, and
- REM The value for INSTALL_BASE below **MUST** match
- REM Use backslashes to delimit sub-directories in path.
- set INSTALL_BASE="c:usr"
- if "%1" == "-?" goto help
- if "%1" == "/?" goto help
- if "%1" == "-h" goto help
- if "%1" == "/h" goto help
- if "%1" == "-help" goto help
- if "%1" == "/help" goto help
- goto start
- :help
- echo .
- echo This script will compile the Net-SNMP Perl modules. Net-SNMP must
- echo already be installed.
- echo .
- echo The current install base is %INSTALL_BASE%.
- echo This must match the directory that Net-SNMP has been installed in.
- echo .
- echo To change the installation directory, modify the INSTALL_BASE variable
- echo inside this script.
- echo .
- echo Run this script from the base of the source directory, NOT the win32
- echo directory.
- echo .
- goto end
- :start
- set progVer=release
- if "%1" NEQ "-debug" goto nodebug
- set progVer=debug
- shift
- :nodebug
- REM make sure script runs from above the win32 directory
- cd win32 > NUL: 2>&1
- cd .. > NUL: 2>&1
- echo Installing %progVer% versions
- echo Remember to run this script from the base of the source directory.
- echo Creating %INSTALL_BASE% sub-directories
- mkdir %INSTALL_BASE% > NUL:
- mkdir %INSTALL_BASE%bin > NUL:
- mkdir %INSTALL_BASE%etc > NUL:
- mkdir %INSTALL_BASE%etcsnmp > NUL:
- mkdir %INSTALL_BASE%share > NUL:
- mkdir %INSTALL_BASE%sharesnmp > NUL:
- mkdir %INSTALL_BASE%sharesnmpmibs > NUL:
- mkdir %INSTALL_BASE%sharesnmpsnmpconf-data > NUL:
- mkdir %INSTALL_BASE%sharesnmpsnmpconf-datasnmp-data > NUL:
- mkdir %INSTALL_BASE%sharesnmpsnmpconf-datasnmpd-data > NUL:
- mkdir %INSTALL_BASE%sharesnmpsnmpconf-datasnmptrapd-data > NUL:
- mkdir %INSTALL_BASE%sharesnmpmib2c-data > NUL:
- mkdir %INSTALL_BASE%snmp > NUL:
- mkdir %INSTALL_BASE%snmppersist > NUL:
- mkdir %INSTALL_BASE%temp > NUL:
- mkdir %INSTALL_BASE%include > NUL:
- mkdir %INSTALL_BASE%includenet-snmp > NUL:
- mkdir %INSTALL_BASE%includeucd-snmp > NUL:
- mkdir %INSTALL_BASE%lib > NUL:
- echo Copying MIB files to %INSTALL_BASE%sharesnmpmibs
- Copy mibs*.txt %INSTALL_BASE%sharesnmpmibs > NUL:
- echo Copying compiled programs to %INSTALL_BASE%bin
- Copy win32bin%progVer%*.exe %INSTALL_BASE%bin > NUL:
- Copy localsnmpconf %INSTALL_BASE%bin > NUL:
- Copy localsnmpconf.bat %INSTALL_BASE%bin > NUL:
- Copy localmib2c %INSTALL_BASE%bin > NUL:
- Copy localmib2c.bat %INSTALL_BASE%bin > NUL:
- Copy localtraptoemail %INSTALL_BASE%bin > NUL:
- Copy localtraptoemail.bat %INSTALL_BASE%bin > NUL:
- echo Copying snmpconf files to %INSTALL_BASE%sharesnmpsnmpconf-datasnmp-data
- Copy localsnmpconf.dirsnmp-data*.* %INSTALL_BASE%sharesnmpsnmpconf-datasnmp-data > NUL:
- Copy localsnmpconf.dirsnmpd-data*.* %INSTALL_BASE%sharesnmpsnmpconf-datasnmpd-data > NUL:
- Copy localsnmpconf.dirsnmptrapd-data*.* %INSTALL_BASE%sharesnmpsnmpconf-datasnmptrapd-data > NUL:
- echo Copying mib2c config files to %INSTALL_BASE%sharesnmp
- Copy localmib2c*.conf %INSTALL_BASE%sharesnmp > NUL:
- Copy localmib2c-conf.d*.* %INSTALL_BASE%sharesnmpmib2c-data > NUL:
- REM
- REM Copy the remaining files used only to develop
- REM other software that uses Net-SNMP libraries.
- REM
- echo Copying link libraries to %INSTALL_BASE%lib
- Copy win32lib%progVer%*.* %INSTALL_BASE%lib > NUL:
- echo Copying header files to %INSTALL_BASE%include
- xcopy /E /Y includenet-snmp*.h %INSTALL_BASE%includenet-snmp > NUL:
- xcopy /E /Y includeucd-snmp*.h %INSTALL_BASE%includeucd-snmp > NUL:
- xcopy /E /Y win32net-snmp*.* %INSTALL_BASE%includenet-snmp > NUL:
- REM
- REM If built with OpenSSL, we need the DLL library, too.
- REM
- echo Copying DLL files to %INSTALL_BASE%
- Copy win32bin%progVer%*.dll %INSTALL_BASE%bin > NUL:
- echo Copying DLL files to %SYSTEMROOT%System32
- Copy win32bin%progVer%*.dll %SYSTEMROOT%System32 > NUL:
- echo Done copying files to %INSTALL_BASE%