home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / packer / zip4 / cfgzip4r.444 < prev    next >
Text File  |  1993-11-26  |  3KB  |  112 lines

  1. :: Mick Ghazey 70550,1762 - November 1993
  2. :: Returns 0 if NORMAL configuration, 1 if RENAMED.
  3.  
  4. @*echo off
  5. *setlocal
  6. *set pkz=pkzip.exe
  7. *set pkunz=pkunzip.exe
  8. *set pkz4=pkzip4.exe
  9. *set pkunz4=pkunzip4.exe
  10. *set z4=zip4.exe
  11. *set unz4=unzip4.exe
  12.  
  13. :: Find directory where ZIP4 is installed.
  14. *set dir4=%@path[%@search[%z4]]
  15. iff .%dir4 == . then
  16.  *echo Can't find %z4!
  17.  goto notdone
  18. endiff
  19.  
  20. iff not exist %@path[%dir4]%unz4 then
  21.  *echo Can't find %@path[%dir4]%unz4!
  22.  goto notdone
  23. endiff
  24.  
  25. :: Try to find PKZIP4.EXE.
  26. *set pkdir=%@path[%@search[%pkz4]]
  27.  
  28. iff .%pkdir == . then
  29.  :: PKZIP4.EXE doesn't exist. Find PKZIP.EXE directory.
  30.  *set pkdir=%@path[%@search[%pkz]]
  31.  
  32.  iff .%pkdir == . then
  33.   *echo Can't find %pkz!
  34.   goto notdone
  35.  endiff
  36.  
  37.  iff not exist %@path[%pkdir]%pkunz then
  38.   *echo Can't find %@path[%pkdir]%pkunz!
  39.   goto notdone
  40.  endiff
  41.  
  42.  :: Temporarily move the file.
  43.  *move /q %@path[%pkdir]%pkz %@path[%pkdir]%pkz4
  44.  iff .%@search[%pkz] ne . then
  45.   :: A second copy of a pkzip.exe executable was found
  46.   *echo "%@path[%pkdir]%pkz" and "%@search[%pkz]" exist in your path.
  47.   *move /q %@path[%pkdir]%pkz4 %@path[%pkdir]%pkz
  48.   goto notdone
  49.  endiff
  50.  
  51.  :: Wait for confirmation before making the change.
  52.  *move /q %@path[%pkdir]%pkz4 %@path[%pkdir]%pkz
  53.  
  54.  :: Temporarily move the file.
  55.  *move /q %@path[%pkdir]%pkunz %@path[%pkdir]%pkunz4
  56.  iff .%@search[%pkunz] ne . then
  57.   :: A second copy of a pkunzip.exe executable was found
  58.   *echo "%@path[%pkdir]%pkunz" and "%@search[%pkunz]" exist in your path.
  59.   *move /q %@path[%pkdir]%pkunz4 %@path[%pkdir]%pkunz
  60.   goto notdone
  61.  endiff
  62.  
  63.  :: Wait for confirmation before making the change.
  64.  *move /q %@path[%pkdir]%pkunz4 %@path[%pkdir]%pkunz
  65.  
  66.  *cls
  67.  
  68.  text
  69.  
  70. The following changes will be made in the order shown to the following files.
  71. The changes may be undone by running CFIGZIP4.BTM again. Please read
  72. ZIP4.DOC before accepting these changes.
  73.  
  74.  endtext
  75.  
  76.  *echo %@path[%pkdir]%pkz will be renamed %@path[%pkdir]%pkz4
  77.  *echo %@path[%dir4]%z4 will be copied to %@path[%pkdir]%pkz
  78.  *echo.
  79.  *echo %@path[%pkdir]%pkunz will be renamed %@path[%pkdir]%pkunz4
  80.  *echo %@path[%dir4]%unz4 will be copied to %@path[%pkdir]%pkunz
  81.  *echo.
  82.  
  83.  *echo Make the changes? (y/N)
  84.  *set ans=N
  85.  INKEY /w15 %%ans
  86.  iff "%ans"=="Y" then
  87.   *move /q %@path[%pkdir]%pkz %@path[%pkdir]%pkz4
  88.   *copy /q %@path[%dir4]%z4 %@path[%pkdir]%pkz
  89.   *move /q %@path[%pkdir]%pkunz %@path[%pkdir]%pkunz4
  90.   *copy /q %@path[%dir4]%unz4 %@path[%pkdir]%pkunz
  91.  
  92.   *echo.
  93.   *echo ZIP4/UNZIP4 is now in the RENAMED configuration.
  94.   quit 1
  95.  else
  96.   goto notdone
  97.  endiff
  98.  
  99. :: Go back to normal configuration.
  100. else
  101.  
  102.  *move /q %@path[%@path[%pkdir]]pkzip4.exe %@path[%@path[%pkdir]]pkzip.exe
  103.  *move /q %@path[%@path[%pkdir]]pkunzip4.exe %@path[%@path[%pkdir]]pkunzip.exe
  104.  *echo ZIP4/UNZIP4 is now in the NORMAL configuration.
  105.  quit 0
  106. endiff
  107. quit
  108.  
  109. :notdone
  110. echo ZIP4/UNZIP4 configuration remains NORMAL.
  111. quit 0
  112.