home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0330 - 0339 / ibm0330-0339 / ibm0333.tar / ibm0333 / CCML2104.ZIP / USER.MST < prev    next >
Encoding:
Text File  |  1994-10-05  |  48.7 KB  |  1,566 lines

  1. '************************************************************************
  2. '*                                                                      *
  3. '*               cc:Mail Workstation Installation Script                *
  4. '*                                                                      *
  5. '************************************************************************
  6.  
  7.  
  8. '*-------------------------------------------------------------------------
  9. '*  Includes
  10. '*-------------------------------------------------------------------------
  11.  
  12. '$INCLUDE 'setupapi.inc'
  13. '$INCLUDE 'msdetect.inc'
  14. '$INCLUDE 'winstall.inc'
  15.  
  16. '$INCLUDE 'wutil.mst'
  17.  
  18. '*-------------------------------------------------------------------------
  19. '*  Subroutine/Function Declarations
  20. '*-------------------------------------------------------------------------
  21.  
  22. DECLARE SUB ReadInstallINI
  23. DECLARE SUB DoesMailExist
  24. DECLARE SUB Install
  25. DECLARE SUB SetupProg
  26. DECLARE SUB DoAskQuit
  27. DECLARE SUB SayTooBig
  28. DECLARE SUB SetupWMailIni
  29. DECLARE SUB SetupLotusIni
  30. DECLARE SUB AddPath
  31. DECLARE SUB CheckEnvironment
  32.  
  33. DECLARE FUNCTION InitFunc    AS INTEGER
  34. DECLARE FUNCTION GetUserInfo AS INTEGER
  35. DECLARE FUNCTION GetOptions  AS INTEGER
  36. DECLARE FUNCTION EnoughSpace AS INTEGER
  37. DECLARE FUNCTION SetupWinIni AS INTEGER
  38.  
  39. DECLARE FUNCTION SetIniKey (sz$, sz$, sz$)        AS INTEGER
  40. DECLARE FUNCTION CheckFileVersion (sz$, sz$, sz$) AS INTEGER
  41. DECLARE FUNCTION InvalidPath (sz$, sz$) AS INTEGER
  42. DECLARE FUNCTION AsciiToInt         LIB "mscuistf.dll" (sz$)          AS INTEGER
  43. DECLARE FUNCTION IntToAscii         LIB "mscuistf.dll" (i%,sz$)       AS LONG
  44. DECLARE FUNCTION SzToUpper          LIB "mscuistf.dll" (sz$)          AS INTEGER
  45. DECLARE FUNCTION wCopyDir           LIB "mscuistf.dll" (sz$,sz$,n%)   AS INTEGER
  46. DECLARE FUNCTION wsAddGroup         LIB "mscuistf.dll" (nHinst%,sz$)  AS INTEGER
  47. DECLARE FUNCTION wsCloseGroup       LIB "mscuistf.dll" (sz$)          AS INTEGER
  48. DECLARE FUNCTION wsAddItem          LIB "mscuistf.dll" (sz$,sz$)      AS INTEGER
  49. DECLARE FUNCTION SetFrame           LIB "mscuistf.dll" (nHwndFrame%)  AS INTEGER
  50. DECLARE FUNCTION SetInst            LIB "mscuistf.dll" (nHwndInst%)   AS INTEGER
  51. DECLARE FUNCTION bSetPathInAutoExec LIB "mscuistf.dll" (sz$,n%) AS INTEGER
  52. DECLARE FUNCTION bRenameAutoExec    LIB "mscuistf.dll" () AS INTEGER
  53. DECLARE FUNCTION SetFileTimeForDir  LIB "mscuistf.dll" (sz$,sz$,n%)  AS INTEGER
  54. DECLARE FUNCTION wsAddCmdLine       LIB "mscuistf.dll" (sz$,sz$,sz$,sz$,sz$) AS INTEGER
  55. DECLARE FUNCTION CheckMailEngVer LIB "mscuistf.dll" (sz$, sz$) AS INTEGER
  56. DECLARE FUNCTION MaximizeWindow     LIB "mscuistf.dll" (n%) AS INTEGER
  57. DECLARE FUNCTION GetDriveCurrentDir LIB "mscuistf.dll" (sz$,sz$) AS INTEGER
  58. DECLARE FUNCTION MeLogin            LIB "mscuistf.dll" (sz$,sz$,sz$) AS INTEGER
  59. DECLARE FUNCTION wCopyCannedFiles   LIB "mscuistf.dll" (sz$,sz$,sz$) AS INTEGER
  60. DECLARE FUNCTION DeleteDir          LIB "mscuistf.dll" (sz$) AS INTEGER
  61. DECLARE FUNCTION fileExists         LIB "mscuistf.dll" (sz$) AS INTEGER
  62. DECLARE FUNCTION fileOpen           LIB "mscuistf.dll" (sz$) AS INTEGER
  63. DECLARE FUNCTION ProgressBegin      LIB "mscuistf.dll" (sz$,sz$) AS LONG
  64. DECLARE FUNCTION ProgressEnd        LIB "mscuistf.dll" (n%) AS INTEGER
  65. DECLARE FUNCTION ProgressUpdate     LIB "mscuistf.dll" (n%,sz$) AS INTEGER
  66. DECLARE FUNCTION RemoveKeyFromStr   LIB "mscuistf.dll" (sz$,sz$) AS INTEGER
  67.  
  68.  
  69. '*-------------------------------------------------------------------------
  70. '*  Defines
  71. '*-------------------------------------------------------------------------
  72.  
  73. ''$DEFINE DEBUG            ''Define for script development/debugging
  74.  
  75. CONST CUIDLL$      = "mscuistf.dll"     ''Custom user interface dll
  76. CONST HELPPROC$    = "FHelpDlgProc"     ''Help dialog procedure
  77.  
  78. CONST FILETIME         = "0210"
  79.  
  80. CONST TOTALSPACENEEDED   = 4730000
  81. CONST SPACENEEDED        = 160000
  82.  
  83. CONST FILE_MISSING = 0
  84. CONST FILE_OLDER   = 1
  85. CONST FILE_SAME    = 2
  86. CONST FILE_NEWER   = 3
  87.  
  88.  
  89. '*-------------------------------------------------------------------------
  90. '*  String Constants / Messages
  91. '*-------------------------------------------------------------------------
  92.  
  93. CONST VERSION$              = "200"        '' Mail version number in Win.INI
  94. CONST GROUP_TITLE$          = "cc:Mail"
  95. CONST MAIL_DESCRIPTION$     = "cc:Mail 2.10"
  96. CONST SETUP_DESCRIPTION$    = "cc:Mail Setup"
  97.  
  98. CONST PATH_PO$              = "M:\CCDATA"
  99.  
  100. CONST FILE_WIN_INI$         = "Win.INI"
  101. CONST FILE_INSTALL_INI$     = "Install.INI"
  102.  
  103. CONST INI_SECTION$          = "cc:Mail Setup"
  104. CONST INI_DFLPOPATH$        = "DFLPOPath"
  105. CONST INI_DFLWMAILPATH$     = "DFLWMailPath"
  106. CONST INI_DFLUSERPATH$      = "DFLUserPath"
  107. CONST INI_NOPROMPT$         = "NoPrompt"
  108. CONST INI_COPYALLFILES$     = "CopyAllFiles"
  109. CONST INI_LOCALPROGPATH$    = "LocalWMailPath"
  110. CONST INI_CREATEICON$       = "CreateIcon"
  111. CONST INI_COMMANDLINE$      = "CommandLine"
  112. CONST INI_REMOVEOLDINFO$    = "RemoveOldInfo"
  113. CONST INI_WINDOWSECTION$    = "windows"
  114.  
  115. CONST INI_CCMAILSECTION$    = "cc:Mail"
  116. CONST INI_CC1DIR$           = "CC1DIR"
  117. CONST INI_NAME$             = "Name"
  118.  
  119. ''
  120. ''  Dialog messages /titles
  121. ''
  122.  
  123. CONST STR_ABOUTSTR$    = "Copyright (C) 1994 Lotus Development Corporation."
  124. CONST STR_TITLE$       = "cc:Mail Version 2.10 - Workstation Installation"
  125. CONST STR_ERRTITLE$    = "cc:Mail Setup Error"
  126. CONST STR_CORRUPT$     = "Setup sources were corrupted!"
  127. CONST STR_MAILENABLED$ = "cc:Mail Setup has mail-enabled your Lotus applications."
  128.  
  129.  
  130. '*-------------------------------------------------------------------------
  131. '*  Variables
  132. '*-------------------------------------------------------------------------
  133.  
  134. '*  Integer
  135.  
  136. GLOBAL nHwndFrame%      ''Handle to frame window
  137. GLOBAL nHinst%          ''Application instance
  138. GLOBAL nReturn%         ''Return code for functions
  139. GLOBAL nFlag%   
  140. GLOBAL nMaxArchive%
  141. GLOBAL nTotalApp%
  142. GLOBAL nCursor%
  143. GLOBAL nMailExist%      ''Flag to indicate if cc:Mail already exists
  144.             ''0 = not exist, 1 = older version, 2 = re-install
  145. GLOBAL bOlder%
  146. GLOBAL bNewer%
  147. GLOBAL bMissing%
  148. GLOBAL hwndProg%
  149. GLOBAL bNeedRestart%
  150.  
  151. '*  Long
  152.  
  153. GLOBAL lReturn&
  154. GLOBAL lSpaceAvailable&
  155. GLOBAL lSpaceRequired&
  156.  
  157. '*  Strings
  158.  
  159. GLOBAL szWindowDir$     ''Windows directory
  160. GLOBAL SrcDir$          ''Default source directory
  161. GLOBAL szProgFileDir$   ''Program File Directory
  162. GLOBAL szPODir$         ''Post Office Directory
  163. GLOBAL szUserDir$       ''User directory
  164. GLOBAL szCopyAllFiles$  ''Flag for copying all program files
  165. GLOBAL szIniCopyAllFiles$
  166. GLOBAL szWMailPath$     ''WMail.ini path
  167. GLOBAL szUserName$      ''User name
  168. GLOBAL szTempPath$      ''Tempoaray variable for path
  169. GLOBAL szTemp1$         
  170. GLOBAL szTemp2$
  171. GLOBAL szTemp3$
  172. GLOBAL szVersion$       ''Version number string
  173. GLOBAL szKey$
  174. GLOBAL szRemoveIniInfo$ ''Flag for removing old info from Win.ini
  175. GLOBAL szIcon$
  176. GLOBAL szCmdLine$       
  177. GLOBAL szNoPrompt$      ''Don't prompt the user
  178. GLOBAL szUserID$
  179. GLOBAL szLocalProgPath$ ''Path to local program file directory
  180. GLOBAL szCCMailDir$
  181.  
  182.  
  183.  
  184. '************************************************************************
  185. '*                                                                      *
  186. '*                            Start                                     *
  187. '*                                                                      *
  188. '************************************************************************
  189.  
  190.     '*---------------------------------------------------------------------
  191.     '*  Initialization
  192.     '*---------------------------------------------------------------------
  193.  
  194. INIT:
  195.     IF InitFunc = 0 THEN
  196.     GOTO QUIT
  197.     END IF
  198.  
  199.  
  200.     '*---------------------------------------------------------------------
  201.     '*  Check Windows version, don't install if 3.0 or below
  202.     '*---------------------------------------------------------------------
  203.  
  204.     IF CheckWinVer = 0 THEN
  205.     GOTO QUIT
  206.     END IF
  207.  
  208.  
  209.     '*---------------------------------------------------------------------
  210.     '*  Welcome
  211.     '*---------------------------------------------------------------------
  212.     
  213.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "WelcomeDlgProc", HELP_WKWELCOME, HELPPROC$)
  214.     UIPop 1
  215.     IF sz$ = "EXIT" THEN
  216.     END
  217.     END IF
  218.  
  219.  
  220.     '*---------------------------------------------------------------------
  221.     '*  Main Menu
  222.     '*---------------------------------------------------------------------
  223.  
  224.     MAINMENU_LABEL:
  225.  
  226.     SetSymbolValue "SourceDir", SrcDir$
  227.     sz$ = UIStartDlg(CUIDLL$, WKSTMENU, "WkMenuDlgProc", HELP_WKSTMENU, HELPPROC$)
  228.     IF sz$ = "WkInst" THEN
  229.     UIPop(1)
  230.     ELSEIF sz$ = "REACTIVATE" THEN
  231.     GOTO MAINMENU_LABEL
  232.     ELSE
  233.     END
  234.     END IF
  235.  
  236.  
  237.     '*---------------------------------------------------------------------
  238.     '*  Retrieve defaults from Install.INI, if any
  239.     '*---------------------------------------------------------------------
  240.  
  241.     ReadInstallINI
  242.  
  243.  
  244.     '*---------------------------------------------------------------------
  245.     '*  Check if cc:Mail has already been installed
  246.     '*---------------------------------------------------------------------
  247.  
  248.     DoesMailExist
  249.  
  250.  
  251.     '*---------------------------------------------------------------------
  252.     '*  Get user information
  253.     '*---------------------------------------------------------------------
  254.  
  255.     GETUSERINFO_LABEL:
  256.  
  257.     IF GetUserInfo = 0 THEN
  258.     GOTO MAINMENU_LABEL
  259.     END IF
  260.  
  261.  
  262.     '*---------------------------------------------------------------------
  263.     '*  Installation options
  264.     '*---------------------------------------------------------------------
  265.  
  266.     GETOPTIONS_LABEL:
  267.  
  268.     IF GetOptions = 0 THEN
  269.     GOTO GETUSERINFO_LABEL
  270.     END IF
  271.  
  272.  
  273.     '*---------------------------------------------------------------------
  274.     '*  Check for enough disk space
  275.     '*---------------------------------------------------------------------
  276.  
  277.     IF EnoughSpace = 0 THEN
  278.     SayTooBig
  279.     GOTO GETUSERINFO_LABEL
  280.     END IF
  281.  
  282.  
  283.     '*---------------------------------------------------------------------
  284.     '*  Set up [cc:Mail] information in Win.INI
  285.     '*---------------------------------------------------------------------
  286.  
  287.     IF SetupWinIni = 0 THEN
  288.     GOTO GETUSERINFO_LABEL
  289.     END IF
  290.  
  291.  
  292.     '*---------------------------------------------------------------------
  293.     '*  Copy the files
  294.     '*---------------------------------------------------------------------
  295.  
  296.     Install
  297.  
  298.     n% = ProgressUpdate(hwndProg%, "Configuring cc:Mail...")
  299.  
  300.  
  301.     '*---------------------------------------------------------------------
  302.     '*  Set up information in WMail.INI
  303.     '*---------------------------------------------------------------------
  304.  
  305.     SetupWMailIni
  306.  
  307.  
  308.     '*---------------------------------------------------------------------
  309.     '*  Set cc:Mail program path in Lotus.Ini.
  310.     '*---------------------------------------------------------------------
  311.  
  312.     SetupLotusIni
  313.  
  314.  
  315.     '*---------------------------------------------------------------------
  316.     '*  Build the program group/icon and set up properties if needed
  317.     '*---------------------------------------------------------------------
  318.  
  319.     SetupProg
  320.  
  321.     n% = ProgressEnd(hwndProg%)
  322.     RestoreCursor nCursor%
  323.  
  324.  
  325.     '*---------------------------------------------------------------------
  326.     '*  Put the program directory into the Path variable in Autoexec.bat
  327.     '*---------------------------------------------------------------------
  328.  
  329.     AddPath
  330.  
  331.  
  332.     '*---------------------------------------------------------------------
  333.     '*  Check if the TEMP environment variable is set
  334.     '*---------------------------------------------------------------------
  335.     
  336.     CheckEnvironment
  337.     
  338.  
  339.     '*---------------------------------------------------------------------
  340.     '*  Check if FILES in CONFIG.SYS is at least 30.
  341.     '*---------------------------------------------------------------------
  342.  
  343.     IF GetConfigNumFiles < 30 THEN
  344.     sz$ = UIStartDlg(CUIDLL$, WARN_FILECONFIG, "TempDirDlgProc", 0, "")
  345.     UIPop 1
  346.     END IF
  347.  
  348.  
  349.     '*---------------------------------------------------------------------
  350.     '*  Done
  351.     '*---------------------------------------------------------------------
  352.  
  353. QUIT:
  354.     ON ERROR GOTO ERRQUIT
  355.  
  356.     IF ERR = 0 THEN
  357.     IF bNeedRestart% = 1 THEN
  358.         dlg% = EXITSUCCESS
  359.     ELSE
  360.         dlg% = EXITSUCCESS_NORESTART
  361.     END IF
  362.     ELSEIF ERR = STFQUIT THEN
  363.     dlg% = EXITQUIT
  364.     ELSE
  365.     dlg% = EXITFAILURE
  366.     END IF
  367.  
  368. QUITL1:
  369.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  370.     IF sz$ = "REACTIVATE" THEN
  371.     GOTO QUITL1
  372.     END IF
  373.     UIPop 1
  374.  
  375.     '*---------------------------------------------------------------------
  376.     '*  Exit
  377.     '*---------------------------------------------------------------------
  378.  
  379. DONE:
  380.     END
  381.  
  382.  
  383.  
  384. '*************************************************************************
  385. '**
  386. '** ERRQUIT - exit on error
  387. '**
  388. '*************************************************************************
  389.  
  390.     ERRQUIT:
  391.     
  392.     i% = DoMsgBox(STR_CORRUPT$, STR_ERRTITLE$, MB_OK + MB_TASKMODAL + MB_ICONHAND)
  393.     END
  394.  
  395.  
  396. '*************************************************************************
  397. '**
  398. '** InitFunc
  399. '**     - initialization
  400. '**
  401. '*************************************************************************
  402.  
  403. FUNCTION InitFunc STATIC AS INTEGER
  404.  
  405.     n% = MaximizeWindow(HwndFrame())
  406.  
  407.     SetAbout STR_TITLE$, STR_ABOUTSTR$
  408.  
  409.     SetBitmap CUIDLL$, BMP_LOTUS
  410.     SetTitle  STR_TITLE$
  411.  
  412.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  413.     IF szInf$ = "" THEN
  414.     szInf$ = GetSymbolValue("STF_CWDDIR") + "USER.INF"
  415.     END IF
  416.     ReadInfFile szInf$
  417.  
  418.     ''
  419.     '' Remember the frame window handle and instance
  420.     ''
  421.     nHinst%     = HinstFrame()
  422.     nHwndFrame% = HwndFrame()
  423.     nReturn%    = SetFrame(nHwndFrame%)
  424.     nReturn%    = SetInst(nHinst%)
  425.     bNeedRestart% = 0
  426.  
  427.     ''
  428.     '' Defaults for paths
  429.     ''
  430.     SrcDir$      = GetSymbolValue("STF_SRCDIR")
  431.     szWindowDir$ = GetWindowsDir()              
  432.     szCCMailDir$ = szWindowDir$ + "CCMAIL"      '' default cc:Mail directory
  433.  
  434.     InitFunc = 1
  435.  
  436. END FUNCTION
  437.  
  438.  
  439. '*************************************************************************
  440. '**
  441. '** ReadInstallINI:
  442. '**     Retrieve default values from Install.INI, if any
  443. '**
  444. '*************************************************************************
  445.  
  446. SUB ReadInstallINI STATIC
  447.  
  448.     szTempPath$ = SrcDir$ + FILE_INSTALL_INI
  449.  
  450.     ''  Post office directory
  451.     ''
  452.     szPODir$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_DFLPOPATH$)
  453.     IF szPODir$ = "" THEN
  454.     szPODir$ = PATH_PO$
  455.     END IF
  456.  
  457.     ''  Program file directory
  458.     ''
  459.     szProgFileDir$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_DFLWMAILPATH$)
  460.     szProgFileDir$ = ucase$(szProgFileDir$)
  461.  
  462.     ''  User directory - if not specified, default to CCMAIL\CC1DIR 
  463.     ''  under Windows directory
  464.     ''  
  465.     szUserDir$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_DFLUSERPATH$)
  466.     IF szUserDir$ = "" THEN
  467.     szUserDir$ = AppendPath$(szCCMailDir$, INI_CC1DIR$)
  468.     END IF
  469.     szUserDir$ = ucase$(szUserDir$)
  470.  
  471.     ''  User name
  472.     ''
  473.     szUserName$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_NAME$)
  474.  
  475.     ''  Prompting?
  476.     ''
  477.     szNoPrompt$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_NOPROMPT$)
  478.     IF szNoPrompt$ = "" THEN
  479.     szNoPrompt$ = "N"
  480.     ELSE
  481.     szNoPrompt$ = ucase$(szNoPrompt$)
  482.     END IF
  483.  
  484.     ''  Authorized to copy executables to local drive?
  485.     ''
  486.     szIniCopyAllFiles$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_COPYALLFILES$)
  487.     IF szIniCopyAllFiles$ = "" THEN
  488.     szIniCopyAllFiles$ = "N"
  489.     ELSE
  490.     szIniCopyAllFiles$ = ucase$(szIniCopyAllFiles$)
  491.     END IF
  492.     szCopyAllFiles$ = szIniCopyAllFiles$
  493.  
  494.     ''  Local path for program files if copy all files
  495.     ''
  496.     IF szCopyAllFiles$ = "Y" THEN
  497.     szLocalProgPath$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_LOCALPROGPATH$)
  498.     IF szLocalProgPath$ <> "" THEN
  499.         szCopyAllFiles$ = "Y"
  500.     ELSE
  501.         szCopyAllFiles$ = "N"
  502.     END IF
  503.     END IF
  504.  
  505.     ''  Create new icon after installation?
  506.     ''
  507.     szIcon$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_CREATEICON$)
  508.     IF szIcon$ = "" THEN
  509.     szIcon$ = "Y"
  510.     ELSE
  511.     szIcon$ = ucase$(szIcon$)
  512.     END IF
  513.  
  514.     ''  Set up command line?
  515.     ''
  516.     szCmdLine$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_COMMANDLINE$)
  517.     IF szCmdLine$ = "" THEN
  518.     szCmdLine$ = "Y"
  519.     ELSE
  520.     szCmdLine$ = ucase$(szCmdLine$)
  521.     END IF
  522.  
  523.     ''  Remove old information?
  524.     ''
  525.     szRemoveIniInfo$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_REMOVEOLDINFO$)
  526.     IF szRemoveIniInfo$ = "" THEN
  527.     szRemoveIniInfo$ = "N"
  528.     ELSE
  529.     szRemoveIniInfo$ = ucase$(szRemoveIniInfo$)
  530.     END IF
  531.  
  532. END SUB
  533.  
  534.  
  535. '*************************************************************************
  536. '**
  537. '** DoesMailExist:
  538. '**     Check if cc:Mail already exists.  If yes, check if it is an 
  539. '**     older version or a re-installation of this version.
  540. '**
  541. '*************************************************************************
  542.  
  543. SUB DoesMailExist STATIC
  544.  
  545.     nMailExist% = 0
  546.  
  547.     ''  Does the [cc:Mail] section exist in Win.INI?
  548.     ''
  549.     IF DoesIniSectionExist(FILE_WIN_INI$, INI_CCMAILSECTION$) = 1 THEN
  550.     nMailExist% = 1
  551.     ''
  552.     '' Does the version number exist? 
  553.     ''
  554.     IF DoesIniKeyExist(FILE_WIN_INI$, INI_CCMAILSECTION$, "PROGVER") = 1 THEN
  555.         ''
  556.         '' Check the version number
  557.         ''
  558.         szVersion$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, "PROGVER")
  559.         IF szVersion$ = VERSION$ THEN
  560.         nMailExist% = 2
  561.         END IF
  562.     END IF
  563.     END IF
  564.  
  565. END SUB
  566.  
  567.  
  568. '*************************************************************************
  569. '**
  570. '** GetUserInfo
  571. '**     Prompt for user information
  572. '**
  573. '*************************************************************************
  574.  
  575. FUNCTION GetUserInfo STATIC AS INTEGER
  576.  
  577.     USERINFO_LABEL:
  578.  
  579.     SetSymbolValue "POPathOut",     szPODir$
  580.     SetSymbolValue "UserNameOut",   szUserName$
  581.     SetSymbolValue "UserPswdOut",   szPassword$
  582.     SetSymbolValue "ProgPathOut",   szProgFileDir$
  583.     SetSymbolValue "ccMailPathOut", szCCMailDir$
  584.  
  585.     IF szNoPrompt$ = "N" THEN
  586.  
  587.     USERINFO_DLG:
  588.  
  589.     sz$ = UIStartDlg(CUIDLL$, USERINFO, "UserInfoDlgProc", HELP_USERINFO, HELPPROC$)
  590.  
  591.     IF sz$ = "CONTINUE" THEN
  592.         szPODir$    = GetSymbolValue("POPathOut")
  593.         szUserName$ = GetSymbolValue("UserNameOut")
  594. ''            szPassword$ = GetSymbolValue("UserPswdOut")
  595.         szProgFileDir$ = GetSymbolValue("ProgPathOut")
  596.         szCCMailDir$ = GetSymbolValue("ccMailPathOut")
  597.  
  598.         ''
  599.         ''  Check if the post office path is valid.
  600.         ''
  601.         szTempPath$ = szPODir$ + "\MLANDATA"
  602.         IF fileExists(szTempPath$) = 0 THEN
  603.         nReturn% = InvalidPath(szPODir$, "Not a post office directory")
  604.         GOTO USERINFO_DLG
  605.         END IF
  606.         IF DoesFileExist(szTempPath$, femReadWrite) = 0 THEN
  607.         UIPop 1
  608.         nReturn% = InvalidPath(szPODir$, "Does not have read/write access")
  609.         GOTO USERINFO_DLG
  610.         END IF
  611.  
  612.  
  613.         ''
  614.         ''  Don't check login because workstation setup may be run
  615.         ''  by the administrator.
  616.         ''
  617.         ''  IF MeLogin(szUserName$, szPassword$, szPODir$) = 0 THEN
  618.         ''      UIPop 1
  619.         ''      GOTO USERINFO_DLG
  620.         ''  END IF
  621.  
  622.         ''
  623.         ''  Check if the cc:Mail path only contains drive letter.  
  624.         ''  If yes, get the complete path.
  625.         ''
  626.         IF (LEN(szCCMailDir$) = 2) AND (INSTR(1, szCCMailDir$, ":")) THEN
  627.         nReturn% = GetDriveCurrentDir(szCCMailDir$, szCCMailDir$)
  628.         END IF
  629.  
  630.         ''
  631.         ''  Check if the cc:Mail path is valid
  632.         ''
  633.         IF IsDriveValid(szCCMailDir$) = 0 THEN
  634.         UIPop 1
  635.         nReturn% = InvalidPath(szCCMailDir$, "Drive for cc:Mail directory is not valid")
  636.         GOTO USERINFO_DLG
  637.         END IF
  638.         IF DoesDirExist(szCCMailDir$) = 0 THEN
  639.         CreateDir szCCMailDir$, cmoNone
  640.         IF DoesDirExist(szCCMailDir$) = 0 THEN
  641.             UIPop 1
  642.             nReturn% = InvalidPath(szCCMailDir$, "cc:Mail directory is not valid")
  643.             GOTO USERINFO_DLG
  644.         END IF
  645.         END IF
  646.  
  647.         ''
  648.         ''  Check if the program path is valid
  649.         ''
  650.         szTempPath$ = szProgFileDir$ + "\WMail.EXE"
  651.  
  652.         IF fileOpen(szTempPath$) = 0 THEN
  653.         UIPop 1
  654.         nReturn% = InvalidPath(szProgFileDir$, "Cannot find program files")
  655.         GOTO USERINFO_DLG
  656.         END IF
  657.  
  658.         UIPop 1
  659.  
  660.         '' 
  661.         ''  Update user directory variable
  662.         ''
  663.         szUserDir$ = AppendPath$(szCCMailDir$, "CC1DIR")
  664.  
  665.         GetUserInfo = 1
  666.  
  667.     ELSEIF sz$ = "REACTIVATE" THEN
  668.         GOTO USERINFO_DLG
  669.     ELSEIF sz$ = "BACK" THEN
  670.         UIPop 1
  671.         GetUserInfo = 0
  672.     ELSE
  673.         UIPop 1
  674.         DoAskQuit
  675.         GOTO USERINFO_DLG
  676.     END IF
  677.  
  678.     ELSE
  679.     '' No prompt
  680.     ''
  681.     '' If any one of the necessary parameters is missing, error
  682.     ''
  683.     IF (szPODir$ = "") OR (szUserName$ = "") OR (szProgFileDir$ = "") OR (szCCMailDir$ = "") THEN
  684.         GOTO USERINFO_DLG
  685.     END IF
  686.  
  687.     ''
  688.     ''  Check if the post office path is valid.
  689.     ''
  690.     szTempPath$ = szPODir$ + "\MLANDATA"
  691.     IF fileExists(szTempPath$) = 0 THEN
  692.         nReturn% = InvalidPath(szPODir$, "Not a post office directory")
  693.         GOTO USERINFO_DLG
  694.     END IF
  695.     IF DoesFileExist(szTempPath$, femReadWrite) = 0 THEN
  696.         nReturn% = InvalidPath(szPODir$, "Does not have read/write access")
  697.         GOTO USERINFO_DLG
  698.     END IF
  699.  
  700.     ''
  701.     ''  Check if the cc:Mail path only contains drive letter.  
  702.     ''  If yes, get the complete path.
  703.     ''
  704.     IF (LEN(szCCMailDir$) = 2) AND (INSTR(1, szCCMailDir$, ":")) THEN
  705.         nReturn% = GetDriveCurrentDir(szCCMailDir$, szCCMailDir$)
  706.     END IF
  707.  
  708.     ''
  709.     ''  Check if the cc:Mail path is valid
  710.     ''
  711.     IF IsDriveValid(szCCMailDir$) = 0 THEN
  712.         nReturn% = InvalidPath(szCCMailDir$, "Drive for cc:Mail directory is not valid")
  713.         GOTO USERINFO_DLG
  714.     END IF
  715.     IF DoesDirExist(szCCMailDir$) = 0 THEN
  716.         CreateDir szCCMailDir$, cmoNone
  717.         IF DoesDirExist(szCCMailDir$) = 0 THEN
  718.         nReturn% = InvalidPath(szCCMailDir$, "cc:Mail directory is not valid")
  719.         GOTO USERINFO_DLG
  720.         END IF
  721.     END IF
  722.  
  723.     ''
  724.     ''  Check if the program path is valid
  725.     ''
  726.     szTempPath$ = szProgFileDir$ + "\WMail.EXE"
  727.     IF fileOpen(szTempPath$) = 0 THEN
  728.         nReturn% = InvalidPath(szProgFileDir$, "Cannot find program files")
  729.         GOTO USERINFO_DLG
  730.     END IF
  731.  
  732.  
  733.     '' 
  734.     ''  Update user directory variable
  735.     ''
  736.     szUserDir$ = AppendPath$(szCCMailDir$, "CC1DIR")
  737.  
  738.     GetUserInfo = 1
  739.  
  740.     END IF
  741.  
  742. END FUNCTION
  743.  
  744.  
  745.  
  746. '*************************************************************************
  747. '**
  748. '** GetOptions
  749. '**     Prompt for installation options
  750. '**
  751. '*************************************************************************
  752.  
  753. FUNCTION GetOptions STATIC AS INTEGER
  754.  
  755.     OPTIONS_INIT:
  756.  
  757.     SetSymbolValue "CopyAllFiles",     szCopyAllFiles$
  758.     SetSymbolValue "CreateIcon",       szIcon$
  759.     SetSymbolValue "CommandLine",      szCmdLine$
  760.     SetSymbolValue "RemoveOldInfo",    szRemoveIniInfo$
  761.     SetSymbolValue "LocalProgPathOut", szLocalProgPath$
  762.  
  763.     IF szNoPrompt$ = "N" THEN
  764.  
  765.     OPTIONS_DLG:
  766.  
  767.     IF szIniCopyAllFiles$ = "Y" THEN
  768.         sz$ = UIStartDlg(CUIDLL$, WKOPTIONS1, "WkOptions1DlgProc", HELP_WKOPTIONS1, HELPPROC$)
  769.     ELSE
  770.         sz$ = UIStartDlg(CUIDLL$, WKOPTIONS2, "WkOptions2DlgProc", HELP_WKOPTIONS2, HELPPROC$)
  771.     END IF
  772.      
  773.     IF sz$ = "CONTINUE" THEN
  774.         szCopyAllFiles$  = GetSymbolValue("CopyAllFiles")
  775.         szIcon$          = GetSymbolValue("CreateIcon")
  776.         szCmdLine$       = GetSymbolValue("CommandLine")
  777.         szLocalProgPath$ = GetSymbolValue("LocalProgPathOut")
  778.         szRemoveIniInfo$ = GetSymbolValue("RemoveOldInfo")
  779.  
  780.         SetSymbolValue "CopyAllFiles",  szCopyAllFiles$
  781.         SetSymbolValue "CreateIcon",    szIcon$
  782.         SetSymbolValue "CommandLine",   szCmdLine$
  783.         SetSymbolValue "LocalProgPathOut",   szLocalProgPath$
  784.         SetSymbolValue "RemoveOldInfo", szRemoveIniInfo$
  785.  
  786.         IF szCopyAllFiles$ = "Y" THEN
  787.         IF IsDirWritable(szLocalProgPath$) = 0 THEN
  788.             nReturn% = InvalidPath(szLocalProgPath$, "Invalid destination program path")
  789.             UIPop 1
  790.             GOTO OPTIONS_INIT
  791.         END IF
  792.         END IF
  793.         UIPop 1
  794.  
  795.         GetOptions = 1
  796.  
  797.     ELSEIF sz$ = "REACTIVATE" THEN
  798.         GOTO OPTIONS_DLG
  799.     ELSEIF sz$ = "BACK" THEN
  800.         UIPop 1
  801.         GetOptions = 0
  802.     ELSE
  803.         UIPop 1
  804.         DoAskQuit
  805.         GOTO OPTIONS_DLG
  806.     END IF
  807.  
  808.     ELSE
  809.  
  810.     ''
  811.     ''  Check if COPYALLFILES set Y and then goto OPTIONS_DLG no matter
  812.     ''  what.  This will ensure the destination directory get entered.
  813.     ''
  814.     ''  Fixed by RC 9-15-93
  815.     ''
  816.     IF (szCopyAllFiles$ = "Y") AND ((szLocalProgPath$ = "") OR (IsDirWritable(szLocalProgPath$) = 0)) THEN
  817.         GOTO OPTIONS_DLG
  818.     END IF
  819.  
  820.     GetOptions = 1
  821.  
  822.     END IF
  823.  
  824. END FUNCTION
  825.  
  826.  
  827. '*************************************************************************
  828. '**
  829. '** EnoughSpace
  830. '**     Check if there is enough disk space 
  831. '**
  832. '*************************************************************************
  833.  
  834. FUNCTION EnoughSpace STATIC AS INTEGER
  835.  
  836.     IF szCopyAllFiles$ = "Y" THEN
  837.     lSpaceAvailable& = GetFreeSpaceForDrive(szLocalProgPath$)
  838.     lSpaceRequired& = TOTALSPACENEEDED
  839.     ELSE
  840.     lSpaceAvailable& = GetFreeSpaceForDrive(szUserDir$)
  841.     lSpaceRequired& = SPACENEEDED
  842.     ENDIF
  843.     IF lSpaceAvailable& < lSpaceRequired& THEN
  844.     EnoughSpace = 0
  845.     ELSE
  846.     EnoughSpace = 1
  847.     END IF
  848.  
  849. END FUNCTION
  850.  
  851.  
  852. '*************************************************************************
  853. '**
  854. '** SetupWinIni
  855. '**     Set up [cc:Mail] information in Win.INI
  856. '**
  857. '*************************************************************************
  858.  
  859. FUNCTION SetupWinIni STATIC AS INTEGER
  860.  
  861.     '*---------------------------------------------------------------------
  862.     '*  Set up new cc:Mail section
  863.     '*---------------------------------------------------------------------
  864.  
  865.     szuUserName$ = ucase$(szUserName$)
  866.  
  867.     IF nMailExist% = 2 THEN
  868.     ''
  869.     ''  If we're re-installing, need to retrieve the highest user ID 
  870.     ''  number and go through the list to see if this user already 
  871.     ''  existed.  If yes, modify the corresponding user entry.  
  872.     ''  Otherwise, create a new entry.
  873.     ''
  874.     szUserID$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, "LastIDUsed")
  875.     nReturn% = 0
  876.     nFlag% = AsciiToInt(szUserID$)
  877.     nOtherUserID% = 0
  878.     nSameUserFound% = 0
  879.  
  880.     FOR i% = 1 TO nFlag% STEP 1
  881.         lReturn& = IntToAscii(i%, szTemp2$) 
  882.         szKey$ = "User" + szTemp2$ + "Name"
  883.         szTemp1$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$)
  884.         szTemp1$ = ucase$(szTemp1$)
  885.         IF szTemp1$ = ucase$(szUserName$) THEN
  886.         ''
  887.         ''  User name found.  Compare post office directory 
  888.         ''  to make sure it's really the same user.
  889.         ''
  890.         szTemp1$ = "User" + szTemp2$ + "Dir"
  891.         szTemp1$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, szTemp1$)
  892.         szTemp1$ = szTemp1$ + "\WMAIL.INI"
  893.         szTemp1$ = GetIniKeyString(szTemp1$, INI_CCMAILSECTION$, "Path")
  894.  
  895.         IF (szTemp1$ <> "") AND (ucase$(szTemp1$) <> ucase$(szPODir$)) THEN
  896.             nNewPOPath% = 1
  897.             nOtherUserID% = i%
  898.             GOTO CONTINUE_LABEL
  899.         ELSE
  900.             nNewPOPath% = 0
  901.         END IF
  902.  
  903.         ''
  904.         ''  User found!
  905.         ''
  906.         lReturn& = IntToAscii(i%, szTemp2$) 
  907.         szKey$ = "User" + szTemp2$ + "Dir"
  908.         szUserDir$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$)  
  909.         IF (szUserDir$ <> "") THEN
  910.             szTemp3$ = AppendPath$(szUserDir$, "WMail.INI")
  911.         ELSE
  912.             szUserDir$ = AppendPath$(szCCMailDir$, "CC"+szTemp2$+"DIR")
  913.             GOTO JUST_INSERT_DIR
  914.         END IF
  915.  
  916.         IF DoesFileExist(szTemp3$, femRead) = 1 THEN
  917.  
  918.             USERDIR_1:
  919.  
  920.             IF nNewPOPath% = 1 THEN
  921.             sz$ = UIStartDlg(CUIDLL$, SAMEUSER, "UserDirDlgProc", HELP_USERDIR2, HELPPROC$)
  922.             ELSE
  923.             sz$ = UIStartDlg(CUIDLL$, USERDIREXIST, "UserDirDlgProc", HELP_USERDIR1, HELPPROC$)
  924.             END IF
  925.             UIPop 1
  926.             nSameUserFound% = 1
  927.               
  928.             IF sz$ = "UPDATE" THEN
  929.             ''
  930.             '' Just do an update.  
  931.             ''
  932.             GOTO OUT2
  933.             
  934.             ELSEIF sz$ = "OVERWRITE" THEN
  935.             ''
  936.             '' Clean up user directory so we can copy new files.
  937.             ''
  938.             nReturn% = DeleteDir(szUserDir$)
  939.             GOTO OUT2
  940.  
  941.             ELSE
  942.             ''
  943.             '' Create new user directory.
  944.             ''
  945.             nReturn% = 0
  946.             GOTO OUT1
  947.             END IF
  948.  
  949.             CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$, szUserDir$, cmoOverwrite
  950.  
  951.         ELSE
  952.             JUST_INSERT_DIR:
  953.             CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$, szUserDir$, cmoOverwrite
  954.             nReturn% = 1
  955.         END IF
  956.         END IF
  957.  
  958.         CONTINUE_LABEL:
  959.  
  960.     NEXT i%   
  961.  
  962.  
  963.     IF (nSameUserFound% = 0) AND (nNewPOPath% = 1) AND (nOtherUserID% > 0) THEN
  964.          lReturn& = IntToAscii(nOtherUserID%, szTemp2$) 
  965.          szKey$ = "User" + szTemp2$ + "Dir"
  966.          szUserDir$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$)  
  967.          szTemp3$ = AppendPath$(szUserDir$, "WMail.INI")
  968.  
  969.          IF DoesFileExist(szTemp3$, femRead) = 1 THEN
  970.          sz$ = UIStartDlg(CUIDLL$, SAMEUSER, "UserDirDlgProc", HELP_USERDIR2, HELPPROC$)
  971.          UIPop 1
  972.          nSameUserFound% = 1
  973.               
  974.          IF sz$ = "UPDATE" THEN
  975.              GOTO OUT2
  976.             
  977.          ELSEIF sz$ = "OVERWRITE" THEN
  978.              nReturn% = DeleteDir(szUserDir$)
  979.              GOTO OUT2
  980.  
  981.          ELSE
  982.              nReturn% = 0
  983.              GOTO OUT1
  984.          END IF
  985.  
  986.          CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$, szUserDir$, cmoOverwrite
  987.  
  988.          ELSE
  989.          CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$, szUserDir$, cmoOverwrite
  990.          nReturn% = 1
  991.          END IF
  992.     END IF
  993.  
  994.  
  995.     OUT1:
  996.     ''
  997.     ''  Have we found the user?  If not, create values for him.       
  998.     ''
  999.     IF nReturn% = 0 THEN
  1000.         nFlag% = nFlag% + 1
  1001.         lReturn& = IntToAscii(nFlag%, szTemp2$)
  1002.         szKey$ = "User" + szTemp2$ + "Name"
  1003.         CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$, szUserName$, cmoOverwrite
  1004.         szKey$ = "User" + szTemp2$ + "Dir"
  1005.         szTemp3$ = "CC" + szTemp2$ + "DIR"
  1006.         szUserDir$ = AppendPath$(szCCMailDir$, szTemp3$)
  1007.         CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$, szUserDir$, cmoOverwrite
  1008.         '' 
  1009.         ''  Update the highest user ID since we added one.
  1010.         ''
  1011.         CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, "LastIDUsed", szTemp2$, cmoOverwrite
  1012.     END IF
  1013.  
  1014.     ELSE    '' IF nMailExist% <> 2
  1015.     ''
  1016.     ''  These keywords are new from 2.01
  1017.     '' 
  1018.     CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, "User1Name", szUserName$, cmoOverwrite
  1019.     CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, "User1Dir", szUserDir$, cmoOverwrite
  1020.     CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, "LastIDUsed", "1", cmoOverwrite
  1021.     CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, "LastUserID", "1", cmoOverwrite
  1022.     END IF
  1023.  
  1024.     OUT2:
  1025.  
  1026.     '*---------------------------------------------------------------------
  1027.     '*  Set up program path
  1028.     '*---------------------------------------------------------------------
  1029.     ''
  1030.     ''  Check if an old Program Path already exists.  If yes, remember the
  1031.     ''  path so we can try to remove the path from Autoexec.bat.
  1032.     ''
  1033.     IF (szCopyAllFiles = "Y") AND (szLocalProgPath$ <> "") THEN
  1034.     CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, "ProgramPath", szLocalProgPath$, cmoOverwrite
  1035.     ELSE
  1036.     CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, "ProgramPath", szProgFileDir$, cmoOverwrite
  1037.     END IF
  1038.  
  1039.  
  1040.     '*---------------------------------------------------------------------
  1041.     '*  Set up default user directory (empty)
  1042.     '*---------------------------------------------------------------------
  1043.  
  1044.     CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, "User0Dir", szCCMailDir$, cmoOverwrite
  1045.  
  1046.  
  1047.     '*---------------------------------------------------------------------
  1048.     '*  Set up SMI keyword in Mail section of Win.INI
  1049.     '*---------------------------------------------------------------------
  1050.  
  1051.     CreateIniKeyValue FILE_WIN_INI$, "Mail", "SMI", "1", cmoOverwrite
  1052.  
  1053.  
  1054.     '*---------------------------------------------------------------------
  1055.     '*  Set up program version
  1056.     '*---------------------------------------------------------------------
  1057.  
  1058.     CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, "PROGVER", "200", cmoOverwrite
  1059.  
  1060.  
  1061.     '*---------------------------------------------------------------------
  1062.     '*  Update the LotusMail section:
  1063.     '*      If the section does not exist, create it.
  1064.     '*      If the Mail application specified is WMail, update program path.
  1065.     '*---------------------------------------------------------------------
  1066.  
  1067.     IF DoesIniSectionExist(FILE_WIN_INI$, "LotusMail") = 0 THEN
  1068.     CreateIniKeyValue FILE_WIN_INI$, "LotusMail", "Application", "wMail", cmoOverwrite
  1069.     szTempPath$ = szProgFileDir$ + "\WMAIL.EXE SENDMAIL"
  1070.     CreateIniKeyValue FILE_WIN_INI$, "LotusMail", "Program", szTempPath$, cmoOverwrite
  1071.     ELSE
  1072.     szTempPath$ = GetIniKeyString(FILE_WIN_INI$, "LotusMail", "Application")
  1073.     nReturn% = SzToUpper(szTempPath$)
  1074.     IF szTempPath$ = "WMAIL" THEN
  1075.         szTempPath$ = szProgFileDir$ + "\WMAIL.EXE SENDMAIL"
  1076.         CreateIniKeyValue FILE_WIN_INI$, "LotusMail", "Program", szTempPath$, cmoOverwrite
  1077.     END IF
  1078.     END IF
  1079.  
  1080.  
  1081.     '*---------------------------------------------------------------------
  1082.     '*  Remove LOAD and RUN for WNotify
  1083.     '*---------------------------------------------------------------------
  1084.  
  1085.     szKey$ = GetIniKeyString(FILE_WIN_INI$, INI_WINDOWSECTION$, "Load")
  1086.     IF szKey$ <> "" THEN
  1087.     IF RemoveKeyFromStr(szKey$, "WNOTIFY") = 1 THEN
  1088.         CreateIniKeyValue FILE_WIN_INI$, INI_WINDOWSECTION$, "Load", szKey$, cmoOverwrite
  1089.     END IF
  1090.     END IF
  1091.  
  1092.     szKey$ = GetIniKeyString(FILE_WIN_INI$, INI_WINDOWSECTION$, "Run")
  1093.     IF szKey$ <> "" THEN
  1094.     IF RemoveKeyFromStr(szKey$, "WNOTIFY") = 1 THEN
  1095.         CreateIniKeyValue FILE_WIN_INI$, INI_WINDOWSECTION$, "Run", szKey$, cmoOverwrite
  1096.     END IF
  1097.     END IF
  1098.  
  1099.  
  1100.     SetupWinIni = 1
  1101.     GOTO OUT_SETUPWININI
  1102.     
  1103. BACK_SETUPWININI:
  1104.     SetupWinIni = 0
  1105.  
  1106. OUT_SETUPWININI: 
  1107.     
  1108. END FUNCTION
  1109.  
  1110.  
  1111.  
  1112. '*************************************************************************
  1113. '**
  1114. '** SetupWMailIni
  1115. '**     Setup information in WMail.INI
  1116. '**
  1117. '*************************************************************************
  1118.  
  1119. SUB SetupWMailIni STATIC
  1120.  
  1121.     szWMailPath$ = AppendPath$(szUserDir$, "WMail.INI")
  1122.  
  1123.     CreateIniKeyValue szWMailPath$, INI_CCMAILSECTION$, "Path", szPODir$, cmoOverwrite
  1124.     CreateIniKeyValue szWMailPath$, INI_CCMAILSECTION$, "Name", szUserName$, cmoOverwrite
  1125.  
  1126.     IF (nMailExist% = 1) OR (nMailExist% = 2) THEN
  1127.     ''
  1128.     ''  Older versions of cc:Mail exist.  Move info to WMail.INI.
  1129.     ''
  1130.     n% = SetIniKey(szWMailPath$, INI_CCMAILSECTION$, "SaveWindow")
  1131.     n% = SetIniKey(szWMailPath$, INI_CCMAILSECTION$, "FaxExt")
  1132.     n% = SetIniKey(szWMailPath$, INI_CCMAILSECTION$, "InboxCacheSize")
  1133.     n% = SetIniKey(szWMailPath$, INI_CCMAILSECTION$, "Mono")
  1134.     n% = SetIniKey(szWMailPath$, INI_CCMAILSECTION$, "SmartIconTextEnabled")
  1135.  
  1136.     ''
  1137.     ''  If [cc:Edit] section exists in WMail.INI, just use the 
  1138.     ''  defaults from there and ignore the old values.
  1139.     ''
  1140.     nMoveEdit% = 1
  1141.     IF DoesIniSectionExist(szWMailPath$, "cc:Edit") = 1 THEN
  1142.         ''
  1143.         ''  Is it only an empty section?
  1144.         ''
  1145.         IF DoesIniKeyExist(szWMailPath$,"cc:Edit","EnableMargins") = 1 THEN
  1146.         nMoveEdit% = 0
  1147.         ELSEIF DoesIniKeyExist(szWMailPath$,"cc:Edit","TabStops") = 1 THEN
  1148.         nMoveEdit% = 0
  1149.         ELSEIF DoesIniKeyExist(szWMailPath$,"cc:Edit","LMargin") = 1 THEN
  1150.         nMoveEdit% = 0
  1151.         ELSEIF DoesIniKeyExist(szWMailPath$,"cc:Edit","RMargin") = 1 THEN
  1152.         nMoveEdit% = 0
  1153.         ELSEIF DoesIniKeyExist(szWMailPath$,"cc:Edit","ShowRuler") = 1 THEN
  1154.         nMoveEdit% = 0
  1155.         ELSEIF DoesIniKeyExist(szWMailPath$,"cc:Edit","DefAttr") = 1 THEN
  1156.         nMoveEdit% = 0
  1157.         END IF
  1158.  
  1159.     END IF
  1160.         
  1161.     IF nMoveEdit% = 1 THEN
  1162.         n% = SetIniKey(szWMailPath$, "cc:Edit", "EnableMargins")
  1163.         n% = SetIniKey(szWMailPath$, "cc:Edit", "TabStops")
  1164.         n% = SetIniKey(szWMailPath$, "cc:Edit", "LMargin")
  1165.         n% = SetIniKey(szWMailPath$, "cc:Edit", "RMargin")
  1166.         n% = SetIniKey(szWMailPath$, "cc:Edit", "DefAttr")
  1167.         n% = SetIniKey(szWMailPath$, "cc:Edit", "ShowRuler")
  1168.     END IF
  1169.  
  1170.     IF DoesIniKeyExist(szWMailPath$, "cc:Archive", "MaxArchive") = 0 THEN
  1171.         szKey$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, "MaxArchive")
  1172.         IF szKey$ <> "" THEN
  1173.         CreateIniKeyValue szWMailPath$, "cc:Archive", "MaxArchive", szKey$, cmoOverwrite
  1174.      
  1175.         nMaxArchive% = AsciiToInt(szKey$)
  1176.         FOR i% = 1 TO nMaxArchive% STEP 1
  1177.             lReturn& = IntToAscii(i%, szTemp2$)
  1178.             szKey$ = "Archive#" + szTemp2$
  1179.             szTemp1$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$)
  1180.             IF szTemp1$ <> "" THEN
  1181.             CreateIniKeyValue szWMailPath$, "cc:Archive", szKey$, szTemp1$, cmoOverwrite
  1182.             END IF
  1183.         NEXT i%
  1184.         END IF
  1185.     END IF
  1186.  
  1187.     IF DoesIniKeyExist(szWMailPath$, INI_CCMAILSECTION$, "TotalApps") = 0 THEN
  1188.         szKey$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, "TotalApps")
  1189.         IF szKey$ <> "" THEN
  1190.         CreateIniKeyValue szWMailPath$,  INI_CCMAILSECTION$, "TotalApps", szKey$, cmoOverwrite
  1191.         END IF
  1192.  
  1193.         nTotalApp% = AsciiToInt(szKey$)
  1194.         FOR i% = 1 TO nTotalApp% STEP 1
  1195.         lReturn& = IntToAscii(i%, szTemp2$)
  1196.         szKey$ = "APP" + szTemp2$
  1197.         szTemp1$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$)
  1198.         IF szTemp1$ <> "" THEN
  1199.             CreateIniKeyValue szWMailPath$, INI_CCMAILSECTION$, szKey$, szTemp1$, cmoOverwrite
  1200.         END IF
  1201.         NEXT i%
  1202.  
  1203.         szKey$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, "LastAppID")
  1204.         IF szKey$ <> "" THEN
  1205.         CreateIniKeyValue szWMailPath$, INI_CCMAILSECTION$, "LastAppID", szKey$, cmoOverwrite
  1206.         END IF
  1207.     END IF
  1208.  
  1209.     ''
  1210.     ''  If moving INI section info, delete original section.
  1211.     ''
  1212.     IF szRemoveIniInfo$ = "Y" THEN
  1213.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Path", cmoNone
  1214.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Name", cmoNone
  1215.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Password", cmoNone
  1216.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "DefaultWorkPath", cmoNone
  1217.  
  1218.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "SaveWindow", cmoNone
  1219.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "MaxArchive", cmoNone
  1220.         FOR i% = 1 TO nMaxArchive% STEP 1
  1221.         lReturn& = IntToAscii(i%, szTemp2$)
  1222.         szKey$ = "Archive#" + szTemp2$
  1223.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$, cmoNone
  1224.         NEXT i%
  1225.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Compress", cmoNone
  1226.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "TotalApps", cmoNone
  1227.         FOR i% = 1 TO nTotalApp% STEP 1
  1228.         lReturn& = IntToAscii(i%, szTemp2$)
  1229.         szKey$ = "APP" + szTemp2$
  1230.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$, cmoNone
  1231.         NEXT i%
  1232.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "LastAppID", cmoNone
  1233.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "FaxExt", cmoNone
  1234.    
  1235.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "InboxCacheSize", cmoNone
  1236.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "BBoardCacheSize", cmoNone
  1237.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "FolderCacheSize", cmoNone
  1238.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "ArchiveCacheSize", cmoNone
  1239.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "OS2Cache", cmoNone
  1240.  
  1241.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "List", cmoNone
  1242.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Options", cmoNone
  1243.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Confirm", cmoNone
  1244.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Message", cmoNone
  1245.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Notify", cmoNone
  1246.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "InboxPollInterval", cmoNone
  1247.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "BBoardPollInterval", cmoNone
  1248.  
  1249.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Fax Scale", cmoNone
  1250.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "View Style", cmoNone
  1251.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Horz Pages", cmoNone
  1252.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Vert Pages", cmoNone
  1253.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Use Print Offset", cmoNone
  1254.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "FindX", cmoNone
  1255.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "FindY", cmoNone
  1256.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "SystemResourceCheck", cmoNone
  1257.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "PrMargin", cmoNone
  1258.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "TextEditorExt", cmoNone
  1259.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "GraphicsEditorExt", cmoNone
  1260.       
  1261.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "InboxFont", cmoNone
  1262.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "BBListFont", cmoNone
  1263.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "BBoardFont", cmoNone
  1264.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "MListFont", cmoNone
  1265.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "MListListFont", cmoNone
  1266.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "PrivMListListFont", cmoNone
  1267.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "PrivMListFont", cmoNone
  1268.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "DirFont", cmoNone
  1269.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "FolderListFont", cmoNone
  1270.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "FolderFont", cmoNone
  1271.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "EditFont", cmoNone
  1272.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "MessageFont", cmoNone
  1273.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "AllFont", cmoNone
  1274.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Error!Font", cmoNone
  1275.   
  1276.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "MultiLogin", cmoNone
  1277.  
  1278.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "SmartIconTextEnable", cmoNone
  1279.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Mono", cmoNone
  1280.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "EnableMargins", cmoNone
  1281.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "TabStops", cmoNone
  1282.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "LMargin", cmoNone
  1283.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "RMargin", cmoNone
  1284.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "DefAttr", cmoNone
  1285.         RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "ShowRuler", cmoNone
  1286.    
  1287.         szTempPath$ = GetWindowsDir() + "ccMail.CFG"
  1288.         RemoveFile szTempPath$, cmoNone
  1289.     END IF
  1290.     END IF
  1291.  
  1292. END SUB
  1293.  
  1294.  
  1295. '*************************************************************************
  1296. '**
  1297. '** SetupLotusIni
  1298. '**     Set up the Lotus.INI file - our program path
  1299. '**
  1300. '*************************************************************************
  1301.  
  1302. SUB SetupLotusIni STATIC
  1303.  
  1304.     szTempPath$ = szWindowDir$ + "Lotus.INI"
  1305.     IF (szCopyAllFiles = "Y") AND (szLocalProgPath$ <> "") THEN
  1306.     szTemp1$ = szLocalProgPath$ + "\WMAIL.EXE cc:Mail"
  1307.     ELSE
  1308.     szTemp1$ = szProgFileDir$ + "\WMAIL.EXE cc:Mail"
  1309.     END IF
  1310.     CreateIniKeyValue szTempPath$, "Lotus Applications", "ccMail", szTemp1$, cmoOverwrite
  1311.  
  1312. END SUB
  1313.  
  1314.  
  1315. '*************************************************************************
  1316. '**
  1317. '** SetupProg
  1318. '**     - Build the group file, icon and program properties
  1319. '**
  1320. '*************************************************************************
  1321.  
  1322. SUB SetupProg STATIC
  1323.  
  1324.     IF szIcon$ = "Y" THEN
  1325.  
  1326.     IF (szCopyAllFiles = "Y") AND (szLocalProgPath$ <> "") THEN
  1327.         szTemp1$ = szLocalProgPath$
  1328.     ELSE
  1329.         szTemp1$ = szProgFileDir$
  1330.     END IF
  1331.  
  1332.     IF wsAddGroup(nHinst%, GROUP_TITLE$) = 1 THEN
  1333.  
  1334.         IF szCmdLine$ = "Y" THEN
  1335.         szTempPath$ = szTemp1$ + "\WMail.EXE" 
  1336.         nReturn% = wsAddCmdLine(MAIL_DESCRIPTION$, szTempPath$, szPODir$, szUserName$, "PASSWORD")
  1337.         ELSE
  1338.         szTempPath$ = szTemp1$ + "\WMail.EXE " 
  1339.         nReturn% = wsAddItem(MAIL_DESCRIPTION$, szTempPath$)
  1340.         END IF
  1341.  
  1342.         nReturn% = wsAddItem(SETUP_DESCRIPTION$, szTemp1$ + "\Setup.exe")
  1343.  
  1344.         nReturn% = wsCloseGroup(GROUP_TITLE$)
  1345.  
  1346.     END IF
  1347.  
  1348.     END IF
  1349.  
  1350. END SUB
  1351.  
  1352.  
  1353. '*************************************************************************
  1354. '**
  1355. '** SetIniKey
  1356. '**     - Query if the key already existed in WMail.INI file.  
  1357. '**       If yes, don't update.  Otherwise, check if key exists in Win.INI.
  1358. '**       If exists, set in here.
  1359. '**     - Returns TRUE if key moved, FALSE if else
  1360. '**
  1361. '*************************************************************************
  1362. FUNCTION SetIniKey (szIniPath$, szSection$, szKeyName$) STATIC AS INTEGER
  1363.  
  1364.     IF DoesIniKeyExist(szIniPath$, szSection$, szKeyName$) = 0 THEN
  1365.     szKey$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, szKeyName$)
  1366.     IF szKey$ <> "" THEN
  1367.         CreateIniKeyValue szIniPath$, szSection$, szKeyName$, szKey$, cmoOverwrite
  1368.         SetIniKey = 1
  1369.     ELSE
  1370.         SetIniKey = 0
  1371.     END IF
  1372.     ELSE
  1373.     SetIniKey = 0
  1374.     END IF
  1375.  
  1376. END FUNCTION
  1377.  
  1378.  
  1379.  
  1380. '************************************************************************
  1381. '**
  1382. '** Install:
  1383. '**    - Build the copy list and performs all installation operations.
  1384. '**
  1385. '************************************************************************
  1386. SUB Install STATIC
  1387.  
  1388.     IF szCopyAllFiles$ = "Y" THEN
  1389.     ''
  1390.     ''  Copy all program files
  1391.     ''
  1392.     CreateDir szLocalProgPath$, cmoNone
  1393.     ClearCopyList
  1394.     AddSectionFilesToCopyList "FILES", szProgFileDir$, szLocalProgPath$
  1395.     AddSectionFilesTOCopyList "INSTALL", szProgFileDir$, szLocalProgPath$
  1396.     CopyFilesInCopyList
  1397.     CopyFile szProgFileDir$+"\ReadMe.TXT", szLocalProgPath$+"\ReadMe.TXT", cmoOverwrite,0
  1398.     CopyFile szProgFileDir$+"\Install.INI", szLocalProgPath$+"\Install.INI", cmoOverwrite,0
  1399.     END IF
  1400.  
  1401.     nCursor% = ShowWaitCursor()
  1402.     hwndProg% = ProgressBegin("PROGRESSTEMPLATE", "Copying user files...")
  1403.  
  1404.     CreateDir szUserDir$, cmoNone
  1405.  
  1406.     ''
  1407.     ''  Copy all files in the subdirectory CCMAIL into user directory
  1408.     ''  and also to default user directory.
  1409.     ''       
  1410.     szTempPath$ = SrcDir$ + "CCUSER"
  1411.     szWMailPath$ = AppendPath$(szUserDir$, "WMail.INI")
  1412.  
  1413.     n% = wCopyCannedFiles(szTempPath$, szUserDir$, szWMailPath$) 
  1414.     n% = wCopyDir(szTempPath$, szCCMailDir$, 0)
  1415.     n% = SetFileTimeForDir(szUserDir$, FILETIME, 0)
  1416.     n% = SetFileTimeForDir(szCCMailDir$, FILETIME, 0)
  1417.  
  1418.     IF szCopyAllFiles$ = "Y" THEN
  1419.     CreateDir szLocalProgPath$ + "\CCUSER", cmoNone
  1420.     szPath1$ = szProgFileDir$ + "CCUSER"
  1421.     szPath2$ = szLocalProgPath$ + "\CCUSER"
  1422.     n% = wCopyDir(szPath1$, szPath2$, 0)
  1423.     END IF
  1424.  
  1425. END SUB
  1426.  
  1427.  
  1428.  
  1429. '*************************************************************************
  1430. '**
  1431. '** AddPath - Add our program path to PATH variable in AutoExec.BAT
  1432. '**
  1433. '*************************************************************************
  1434.  
  1435. SUB AddPath STATIC 
  1436.  
  1437.     nModify% = bSetPathInAutoExec(szProgFileDir$, 0)
  1438.  
  1439.     IF nModify% = 1 THEN
  1440.  
  1441.     WARNAUTOEXEC_DLG:
  1442.  
  1443.     sz$ = UIStartDlg(CUIDLL$, WARN_AUTOEXEC, "WarnAutoexecDlgProc", APPHELP, HELPPROC$)
  1444.     UIPop 1
  1445.     nDoIt% = 0
  1446.     IF sz$ = "CONTINUE" THEN
  1447.         nDoIt% = 1
  1448.  
  1449.     ELSEIF sz$ = "CANCEL" THEN
  1450.         sz$ = UIStartDlg(CUIDLL$, WARN_SKIPCHANGE, "WarnSkipChangeDlgProc", APPHELP, HELPPROC$)
  1451.         UIPop 1
  1452.  
  1453.         IF sz$ = "BACK" THEN
  1454.         GOTO WARNAUTOEXEC_DLG
  1455.  
  1456.         ELSEIF sz$ = "EXIT" THEN
  1457.         DoAskQuit
  1458.         GOTO WARNAUTOEXEC_DLG
  1459.         END IF
  1460.  
  1461.     ELSEIF sz$ = "EXIT" THEN
  1462.         DoAskQuit
  1463.         GOTO WARNAUTOEXEC_DLG
  1464.     END IF
  1465.  
  1466.     IF nDoIt% = 1 THEN
  1467.         n% = bRenameAutoExec()
  1468.         bNeedRestart% = 1
  1469.     END IF
  1470.     END IF
  1471.  
  1472. END SUB
  1473.  
  1474.  
  1475. '*************************************************************************
  1476. '**
  1477. '** CheckEnvironment
  1478. '**     Check the user's environment (TEMP)
  1479. '**
  1480. '*************************************************************************
  1481.  
  1482. SUB CheckEnvironment STATIC
  1483.  
  1484.     szTemp$ = GetEnvVariableValue("TEMP")
  1485.  
  1486.     IF szTemp$ <> "" THEN
  1487.     ''
  1488.     '' Check if we can write to that directory.
  1489.     ''
  1490.     IF IsDirWritable(szTemp$) = 0 THEN
  1491.         sz$ = UIStartDlg(CUIDLL$, BADTEMPDIR, "TempDirDlgProc", 0, "")
  1492.         UIPop 1
  1493.     END IF
  1494.     ELSE
  1495.     sz$ = UIStartDlg(CUIDLL$, NOTEMPDIR, "TempDirDlgProc", 0, "")
  1496.     UIPop 1
  1497.     END IF
  1498.  
  1499. END SUB
  1500.  
  1501.  
  1502.  
  1503. '*************************************************************************
  1504. '**
  1505. '** SayTooBig - not enough disk space
  1506. '**
  1507. '*************************************************************************
  1508.  
  1509. SUB SayTooBig STATIC
  1510.  
  1511.     SAYTOOBIG_LABEL:
  1512.  
  1513.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  1514.     IF sz$ = "REACTIVATE" THEN
  1515.     GOTO SAYTOOBIG_LABEL
  1516.     END IF
  1517.     UIPop 1
  1518.  
  1519. END SUB
  1520.  
  1521.  
  1522. '*************************************************************************
  1523. '**
  1524. '** DoAskQuit - confirm for exit
  1525. '**
  1526. '*************************************************************************
  1527.  
  1528. SUB DoAskQuit STATIC
  1529.  
  1530.     ASKQUIT_LABEL:
  1531.  
  1532.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  1533.  
  1534.     IF sz$ = "EXIT" THEN
  1535.     UIPopAll
  1536.     ERROR STFQUIT
  1537.     ELSEIF sz$ = "REACTIVATE" THEN
  1538.     GOTO ASKQUIT_LABEL
  1539.     ELSE
  1540.     UIPop 1
  1541.     END IF
  1542.       
  1543. END SUB
  1544.  
  1545. '*-------------------------------------------------------------------------
  1546. '*
  1547. '*  Invalid Path:
  1548. '*      Gives an error message for bad path specified.
  1549. '*
  1550. '*-------------------------------------------------------------------------
  1551.  
  1552. FUNCTION InvalidPath (szDir$, szMsg$) STATIC AS INTEGER
  1553.  
  1554.     SetSymbolValue "InvalidErrMsg", szMsg$
  1555.     SetSymbolValue "ProgFileDir", szDir$
  1556.  
  1557. BADPATH_INIT:
  1558.     sz$ = UIStartDlg(CUIDLL$, INVALID_PATH, "InvalidPathDlgProc", 0, "")
  1559.     IF sz$ = "REACTIVATE" THEN
  1560.     GOTO BADPATH_INIT
  1561.     END IF
  1562.     UIPop 1             
  1563.     InvalidPath = 1
  1564.  
  1565. END FUNCTION
  1566.