home *** CD-ROM | disk | FTP | other *** search
/ Program Metropolis - Software Boutique 95 / SOFTWARECD.iso / ccmail / wutil.mst < prev    next >
Encoding:
Text File  |  1994-04-13  |  2.7 KB  |  86 lines

  1. '************************************************************************
  2. '*                                                                      *
  3. '*              cc:Mail Installation - Common Utilities                 *
  4. '*                                                                      *
  5. '************************************************************************
  6.  
  7.  
  8. '*-------------------------------------------------------------------------
  9. '*  Constant Declarations
  10. '*-------------------------------------------------------------------------
  11. CONST STR_WINVER$       = "cc:Mail 2.0 requires Windows 3.1 or higher."
  12. CONST STR_WINVERTITLE$  = "Incorrect Windows Version"
  13.  
  14. '*-------------------------------------------------------------------------
  15. '*  Subroutine/Function Declarations
  16. '*-------------------------------------------------------------------------
  17. DECLARE FUNCTION CheckWinVer AS INTEGER
  18. DECLARE FUNCTION InvalidPath (szDir$, szMsg$) AS INTEGER
  19. DECLARE FUNCTION AppendPath$ (szSrcPath$, szSubDir$) 
  20.  
  21.  
  22. '*-------------------------------------------------------------------------
  23. '*
  24. '*  CheckWinVer:
  25. '*      Check the Windows version, don't install on 3.0 or below
  26. '*
  27. '*-------------------------------------------------------------------------
  28.  
  29. FUNCTION CheckWinVer STATIC AS INTEGER
  30.  
  31.     nMajor% = GetWindowsMajorVersion()
  32.     IF nMajor% < 3 THEN
  33.         nReturn% = DoMsgBox(STR_WINVER$, STR_WINVERTITLE$, MB_ICONSTOP)
  34.         ERR = 1
  35.         CheckWinVer = 0
  36.     ELSEIF nMajor = 3 THEN
  37.         nMinor% = GetWindowsMinorVersion()
  38.         IF nMinor% = 0 THEN
  39.             nReturn% = DoMsgBox(STR_WINVER$, STR_WINVERTITLE$, MB_ICONSTOP)
  40.             ERR = 1
  41.             CheckWinVer = 0
  42.         END IF
  43.     END IF
  44.  
  45.     CheckWinVer = 1
  46.  
  47. END FUNCTION
  48.  
  49.  
  50. '*-------------------------------------------------------------------------
  51. '*
  52. '*  Invalid Path:
  53. '*      Gives an error message for bad path specified.
  54. '*
  55. '*-------------------------------------------------------------------------
  56.  
  57. FUNCTION InvalidPath (szDir$, szMsg$) STATIC AS INTEGER
  58.  
  59. BADPATH_INIT:
  60.     szTempPath$ = szDir$ + ": " + szMsg$
  61.     nReturn% = DoMsgBox(szTempPath$, "ERROR!", MB_ICONSTOP)
  62.     InvalidPath = 1
  63.  
  64. END FUNCTION
  65.  
  66.  
  67. '*-------------------------------------------------------------------------
  68. '*
  69. '*  AppendPath:
  70. '*      Append a directory name to the specified path
  71. '*
  72. '*-------------------------------------------------------------------------
  73.  
  74. FUNCTION AppendPath$ (szSrcPath$, szSubDir$) STATIC
  75.  
  76.     IF MID$(szSrcPath$, LEN(szSrcPath$), 1) = "\" THEN
  77.         AppendPath$ = szSrcPath$ + szSubDir$
  78.     ELSE
  79.         AppendPath$ = szSrcPath$ + "\" + szSubDir$
  80.     END IF
  81.  
  82. END FUNCTION
  83.  
  84.  
  85.  
  86.