home *** CD-ROM | disk | FTP | other *** search
/ University of Pittsburgh…tware Toolkit - Fall 2002 / Toolkit.iso / pc / Connectivity / HostEx7.1 / SOCKS / Winsock1 / install.bat < prev    next >
Encoding:
DOS Batch File  |  2001-08-08  |  4.8 KB  |  151 lines

  1. @echo Off
  2. if not "%echo%" == "" echo %echo%
  3. echo.
  4. echo  This batch file will install the Hummingbird Socks 4/5 client
  5. echo  for Winsock v1.1 only.
  6. echo  Copyright (c) 1996-2001, Hummingbird Ltd.
  7. echo  All Rights Reserved.
  8. echo.
  9.     if not exist humprdsk.dll goto direrror
  10.     if not exist checkwin.exe goto direrror
  11.     if not exist inwin.com goto direrror
  12.     if not exist wsock32.hcl goto direrror
  13.     if not exist winsock.hcl goto direrror
  14.     if not exist socks.cfg goto direrror
  15.     subst > NUL
  16.     if "%OS%" == "Windows_NT" goto socknt
  17.     if "%winbootdir%" == "" goto win16
  18.     checkwin > NUL
  19.     if errorlevel 2 goto sock2_95
  20.  
  21. REM ************************************************************************
  22. :sock1_95
  23. echo.
  24. echo  Install Socks 4/5 for WinSock 1 on Windows 95
  25. echo.
  26.     inwin
  27.     if errorlevel 1 goto indosmode
  28.     echo Install.bat must be run from MS-DOS mode.
  29.     echo Please restart Windows 95 in MS-DOS mode and run install.bat again.
  30.     goto end
  31. :indosmode
  32.     subst > NUL
  33.     if exist %winbootdir%\system\wsock32o.dll goto NoRename95
  34.     ren %winbootdir%\system\wsock32.dll wsock32o.dll
  35.     if errorlevel 1 goto generalerror
  36. :NoRename95:
  37.     copy %winbootdir%\system\wsock32o.dll %winbootdir%\system\wsock32.dll >NUL
  38.     copy wsock32.hcl %winbootdir%\system\wsock32.dll >NUL
  39.     copy humprdsk.dll %winbootdir%\system >NUL
  40.     copy ..\system32\redist\ms\system\msvcrt.dll %winbootdir%\system >NUL
  41.     if errorlevel 1 goto generalerror
  42.     if exist %winbootdir%\system\socks.cnf goto cnf1_95
  43.     if exist %winbootdir%\system\socks.cfg goto cfg1_95
  44.     copy socks.cfg %winbootdir%\system >NUL
  45.    if errorlevel 1 goto generalerror
  46.     goto cnf1_win
  47. :cnf1_95
  48. echo.
  49. echo Previous version of the SOCKS configuration file was found and renamed to socks.cfg. 
  50. echo.
  51.     copy socks.cfg %winbootdir%\system\socks.new >NUL
  52.     ren %winbootdir%\system\socks.cnf socks.cfg
  53.     if errorlevel 1 goto generalerror
  54.     goto cnf1_win
  55. :cfg1_95
  56. echo.
  57. echo Previous version of the SOCKS configuration file was found. 
  58. echo.
  59.     copy socks.cfg %winbootdir%\system\socks.new >NUL
  60.     if errorlevel 1 goto generalerror
  61. :cnf1_win
  62.     echo  Edit SOCKS.cfg in your Windows System directory to setup Socks 4/5.
  63.     echo.
  64.     echo Please restart Windows now.
  65.     echo.
  66.     goto end
  67.  
  68. REM ************************************************************************
  69. :win16
  70. echo.
  71. echo  Install Socks 4 for WinSock 1 on Windows for Workgroups 3.11
  72. echo.
  73.     inwin
  74.     if errorlevel 1 goto dosmode
  75.     echo Install.bat must be run from MS-DOS mode.
  76.     echo Please exit Windows and run install.bat again.
  77.     goto end
  78. :usagewin
  79.     echo Re-run Install.bat with your Windows directory as a parameter.
  80.     echo ie. "Install.bat C:\WINDOWS"
  81.     goto end
  82. :invaliddir
  83.     echo "%1" does not appear to contain Windows for Workgroups 3.11.
  84.     goto end
  85. :dosmode
  86.     subst > NUL
  87.     if "%1" == "" goto usagewin
  88.     if not exist %1\winsock.dll goto invaliddir
  89.     if exist %1\system\kernel32.dll goto invaliddir
  90.  
  91.     if exist %1\winsocko.dll goto NoDosRename
  92.     ren %1\winsock.dll winsocko.dll
  93.     if errorlevel 1 goto generalerror
  94. :NoDosRename
  95.     copy %1\winsocko.dll %1\winsock.dll >NUL
  96.     copy winsock.hcl %1\winsock.dll >NUL
  97.     if errorlevel 1 goto generalerror
  98.     if exist %1\system\socks.cfg goto cnf_win31
  99.     copy socks.cfg %1\system >NUL
  100.     copy humprdsk.dll %1\system >NUL
  101.     if errorlevel 1 goto generalerror
  102.     goto cnf1_win31
  103. :cnf_win31
  104.     copy socks.cfg %1\system\socks.new >NUL
  105.     if errorlevel 1 goto generalerror
  106. :cnf1_win31
  107.     echo  Edit SOCKS.cfg in your Windows System directory to setup Socks 4.
  108.     echo.
  109.     echo Please restart Windows now.
  110.     echo.
  111.     goto end
  112.  
  113.  
  114.  
  115. REM *************************************************************************
  116. :sock2_95
  117. echo.
  118. REM  Install Socks 4/5 for WinSock 2 on Windows 95/98
  119. REM  (Aborts with an error message.  Must use MSI install instead)
  120.  
  121. goto wsock2error
  122.  
  123. REM *************************************************************************
  124. :socknt
  125. REM  Install Socks 4/5 for WinSock 2 on Windows NT4/2000
  126. REM  (Aborts with an error message.  Must use MSI install instead)
  127.  
  128. goto wsock2error
  129.  
  130. REM *************************************************************************
  131. :wsock2error
  132.     echo Error:
  133.     echo Cannot install Socks 4/5 for Winsock2 using install.bat
  134.     goto end
  135.  
  136. REM *************************************************************************
  137. :direrror
  138.     echo Error:
  139.     echo %0 must be run from its own directory.
  140.     goto end
  141.  
  142. REM *************************************************************************
  143. :generalerror
  144.     echo The above error prevented Socks 4/5 from being installed properly.
  145.     echo Fix error and try again.
  146.     goto end
  147.  
  148. REM *************************************************************************
  149. :end
  150.     pause
  151.