home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-10-05 | 48.7 KB | 1,566 lines |
- '************************************************************************
- '* *
- '* cc:Mail Workstation Installation Script *
- '* *
- '************************************************************************
-
-
- '*-------------------------------------------------------------------------
- '* Includes
- '*-------------------------------------------------------------------------
-
- '$INCLUDE 'setupapi.inc'
- '$INCLUDE 'msdetect.inc'
- '$INCLUDE 'winstall.inc'
-
- '$INCLUDE 'wutil.mst'
-
- '*-------------------------------------------------------------------------
- '* Subroutine/Function Declarations
- '*-------------------------------------------------------------------------
-
- DECLARE SUB ReadInstallINI
- DECLARE SUB DoesMailExist
- DECLARE SUB Install
- DECLARE SUB SetupProg
- DECLARE SUB DoAskQuit
- DECLARE SUB SayTooBig
- DECLARE SUB SetupWMailIni
- DECLARE SUB SetupLotusIni
- DECLARE SUB AddPath
- DECLARE SUB CheckEnvironment
-
- DECLARE FUNCTION InitFunc AS INTEGER
- DECLARE FUNCTION GetUserInfo AS INTEGER
- DECLARE FUNCTION GetOptions AS INTEGER
- DECLARE FUNCTION EnoughSpace AS INTEGER
- DECLARE FUNCTION SetupWinIni AS INTEGER
-
- DECLARE FUNCTION SetIniKey (sz$, sz$, sz$) AS INTEGER
- DECLARE FUNCTION CheckFileVersion (sz$, sz$, sz$) AS INTEGER
- DECLARE FUNCTION InvalidPath (sz$, sz$) AS INTEGER
- DECLARE FUNCTION AsciiToInt LIB "mscuistf.dll" (sz$) AS INTEGER
- DECLARE FUNCTION IntToAscii LIB "mscuistf.dll" (i%,sz$) AS LONG
- DECLARE FUNCTION SzToUpper LIB "mscuistf.dll" (sz$) AS INTEGER
- DECLARE FUNCTION wCopyDir LIB "mscuistf.dll" (sz$,sz$,n%) AS INTEGER
- DECLARE FUNCTION wsAddGroup LIB "mscuistf.dll" (nHinst%,sz$) AS INTEGER
- DECLARE FUNCTION wsCloseGroup LIB "mscuistf.dll" (sz$) AS INTEGER
- DECLARE FUNCTION wsAddItem LIB "mscuistf.dll" (sz$,sz$) AS INTEGER
- DECLARE FUNCTION SetFrame LIB "mscuistf.dll" (nHwndFrame%) AS INTEGER
- DECLARE FUNCTION SetInst LIB "mscuistf.dll" (nHwndInst%) AS INTEGER
- DECLARE FUNCTION bSetPathInAutoExec LIB "mscuistf.dll" (sz$,n%) AS INTEGER
- DECLARE FUNCTION bRenameAutoExec LIB "mscuistf.dll" () AS INTEGER
- DECLARE FUNCTION SetFileTimeForDir LIB "mscuistf.dll" (sz$,sz$,n%) AS INTEGER
- DECLARE FUNCTION wsAddCmdLine LIB "mscuistf.dll" (sz$,sz$,sz$,sz$,sz$) AS INTEGER
- DECLARE FUNCTION CheckMailEngVer LIB "mscuistf.dll" (sz$, sz$) AS INTEGER
- DECLARE FUNCTION MaximizeWindow LIB "mscuistf.dll" (n%) AS INTEGER
- DECLARE FUNCTION GetDriveCurrentDir LIB "mscuistf.dll" (sz$,sz$) AS INTEGER
- DECLARE FUNCTION MeLogin LIB "mscuistf.dll" (sz$,sz$,sz$) AS INTEGER
- DECLARE FUNCTION wCopyCannedFiles LIB "mscuistf.dll" (sz$,sz$,sz$) AS INTEGER
- DECLARE FUNCTION DeleteDir LIB "mscuistf.dll" (sz$) AS INTEGER
- DECLARE FUNCTION fileExists LIB "mscuistf.dll" (sz$) AS INTEGER
- DECLARE FUNCTION fileOpen LIB "mscuistf.dll" (sz$) AS INTEGER
- DECLARE FUNCTION ProgressBegin LIB "mscuistf.dll" (sz$,sz$) AS LONG
- DECLARE FUNCTION ProgressEnd LIB "mscuistf.dll" (n%) AS INTEGER
- DECLARE FUNCTION ProgressUpdate LIB "mscuistf.dll" (n%,sz$) AS INTEGER
- DECLARE FUNCTION RemoveKeyFromStr LIB "mscuistf.dll" (sz$,sz$) AS INTEGER
-
-
- '*-------------------------------------------------------------------------
- '* Defines
- '*-------------------------------------------------------------------------
-
- ''$DEFINE DEBUG ''Define for script development/debugging
-
- CONST CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
- CONST HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
-
- CONST FILETIME = "0210"
-
- CONST TOTALSPACENEEDED = 4730000
- CONST SPACENEEDED = 160000
-
- CONST FILE_MISSING = 0
- CONST FILE_OLDER = 1
- CONST FILE_SAME = 2
- CONST FILE_NEWER = 3
-
-
- '*-------------------------------------------------------------------------
- '* String Constants / Messages
- '*-------------------------------------------------------------------------
-
- CONST VERSION$ = "200" '' Mail version number in Win.INI
- CONST GROUP_TITLE$ = "cc:Mail"
- CONST MAIL_DESCRIPTION$ = "cc:Mail 2.10"
- CONST SETUP_DESCRIPTION$ = "cc:Mail Setup"
-
- CONST PATH_PO$ = "M:\CCDATA"
-
- CONST FILE_WIN_INI$ = "Win.INI"
- CONST FILE_INSTALL_INI$ = "Install.INI"
-
- CONST INI_SECTION$ = "cc:Mail Setup"
- CONST INI_DFLPOPATH$ = "DFLPOPath"
- CONST INI_DFLWMAILPATH$ = "DFLWMailPath"
- CONST INI_DFLUSERPATH$ = "DFLUserPath"
- CONST INI_NOPROMPT$ = "NoPrompt"
- CONST INI_COPYALLFILES$ = "CopyAllFiles"
- CONST INI_LOCALPROGPATH$ = "LocalWMailPath"
- CONST INI_CREATEICON$ = "CreateIcon"
- CONST INI_COMMANDLINE$ = "CommandLine"
- CONST INI_REMOVEOLDINFO$ = "RemoveOldInfo"
- CONST INI_WINDOWSECTION$ = "windows"
-
- CONST INI_CCMAILSECTION$ = "cc:Mail"
- CONST INI_CC1DIR$ = "CC1DIR"
- CONST INI_NAME$ = "Name"
-
- ''
- '' Dialog messages /titles
- ''
-
- CONST STR_ABOUTSTR$ = "Copyright (C) 1994 Lotus Development Corporation."
- CONST STR_TITLE$ = "cc:Mail Version 2.10 - Workstation Installation"
- CONST STR_ERRTITLE$ = "cc:Mail Setup Error"
- CONST STR_CORRUPT$ = "Setup sources were corrupted!"
- CONST STR_MAILENABLED$ = "cc:Mail Setup has mail-enabled your Lotus applications."
-
-
- '*-------------------------------------------------------------------------
- '* Variables
- '*-------------------------------------------------------------------------
-
- '* Integer
-
- GLOBAL nHwndFrame% ''Handle to frame window
- GLOBAL nHinst% ''Application instance
- GLOBAL nReturn% ''Return code for functions
- GLOBAL nFlag%
- GLOBAL nMaxArchive%
- GLOBAL nTotalApp%
- GLOBAL nCursor%
- GLOBAL nMailExist% ''Flag to indicate if cc:Mail already exists
- ''0 = not exist, 1 = older version, 2 = re-install
- GLOBAL bOlder%
- GLOBAL bNewer%
- GLOBAL bMissing%
- GLOBAL hwndProg%
- GLOBAL bNeedRestart%
-
- '* Long
-
- GLOBAL lReturn&
- GLOBAL lSpaceAvailable&
- GLOBAL lSpaceRequired&
-
- '* Strings
-
- GLOBAL szWindowDir$ ''Windows directory
- GLOBAL SrcDir$ ''Default source directory
- GLOBAL szProgFileDir$ ''Program File Directory
- GLOBAL szPODir$ ''Post Office Directory
- GLOBAL szUserDir$ ''User directory
- GLOBAL szCopyAllFiles$ ''Flag for copying all program files
- GLOBAL szIniCopyAllFiles$
- GLOBAL szWMailPath$ ''WMail.ini path
- GLOBAL szUserName$ ''User name
- GLOBAL szTempPath$ ''Tempoaray variable for path
- GLOBAL szTemp1$
- GLOBAL szTemp2$
- GLOBAL szTemp3$
- GLOBAL szVersion$ ''Version number string
- GLOBAL szKey$
- GLOBAL szRemoveIniInfo$ ''Flag for removing old info from Win.ini
- GLOBAL szIcon$
- GLOBAL szCmdLine$
- GLOBAL szNoPrompt$ ''Don't prompt the user
- GLOBAL szUserID$
- GLOBAL szLocalProgPath$ ''Path to local program file directory
- GLOBAL szCCMailDir$
-
-
-
- '************************************************************************
- '* *
- '* Start *
- '* *
- '************************************************************************
-
- '*---------------------------------------------------------------------
- '* Initialization
- '*---------------------------------------------------------------------
-
- INIT:
- IF InitFunc = 0 THEN
- GOTO QUIT
- END IF
-
-
- '*---------------------------------------------------------------------
- '* Check Windows version, don't install if 3.0 or below
- '*---------------------------------------------------------------------
-
- IF CheckWinVer = 0 THEN
- GOTO QUIT
- END IF
-
-
- '*---------------------------------------------------------------------
- '* Welcome
- '*---------------------------------------------------------------------
-
- sz$ = UIStartDlg(CUIDLL$, WELCOME, "WelcomeDlgProc", HELP_WKWELCOME, HELPPROC$)
- UIPop 1
- IF sz$ = "EXIT" THEN
- END
- END IF
-
-
- '*---------------------------------------------------------------------
- '* Main Menu
- '*---------------------------------------------------------------------
-
- MAINMENU_LABEL:
-
- SetSymbolValue "SourceDir", SrcDir$
- sz$ = UIStartDlg(CUIDLL$, WKSTMENU, "WkMenuDlgProc", HELP_WKSTMENU, HELPPROC$)
- IF sz$ = "WkInst" THEN
- UIPop(1)
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO MAINMENU_LABEL
- ELSE
- END
- END IF
-
-
- '*---------------------------------------------------------------------
- '* Retrieve defaults from Install.INI, if any
- '*---------------------------------------------------------------------
-
- ReadInstallINI
-
-
- '*---------------------------------------------------------------------
- '* Check if cc:Mail has already been installed
- '*---------------------------------------------------------------------
-
- DoesMailExist
-
-
- '*---------------------------------------------------------------------
- '* Get user information
- '*---------------------------------------------------------------------
-
- GETUSERINFO_LABEL:
-
- IF GetUserInfo = 0 THEN
- GOTO MAINMENU_LABEL
- END IF
-
-
- '*---------------------------------------------------------------------
- '* Installation options
- '*---------------------------------------------------------------------
-
- GETOPTIONS_LABEL:
-
- IF GetOptions = 0 THEN
- GOTO GETUSERINFO_LABEL
- END IF
-
-
- '*---------------------------------------------------------------------
- '* Check for enough disk space
- '*---------------------------------------------------------------------
-
- IF EnoughSpace = 0 THEN
- SayTooBig
- GOTO GETUSERINFO_LABEL
- END IF
-
-
- '*---------------------------------------------------------------------
- '* Set up [cc:Mail] information in Win.INI
- '*---------------------------------------------------------------------
-
- IF SetupWinIni = 0 THEN
- GOTO GETUSERINFO_LABEL
- END IF
-
-
- '*---------------------------------------------------------------------
- '* Copy the files
- '*---------------------------------------------------------------------
-
- Install
-
- n% = ProgressUpdate(hwndProg%, "Configuring cc:Mail...")
-
-
- '*---------------------------------------------------------------------
- '* Set up information in WMail.INI
- '*---------------------------------------------------------------------
-
- SetupWMailIni
-
-
- '*---------------------------------------------------------------------
- '* Set cc:Mail program path in Lotus.Ini.
- '*---------------------------------------------------------------------
-
- SetupLotusIni
-
-
- '*---------------------------------------------------------------------
- '* Build the program group/icon and set up properties if needed
- '*---------------------------------------------------------------------
-
- SetupProg
-
- n% = ProgressEnd(hwndProg%)
- RestoreCursor nCursor%
-
-
- '*---------------------------------------------------------------------
- '* Put the program directory into the Path variable in Autoexec.bat
- '*---------------------------------------------------------------------
-
- AddPath
-
-
- '*---------------------------------------------------------------------
- '* Check if the TEMP environment variable is set
- '*---------------------------------------------------------------------
-
- CheckEnvironment
-
-
- '*---------------------------------------------------------------------
- '* Check if FILES in CONFIG.SYS is at least 30.
- '*---------------------------------------------------------------------
-
- IF GetConfigNumFiles < 30 THEN
- sz$ = UIStartDlg(CUIDLL$, WARN_FILECONFIG, "TempDirDlgProc", 0, "")
- UIPop 1
- END IF
-
-
- '*---------------------------------------------------------------------
- '* Done
- '*---------------------------------------------------------------------
-
- QUIT:
- ON ERROR GOTO ERRQUIT
-
- IF ERR = 0 THEN
- IF bNeedRestart% = 1 THEN
- dlg% = EXITSUCCESS
- ELSE
- dlg% = EXITSUCCESS_NORESTART
- END IF
- ELSEIF ERR = STFQUIT THEN
- dlg% = EXITQUIT
- ELSE
- dlg% = EXITFAILURE
- END IF
-
- QUITL1:
- sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO QUITL1
- END IF
- UIPop 1
-
- '*---------------------------------------------------------------------
- '* Exit
- '*---------------------------------------------------------------------
-
- DONE:
- END
-
-
-
- '*************************************************************************
- '**
- '** ERRQUIT - exit on error
- '**
- '*************************************************************************
-
- ERRQUIT:
-
- i% = DoMsgBox(STR_CORRUPT$, STR_ERRTITLE$, MB_OK + MB_TASKMODAL + MB_ICONHAND)
- END
-
-
- '*************************************************************************
- '**
- '** InitFunc
- '** - initialization
- '**
- '*************************************************************************
-
- FUNCTION InitFunc STATIC AS INTEGER
-
- n% = MaximizeWindow(HwndFrame())
-
- SetAbout STR_TITLE$, STR_ABOUTSTR$
-
- SetBitmap CUIDLL$, BMP_LOTUS
- SetTitle STR_TITLE$
-
- szInf$ = GetSymbolValue("STF_SRCINFPATH")
- IF szInf$ = "" THEN
- szInf$ = GetSymbolValue("STF_CWDDIR") + "USER.INF"
- END IF
- ReadInfFile szInf$
-
- ''
- '' Remember the frame window handle and instance
- ''
- nHinst% = HinstFrame()
- nHwndFrame% = HwndFrame()
- nReturn% = SetFrame(nHwndFrame%)
- nReturn% = SetInst(nHinst%)
- bNeedRestart% = 0
-
- ''
- '' Defaults for paths
- ''
- SrcDir$ = GetSymbolValue("STF_SRCDIR")
- szWindowDir$ = GetWindowsDir()
- szCCMailDir$ = szWindowDir$ + "CCMAIL" '' default cc:Mail directory
-
- InitFunc = 1
-
- END FUNCTION
-
-
- '*************************************************************************
- '**
- '** ReadInstallINI:
- '** Retrieve default values from Install.INI, if any
- '**
- '*************************************************************************
-
- SUB ReadInstallINI STATIC
-
- szTempPath$ = SrcDir$ + FILE_INSTALL_INI
-
- '' Post office directory
- ''
- szPODir$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_DFLPOPATH$)
- IF szPODir$ = "" THEN
- szPODir$ = PATH_PO$
- END IF
-
- '' Program file directory
- ''
- szProgFileDir$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_DFLWMAILPATH$)
- szProgFileDir$ = ucase$(szProgFileDir$)
-
- '' User directory - if not specified, default to CCMAIL\CC1DIR
- '' under Windows directory
- ''
- szUserDir$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_DFLUSERPATH$)
- IF szUserDir$ = "" THEN
- szUserDir$ = AppendPath$(szCCMailDir$, INI_CC1DIR$)
- END IF
- szUserDir$ = ucase$(szUserDir$)
-
- '' User name
- ''
- szUserName$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_NAME$)
-
- '' Prompting?
- ''
- szNoPrompt$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_NOPROMPT$)
- IF szNoPrompt$ = "" THEN
- szNoPrompt$ = "N"
- ELSE
- szNoPrompt$ = ucase$(szNoPrompt$)
- END IF
-
- '' Authorized to copy executables to local drive?
- ''
- szIniCopyAllFiles$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_COPYALLFILES$)
- IF szIniCopyAllFiles$ = "" THEN
- szIniCopyAllFiles$ = "N"
- ELSE
- szIniCopyAllFiles$ = ucase$(szIniCopyAllFiles$)
- END IF
- szCopyAllFiles$ = szIniCopyAllFiles$
-
- '' Local path for program files if copy all files
- ''
- IF szCopyAllFiles$ = "Y" THEN
- szLocalProgPath$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_LOCALPROGPATH$)
- IF szLocalProgPath$ <> "" THEN
- szCopyAllFiles$ = "Y"
- ELSE
- szCopyAllFiles$ = "N"
- END IF
- END IF
-
- '' Create new icon after installation?
- ''
- szIcon$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_CREATEICON$)
- IF szIcon$ = "" THEN
- szIcon$ = "Y"
- ELSE
- szIcon$ = ucase$(szIcon$)
- END IF
-
- '' Set up command line?
- ''
- szCmdLine$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_COMMANDLINE$)
- IF szCmdLine$ = "" THEN
- szCmdLine$ = "Y"
- ELSE
- szCmdLine$ = ucase$(szCmdLine$)
- END IF
-
- '' Remove old information?
- ''
- szRemoveIniInfo$ = GetIniKeyString(szTempPath$, INI_SECTION$, INI_REMOVEOLDINFO$)
- IF szRemoveIniInfo$ = "" THEN
- szRemoveIniInfo$ = "N"
- ELSE
- szRemoveIniInfo$ = ucase$(szRemoveIniInfo$)
- END IF
-
- END SUB
-
-
- '*************************************************************************
- '**
- '** DoesMailExist:
- '** Check if cc:Mail already exists. If yes, check if it is an
- '** older version or a re-installation of this version.
- '**
- '*************************************************************************
-
- SUB DoesMailExist STATIC
-
- nMailExist% = 0
-
- '' Does the [cc:Mail] section exist in Win.INI?
- ''
- IF DoesIniSectionExist(FILE_WIN_INI$, INI_CCMAILSECTION$) = 1 THEN
- nMailExist% = 1
- ''
- '' Does the version number exist?
- ''
- IF DoesIniKeyExist(FILE_WIN_INI$, INI_CCMAILSECTION$, "PROGVER") = 1 THEN
- ''
- '' Check the version number
- ''
- szVersion$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, "PROGVER")
- IF szVersion$ = VERSION$ THEN
- nMailExist% = 2
- END IF
- END IF
- END IF
-
- END SUB
-
-
- '*************************************************************************
- '**
- '** GetUserInfo
- '** Prompt for user information
- '**
- '*************************************************************************
-
- FUNCTION GetUserInfo STATIC AS INTEGER
-
- USERINFO_LABEL:
-
- SetSymbolValue "POPathOut", szPODir$
- SetSymbolValue "UserNameOut", szUserName$
- SetSymbolValue "UserPswdOut", szPassword$
- SetSymbolValue "ProgPathOut", szProgFileDir$
- SetSymbolValue "ccMailPathOut", szCCMailDir$
-
- IF szNoPrompt$ = "N" THEN
-
- USERINFO_DLG:
-
- sz$ = UIStartDlg(CUIDLL$, USERINFO, "UserInfoDlgProc", HELP_USERINFO, HELPPROC$)
-
- IF sz$ = "CONTINUE" THEN
- szPODir$ = GetSymbolValue("POPathOut")
- szUserName$ = GetSymbolValue("UserNameOut")
- '' szPassword$ = GetSymbolValue("UserPswdOut")
- szProgFileDir$ = GetSymbolValue("ProgPathOut")
- szCCMailDir$ = GetSymbolValue("ccMailPathOut")
-
- ''
- '' Check if the post office path is valid.
- ''
- szTempPath$ = szPODir$ + "\MLANDATA"
- IF fileExists(szTempPath$) = 0 THEN
- nReturn% = InvalidPath(szPODir$, "Not a post office directory")
- GOTO USERINFO_DLG
- END IF
- IF DoesFileExist(szTempPath$, femReadWrite) = 0 THEN
- UIPop 1
- nReturn% = InvalidPath(szPODir$, "Does not have read/write access")
- GOTO USERINFO_DLG
- END IF
-
-
- ''
- '' Don't check login because workstation setup may be run
- '' by the administrator.
- ''
- '' IF MeLogin(szUserName$, szPassword$, szPODir$) = 0 THEN
- '' UIPop 1
- '' GOTO USERINFO_DLG
- '' END IF
-
- ''
- '' Check if the cc:Mail path only contains drive letter.
- '' If yes, get the complete path.
- ''
- IF (LEN(szCCMailDir$) = 2) AND (INSTR(1, szCCMailDir$, ":")) THEN
- nReturn% = GetDriveCurrentDir(szCCMailDir$, szCCMailDir$)
- END IF
-
- ''
- '' Check if the cc:Mail path is valid
- ''
- IF IsDriveValid(szCCMailDir$) = 0 THEN
- UIPop 1
- nReturn% = InvalidPath(szCCMailDir$, "Drive for cc:Mail directory is not valid")
- GOTO USERINFO_DLG
- END IF
- IF DoesDirExist(szCCMailDir$) = 0 THEN
- CreateDir szCCMailDir$, cmoNone
- IF DoesDirExist(szCCMailDir$) = 0 THEN
- UIPop 1
- nReturn% = InvalidPath(szCCMailDir$, "cc:Mail directory is not valid")
- GOTO USERINFO_DLG
- END IF
- END IF
-
- ''
- '' Check if the program path is valid
- ''
- szTempPath$ = szProgFileDir$ + "\WMail.EXE"
-
- IF fileOpen(szTempPath$) = 0 THEN
- UIPop 1
- nReturn% = InvalidPath(szProgFileDir$, "Cannot find program files")
- GOTO USERINFO_DLG
- END IF
-
- UIPop 1
-
- ''
- '' Update user directory variable
- ''
- szUserDir$ = AppendPath$(szCCMailDir$, "CC1DIR")
-
- GetUserInfo = 1
-
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO USERINFO_DLG
- ELSEIF sz$ = "BACK" THEN
- UIPop 1
- GetUserInfo = 0
- ELSE
- UIPop 1
- DoAskQuit
- GOTO USERINFO_DLG
- END IF
-
- ELSE
- '' No prompt
- ''
- '' If any one of the necessary parameters is missing, error
- ''
- IF (szPODir$ = "") OR (szUserName$ = "") OR (szProgFileDir$ = "") OR (szCCMailDir$ = "") THEN
- GOTO USERINFO_DLG
- END IF
-
- ''
- '' Check if the post office path is valid.
- ''
- szTempPath$ = szPODir$ + "\MLANDATA"
- IF fileExists(szTempPath$) = 0 THEN
- nReturn% = InvalidPath(szPODir$, "Not a post office directory")
- GOTO USERINFO_DLG
- END IF
- IF DoesFileExist(szTempPath$, femReadWrite) = 0 THEN
- nReturn% = InvalidPath(szPODir$, "Does not have read/write access")
- GOTO USERINFO_DLG
- END IF
-
- ''
- '' Check if the cc:Mail path only contains drive letter.
- '' If yes, get the complete path.
- ''
- IF (LEN(szCCMailDir$) = 2) AND (INSTR(1, szCCMailDir$, ":")) THEN
- nReturn% = GetDriveCurrentDir(szCCMailDir$, szCCMailDir$)
- END IF
-
- ''
- '' Check if the cc:Mail path is valid
- ''
- IF IsDriveValid(szCCMailDir$) = 0 THEN
- nReturn% = InvalidPath(szCCMailDir$, "Drive for cc:Mail directory is not valid")
- GOTO USERINFO_DLG
- END IF
- IF DoesDirExist(szCCMailDir$) = 0 THEN
- CreateDir szCCMailDir$, cmoNone
- IF DoesDirExist(szCCMailDir$) = 0 THEN
- nReturn% = InvalidPath(szCCMailDir$, "cc:Mail directory is not valid")
- GOTO USERINFO_DLG
- END IF
- END IF
-
- ''
- '' Check if the program path is valid
- ''
- szTempPath$ = szProgFileDir$ + "\WMail.EXE"
- IF fileOpen(szTempPath$) = 0 THEN
- nReturn% = InvalidPath(szProgFileDir$, "Cannot find program files")
- GOTO USERINFO_DLG
- END IF
-
-
- ''
- '' Update user directory variable
- ''
- szUserDir$ = AppendPath$(szCCMailDir$, "CC1DIR")
-
- GetUserInfo = 1
-
- END IF
-
- END FUNCTION
-
-
-
- '*************************************************************************
- '**
- '** GetOptions
- '** Prompt for installation options
- '**
- '*************************************************************************
-
- FUNCTION GetOptions STATIC AS INTEGER
-
- OPTIONS_INIT:
-
- SetSymbolValue "CopyAllFiles", szCopyAllFiles$
- SetSymbolValue "CreateIcon", szIcon$
- SetSymbolValue "CommandLine", szCmdLine$
- SetSymbolValue "RemoveOldInfo", szRemoveIniInfo$
- SetSymbolValue "LocalProgPathOut", szLocalProgPath$
-
- IF szNoPrompt$ = "N" THEN
-
- OPTIONS_DLG:
-
- IF szIniCopyAllFiles$ = "Y" THEN
- sz$ = UIStartDlg(CUIDLL$, WKOPTIONS1, "WkOptions1DlgProc", HELP_WKOPTIONS1, HELPPROC$)
- ELSE
- sz$ = UIStartDlg(CUIDLL$, WKOPTIONS2, "WkOptions2DlgProc", HELP_WKOPTIONS2, HELPPROC$)
- END IF
-
- IF sz$ = "CONTINUE" THEN
- szCopyAllFiles$ = GetSymbolValue("CopyAllFiles")
- szIcon$ = GetSymbolValue("CreateIcon")
- szCmdLine$ = GetSymbolValue("CommandLine")
- szLocalProgPath$ = GetSymbolValue("LocalProgPathOut")
- szRemoveIniInfo$ = GetSymbolValue("RemoveOldInfo")
-
- SetSymbolValue "CopyAllFiles", szCopyAllFiles$
- SetSymbolValue "CreateIcon", szIcon$
- SetSymbolValue "CommandLine", szCmdLine$
- SetSymbolValue "LocalProgPathOut", szLocalProgPath$
- SetSymbolValue "RemoveOldInfo", szRemoveIniInfo$
-
- IF szCopyAllFiles$ = "Y" THEN
- IF IsDirWritable(szLocalProgPath$) = 0 THEN
- nReturn% = InvalidPath(szLocalProgPath$, "Invalid destination program path")
- UIPop 1
- GOTO OPTIONS_INIT
- END IF
- END IF
- UIPop 1
-
- GetOptions = 1
-
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO OPTIONS_DLG
- ELSEIF sz$ = "BACK" THEN
- UIPop 1
- GetOptions = 0
- ELSE
- UIPop 1
- DoAskQuit
- GOTO OPTIONS_DLG
- END IF
-
- ELSE
-
- ''
- '' Check if COPYALLFILES set Y and then goto OPTIONS_DLG no matter
- '' what. This will ensure the destination directory get entered.
- ''
- '' Fixed by RC 9-15-93
- ''
- IF (szCopyAllFiles$ = "Y") AND ((szLocalProgPath$ = "") OR (IsDirWritable(szLocalProgPath$) = 0)) THEN
- GOTO OPTIONS_DLG
- END IF
-
- GetOptions = 1
-
- END IF
-
- END FUNCTION
-
-
- '*************************************************************************
- '**
- '** EnoughSpace
- '** Check if there is enough disk space
- '**
- '*************************************************************************
-
- FUNCTION EnoughSpace STATIC AS INTEGER
-
- IF szCopyAllFiles$ = "Y" THEN
- lSpaceAvailable& = GetFreeSpaceForDrive(szLocalProgPath$)
- lSpaceRequired& = TOTALSPACENEEDED
- ELSE
- lSpaceAvailable& = GetFreeSpaceForDrive(szUserDir$)
- lSpaceRequired& = SPACENEEDED
- ENDIF
- IF lSpaceAvailable& < lSpaceRequired& THEN
- EnoughSpace = 0
- ELSE
- EnoughSpace = 1
- END IF
-
- END FUNCTION
-
-
- '*************************************************************************
- '**
- '** SetupWinIni
- '** Set up [cc:Mail] information in Win.INI
- '**
- '*************************************************************************
-
- FUNCTION SetupWinIni STATIC AS INTEGER
-
- '*---------------------------------------------------------------------
- '* Set up new cc:Mail section
- '*---------------------------------------------------------------------
-
- szuUserName$ = ucase$(szUserName$)
-
- IF nMailExist% = 2 THEN
- ''
- '' If we're re-installing, need to retrieve the highest user ID
- '' number and go through the list to see if this user already
- '' existed. If yes, modify the corresponding user entry.
- '' Otherwise, create a new entry.
- ''
- szUserID$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, "LastIDUsed")
- nReturn% = 0
- nFlag% = AsciiToInt(szUserID$)
- nOtherUserID% = 0
- nSameUserFound% = 0
-
- FOR i% = 1 TO nFlag% STEP 1
- lReturn& = IntToAscii(i%, szTemp2$)
- szKey$ = "User" + szTemp2$ + "Name"
- szTemp1$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$)
- szTemp1$ = ucase$(szTemp1$)
- IF szTemp1$ = ucase$(szUserName$) THEN
- ''
- '' User name found. Compare post office directory
- '' to make sure it's really the same user.
- ''
- szTemp1$ = "User" + szTemp2$ + "Dir"
- szTemp1$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, szTemp1$)
- szTemp1$ = szTemp1$ + "\WMAIL.INI"
- szTemp1$ = GetIniKeyString(szTemp1$, INI_CCMAILSECTION$, "Path")
-
- IF (szTemp1$ <> "") AND (ucase$(szTemp1$) <> ucase$(szPODir$)) THEN
- nNewPOPath% = 1
- nOtherUserID% = i%
- GOTO CONTINUE_LABEL
- ELSE
- nNewPOPath% = 0
- END IF
-
- ''
- '' User found!
- ''
- lReturn& = IntToAscii(i%, szTemp2$)
- szKey$ = "User" + szTemp2$ + "Dir"
- szUserDir$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$)
- IF (szUserDir$ <> "") THEN
- szTemp3$ = AppendPath$(szUserDir$, "WMail.INI")
- ELSE
- szUserDir$ = AppendPath$(szCCMailDir$, "CC"+szTemp2$+"DIR")
- GOTO JUST_INSERT_DIR
- END IF
-
- IF DoesFileExist(szTemp3$, femRead) = 1 THEN
-
- USERDIR_1:
-
- IF nNewPOPath% = 1 THEN
- sz$ = UIStartDlg(CUIDLL$, SAMEUSER, "UserDirDlgProc", HELP_USERDIR2, HELPPROC$)
- ELSE
- sz$ = UIStartDlg(CUIDLL$, USERDIREXIST, "UserDirDlgProc", HELP_USERDIR1, HELPPROC$)
- END IF
- UIPop 1
- nSameUserFound% = 1
-
- IF sz$ = "UPDATE" THEN
- ''
- '' Just do an update.
- ''
- GOTO OUT2
-
- ELSEIF sz$ = "OVERWRITE" THEN
- ''
- '' Clean up user directory so we can copy new files.
- ''
- nReturn% = DeleteDir(szUserDir$)
- GOTO OUT2
-
- ELSE
- ''
- '' Create new user directory.
- ''
- nReturn% = 0
- GOTO OUT1
- END IF
-
- CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$, szUserDir$, cmoOverwrite
-
- ELSE
- JUST_INSERT_DIR:
- CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$, szUserDir$, cmoOverwrite
- nReturn% = 1
- END IF
- END IF
-
- CONTINUE_LABEL:
-
- NEXT i%
-
-
- IF (nSameUserFound% = 0) AND (nNewPOPath% = 1) AND (nOtherUserID% > 0) THEN
- lReturn& = IntToAscii(nOtherUserID%, szTemp2$)
- szKey$ = "User" + szTemp2$ + "Dir"
- szUserDir$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$)
- szTemp3$ = AppendPath$(szUserDir$, "WMail.INI")
-
- IF DoesFileExist(szTemp3$, femRead) = 1 THEN
- sz$ = UIStartDlg(CUIDLL$, SAMEUSER, "UserDirDlgProc", HELP_USERDIR2, HELPPROC$)
- UIPop 1
- nSameUserFound% = 1
-
- IF sz$ = "UPDATE" THEN
- GOTO OUT2
-
- ELSEIF sz$ = "OVERWRITE" THEN
- nReturn% = DeleteDir(szUserDir$)
- GOTO OUT2
-
- ELSE
- nReturn% = 0
- GOTO OUT1
- END IF
-
- CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$, szUserDir$, cmoOverwrite
-
- ELSE
- CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$, szUserDir$, cmoOverwrite
- nReturn% = 1
- END IF
- END IF
-
-
- OUT1:
- ''
- '' Have we found the user? If not, create values for him.
- ''
- IF nReturn% = 0 THEN
- nFlag% = nFlag% + 1
- lReturn& = IntToAscii(nFlag%, szTemp2$)
- szKey$ = "User" + szTemp2$ + "Name"
- CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$, szUserName$, cmoOverwrite
- szKey$ = "User" + szTemp2$ + "Dir"
- szTemp3$ = "CC" + szTemp2$ + "DIR"
- szUserDir$ = AppendPath$(szCCMailDir$, szTemp3$)
- CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$, szUserDir$, cmoOverwrite
- ''
- '' Update the highest user ID since we added one.
- ''
- CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, "LastIDUsed", szTemp2$, cmoOverwrite
- END IF
-
- ELSE '' IF nMailExist% <> 2
- ''
- '' These keywords are new from 2.01
- ''
- CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, "User1Name", szUserName$, cmoOverwrite
- CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, "User1Dir", szUserDir$, cmoOverwrite
- CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, "LastIDUsed", "1", cmoOverwrite
- CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, "LastUserID", "1", cmoOverwrite
- END IF
-
- OUT2:
-
- '*---------------------------------------------------------------------
- '* Set up program path
- '*---------------------------------------------------------------------
- ''
- '' Check if an old Program Path already exists. If yes, remember the
- '' path so we can try to remove the path from Autoexec.bat.
- ''
- IF (szCopyAllFiles = "Y") AND (szLocalProgPath$ <> "") THEN
- CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, "ProgramPath", szLocalProgPath$, cmoOverwrite
- ELSE
- CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, "ProgramPath", szProgFileDir$, cmoOverwrite
- END IF
-
-
- '*---------------------------------------------------------------------
- '* Set up default user directory (empty)
- '*---------------------------------------------------------------------
-
- CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, "User0Dir", szCCMailDir$, cmoOverwrite
-
-
- '*---------------------------------------------------------------------
- '* Set up SMI keyword in Mail section of Win.INI
- '*---------------------------------------------------------------------
-
- CreateIniKeyValue FILE_WIN_INI$, "Mail", "SMI", "1", cmoOverwrite
-
-
- '*---------------------------------------------------------------------
- '* Set up program version
- '*---------------------------------------------------------------------
-
- CreateIniKeyValue FILE_WIN_INI$, INI_CCMAILSECTION$, "PROGVER", "200", cmoOverwrite
-
-
- '*---------------------------------------------------------------------
- '* Update the LotusMail section:
- '* If the section does not exist, create it.
- '* If the Mail application specified is WMail, update program path.
- '*---------------------------------------------------------------------
-
- IF DoesIniSectionExist(FILE_WIN_INI$, "LotusMail") = 0 THEN
- CreateIniKeyValue FILE_WIN_INI$, "LotusMail", "Application", "wMail", cmoOverwrite
- szTempPath$ = szProgFileDir$ + "\WMAIL.EXE SENDMAIL"
- CreateIniKeyValue FILE_WIN_INI$, "LotusMail", "Program", szTempPath$, cmoOverwrite
- ELSE
- szTempPath$ = GetIniKeyString(FILE_WIN_INI$, "LotusMail", "Application")
- nReturn% = SzToUpper(szTempPath$)
- IF szTempPath$ = "WMAIL" THEN
- szTempPath$ = szProgFileDir$ + "\WMAIL.EXE SENDMAIL"
- CreateIniKeyValue FILE_WIN_INI$, "LotusMail", "Program", szTempPath$, cmoOverwrite
- END IF
- END IF
-
-
- '*---------------------------------------------------------------------
- '* Remove LOAD and RUN for WNotify
- '*---------------------------------------------------------------------
-
- szKey$ = GetIniKeyString(FILE_WIN_INI$, INI_WINDOWSECTION$, "Load")
- IF szKey$ <> "" THEN
- IF RemoveKeyFromStr(szKey$, "WNOTIFY") = 1 THEN
- CreateIniKeyValue FILE_WIN_INI$, INI_WINDOWSECTION$, "Load", szKey$, cmoOverwrite
- END IF
- END IF
-
- szKey$ = GetIniKeyString(FILE_WIN_INI$, INI_WINDOWSECTION$, "Run")
- IF szKey$ <> "" THEN
- IF RemoveKeyFromStr(szKey$, "WNOTIFY") = 1 THEN
- CreateIniKeyValue FILE_WIN_INI$, INI_WINDOWSECTION$, "Run", szKey$, cmoOverwrite
- END IF
- END IF
-
-
- SetupWinIni = 1
- GOTO OUT_SETUPWININI
-
- BACK_SETUPWININI:
- SetupWinIni = 0
-
- OUT_SETUPWININI:
-
- END FUNCTION
-
-
-
- '*************************************************************************
- '**
- '** SetupWMailIni
- '** Setup information in WMail.INI
- '**
- '*************************************************************************
-
- SUB SetupWMailIni STATIC
-
- szWMailPath$ = AppendPath$(szUserDir$, "WMail.INI")
-
- CreateIniKeyValue szWMailPath$, INI_CCMAILSECTION$, "Path", szPODir$, cmoOverwrite
- CreateIniKeyValue szWMailPath$, INI_CCMAILSECTION$, "Name", szUserName$, cmoOverwrite
-
- IF (nMailExist% = 1) OR (nMailExist% = 2) THEN
- ''
- '' Older versions of cc:Mail exist. Move info to WMail.INI.
- ''
- n% = SetIniKey(szWMailPath$, INI_CCMAILSECTION$, "SaveWindow")
- n% = SetIniKey(szWMailPath$, INI_CCMAILSECTION$, "FaxExt")
- n% = SetIniKey(szWMailPath$, INI_CCMAILSECTION$, "InboxCacheSize")
- n% = SetIniKey(szWMailPath$, INI_CCMAILSECTION$, "Mono")
- n% = SetIniKey(szWMailPath$, INI_CCMAILSECTION$, "SmartIconTextEnabled")
-
- ''
- '' If [cc:Edit] section exists in WMail.INI, just use the
- '' defaults from there and ignore the old values.
- ''
- nMoveEdit% = 1
- IF DoesIniSectionExist(szWMailPath$, "cc:Edit") = 1 THEN
- ''
- '' Is it only an empty section?
- ''
- IF DoesIniKeyExist(szWMailPath$,"cc:Edit","EnableMargins") = 1 THEN
- nMoveEdit% = 0
- ELSEIF DoesIniKeyExist(szWMailPath$,"cc:Edit","TabStops") = 1 THEN
- nMoveEdit% = 0
- ELSEIF DoesIniKeyExist(szWMailPath$,"cc:Edit","LMargin") = 1 THEN
- nMoveEdit% = 0
- ELSEIF DoesIniKeyExist(szWMailPath$,"cc:Edit","RMargin") = 1 THEN
- nMoveEdit% = 0
- ELSEIF DoesIniKeyExist(szWMailPath$,"cc:Edit","ShowRuler") = 1 THEN
- nMoveEdit% = 0
- ELSEIF DoesIniKeyExist(szWMailPath$,"cc:Edit","DefAttr") = 1 THEN
- nMoveEdit% = 0
- END IF
-
- END IF
-
- IF nMoveEdit% = 1 THEN
- n% = SetIniKey(szWMailPath$, "cc:Edit", "EnableMargins")
- n% = SetIniKey(szWMailPath$, "cc:Edit", "TabStops")
- n% = SetIniKey(szWMailPath$, "cc:Edit", "LMargin")
- n% = SetIniKey(szWMailPath$, "cc:Edit", "RMargin")
- n% = SetIniKey(szWMailPath$, "cc:Edit", "DefAttr")
- n% = SetIniKey(szWMailPath$, "cc:Edit", "ShowRuler")
- END IF
-
- IF DoesIniKeyExist(szWMailPath$, "cc:Archive", "MaxArchive") = 0 THEN
- szKey$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, "MaxArchive")
- IF szKey$ <> "" THEN
- CreateIniKeyValue szWMailPath$, "cc:Archive", "MaxArchive", szKey$, cmoOverwrite
-
- nMaxArchive% = AsciiToInt(szKey$)
- FOR i% = 1 TO nMaxArchive% STEP 1
- lReturn& = IntToAscii(i%, szTemp2$)
- szKey$ = "Archive#" + szTemp2$
- szTemp1$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$)
- IF szTemp1$ <> "" THEN
- CreateIniKeyValue szWMailPath$, "cc:Archive", szKey$, szTemp1$, cmoOverwrite
- END IF
- NEXT i%
- END IF
- END IF
-
- IF DoesIniKeyExist(szWMailPath$, INI_CCMAILSECTION$, "TotalApps") = 0 THEN
- szKey$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, "TotalApps")
- IF szKey$ <> "" THEN
- CreateIniKeyValue szWMailPath$, INI_CCMAILSECTION$, "TotalApps", szKey$, cmoOverwrite
- END IF
-
- nTotalApp% = AsciiToInt(szKey$)
- FOR i% = 1 TO nTotalApp% STEP 1
- lReturn& = IntToAscii(i%, szTemp2$)
- szKey$ = "APP" + szTemp2$
- szTemp1$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$)
- IF szTemp1$ <> "" THEN
- CreateIniKeyValue szWMailPath$, INI_CCMAILSECTION$, szKey$, szTemp1$, cmoOverwrite
- END IF
- NEXT i%
-
- szKey$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, "LastAppID")
- IF szKey$ <> "" THEN
- CreateIniKeyValue szWMailPath$, INI_CCMAILSECTION$, "LastAppID", szKey$, cmoOverwrite
- END IF
- END IF
-
- ''
- '' If moving INI section info, delete original section.
- ''
- IF szRemoveIniInfo$ = "Y" THEN
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Path", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Name", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Password", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "DefaultWorkPath", cmoNone
-
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "SaveWindow", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "MaxArchive", cmoNone
- FOR i% = 1 TO nMaxArchive% STEP 1
- lReturn& = IntToAscii(i%, szTemp2$)
- szKey$ = "Archive#" + szTemp2$
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$, cmoNone
- NEXT i%
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Compress", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "TotalApps", cmoNone
- FOR i% = 1 TO nTotalApp% STEP 1
- lReturn& = IntToAscii(i%, szTemp2$)
- szKey$ = "APP" + szTemp2$
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, szKey$, cmoNone
- NEXT i%
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "LastAppID", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "FaxExt", cmoNone
-
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "InboxCacheSize", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "BBoardCacheSize", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "FolderCacheSize", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "ArchiveCacheSize", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "OS2Cache", cmoNone
-
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "List", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Options", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Confirm", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Message", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Notify", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "InboxPollInterval", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "BBoardPollInterval", cmoNone
-
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Fax Scale", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "View Style", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Horz Pages", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Vert Pages", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Use Print Offset", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "FindX", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "FindY", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "SystemResourceCheck", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "PrMargin", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "TextEditorExt", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "GraphicsEditorExt", cmoNone
-
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "InboxFont", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "BBListFont", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "BBoardFont", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "MListFont", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "MListListFont", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "PrivMListListFont", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "PrivMListFont", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "DirFont", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "FolderListFont", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "FolderFont", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "EditFont", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "MessageFont", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "AllFont", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Error!Font", cmoNone
-
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "MultiLogin", cmoNone
-
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "SmartIconTextEnable", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "Mono", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "EnableMargins", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "TabStops", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "LMargin", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "RMargin", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "DefAttr", cmoNone
- RemoveIniKey FILE_WIN_INI$, INI_CCMAILSECTION$, "ShowRuler", cmoNone
-
- szTempPath$ = GetWindowsDir() + "ccMail.CFG"
- RemoveFile szTempPath$, cmoNone
- END IF
- END IF
-
- END SUB
-
-
- '*************************************************************************
- '**
- '** SetupLotusIni
- '** Set up the Lotus.INI file - our program path
- '**
- '*************************************************************************
-
- SUB SetupLotusIni STATIC
-
- szTempPath$ = szWindowDir$ + "Lotus.INI"
- IF (szCopyAllFiles = "Y") AND (szLocalProgPath$ <> "") THEN
- szTemp1$ = szLocalProgPath$ + "\WMAIL.EXE cc:Mail"
- ELSE
- szTemp1$ = szProgFileDir$ + "\WMAIL.EXE cc:Mail"
- END IF
- CreateIniKeyValue szTempPath$, "Lotus Applications", "ccMail", szTemp1$, cmoOverwrite
-
- END SUB
-
-
- '*************************************************************************
- '**
- '** SetupProg
- '** - Build the group file, icon and program properties
- '**
- '*************************************************************************
-
- SUB SetupProg STATIC
-
- IF szIcon$ = "Y" THEN
-
- IF (szCopyAllFiles = "Y") AND (szLocalProgPath$ <> "") THEN
- szTemp1$ = szLocalProgPath$
- ELSE
- szTemp1$ = szProgFileDir$
- END IF
-
- IF wsAddGroup(nHinst%, GROUP_TITLE$) = 1 THEN
-
- IF szCmdLine$ = "Y" THEN
- szTempPath$ = szTemp1$ + "\WMail.EXE"
- nReturn% = wsAddCmdLine(MAIL_DESCRIPTION$, szTempPath$, szPODir$, szUserName$, "PASSWORD")
- ELSE
- szTempPath$ = szTemp1$ + "\WMail.EXE "
- nReturn% = wsAddItem(MAIL_DESCRIPTION$, szTempPath$)
- END IF
-
- nReturn% = wsAddItem(SETUP_DESCRIPTION$, szTemp1$ + "\Setup.exe")
-
- nReturn% = wsCloseGroup(GROUP_TITLE$)
-
- END IF
-
- END IF
-
- END SUB
-
-
- '*************************************************************************
- '**
- '** SetIniKey
- '** - Query if the key already existed in WMail.INI file.
- '** If yes, don't update. Otherwise, check if key exists in Win.INI.
- '** If exists, set in here.
- '** - Returns TRUE if key moved, FALSE if else
- '**
- '*************************************************************************
- FUNCTION SetIniKey (szIniPath$, szSection$, szKeyName$) STATIC AS INTEGER
-
- IF DoesIniKeyExist(szIniPath$, szSection$, szKeyName$) = 0 THEN
- szKey$ = GetIniKeyString(FILE_WIN_INI$, INI_CCMAILSECTION$, szKeyName$)
- IF szKey$ <> "" THEN
- CreateIniKeyValue szIniPath$, szSection$, szKeyName$, szKey$, cmoOverwrite
- SetIniKey = 1
- ELSE
- SetIniKey = 0
- END IF
- ELSE
- SetIniKey = 0
- END IF
-
- END FUNCTION
-
-
-
- '************************************************************************
- '**
- '** Install:
- '** - Build the copy list and performs all installation operations.
- '**
- '************************************************************************
- SUB Install STATIC
-
- IF szCopyAllFiles$ = "Y" THEN
- ''
- '' Copy all program files
- ''
- CreateDir szLocalProgPath$, cmoNone
- ClearCopyList
- AddSectionFilesToCopyList "FILES", szProgFileDir$, szLocalProgPath$
- AddSectionFilesTOCopyList "INSTALL", szProgFileDir$, szLocalProgPath$
- CopyFilesInCopyList
- CopyFile szProgFileDir$+"\ReadMe.TXT", szLocalProgPath$+"\ReadMe.TXT", cmoOverwrite,0
- CopyFile szProgFileDir$+"\Install.INI", szLocalProgPath$+"\Install.INI", cmoOverwrite,0
- END IF
-
- nCursor% = ShowWaitCursor()
- hwndProg% = ProgressBegin("PROGRESSTEMPLATE", "Copying user files...")
-
- CreateDir szUserDir$, cmoNone
-
- ''
- '' Copy all files in the subdirectory CCMAIL into user directory
- '' and also to default user directory.
- ''
- szTempPath$ = SrcDir$ + "CCUSER"
- szWMailPath$ = AppendPath$(szUserDir$, "WMail.INI")
-
- n% = wCopyCannedFiles(szTempPath$, szUserDir$, szWMailPath$)
- n% = wCopyDir(szTempPath$, szCCMailDir$, 0)
- n% = SetFileTimeForDir(szUserDir$, FILETIME, 0)
- n% = SetFileTimeForDir(szCCMailDir$, FILETIME, 0)
-
- IF szCopyAllFiles$ = "Y" THEN
- CreateDir szLocalProgPath$ + "\CCUSER", cmoNone
- szPath1$ = szProgFileDir$ + "CCUSER"
- szPath2$ = szLocalProgPath$ + "\CCUSER"
- n% = wCopyDir(szPath1$, szPath2$, 0)
- END IF
-
- END SUB
-
-
-
- '*************************************************************************
- '**
- '** AddPath - Add our program path to PATH variable in AutoExec.BAT
- '**
- '*************************************************************************
-
- SUB AddPath STATIC
-
- nModify% = bSetPathInAutoExec(szProgFileDir$, 0)
-
- IF nModify% = 1 THEN
-
- WARNAUTOEXEC_DLG:
-
- sz$ = UIStartDlg(CUIDLL$, WARN_AUTOEXEC, "WarnAutoexecDlgProc", APPHELP, HELPPROC$)
- UIPop 1
- nDoIt% = 0
- IF sz$ = "CONTINUE" THEN
- nDoIt% = 1
-
- ELSEIF sz$ = "CANCEL" THEN
- sz$ = UIStartDlg(CUIDLL$, WARN_SKIPCHANGE, "WarnSkipChangeDlgProc", APPHELP, HELPPROC$)
- UIPop 1
-
- IF sz$ = "BACK" THEN
- GOTO WARNAUTOEXEC_DLG
-
- ELSEIF sz$ = "EXIT" THEN
- DoAskQuit
- GOTO WARNAUTOEXEC_DLG
- END IF
-
- ELSEIF sz$ = "EXIT" THEN
- DoAskQuit
- GOTO WARNAUTOEXEC_DLG
- END IF
-
- IF nDoIt% = 1 THEN
- n% = bRenameAutoExec()
- bNeedRestart% = 1
- END IF
- END IF
-
- END SUB
-
-
- '*************************************************************************
- '**
- '** CheckEnvironment
- '** Check the user's environment (TEMP)
- '**
- '*************************************************************************
-
- SUB CheckEnvironment STATIC
-
- szTemp$ = GetEnvVariableValue("TEMP")
-
- IF szTemp$ <> "" THEN
- ''
- '' Check if we can write to that directory.
- ''
- IF IsDirWritable(szTemp$) = 0 THEN
- sz$ = UIStartDlg(CUIDLL$, BADTEMPDIR, "TempDirDlgProc", 0, "")
- UIPop 1
- END IF
- ELSE
- sz$ = UIStartDlg(CUIDLL$, NOTEMPDIR, "TempDirDlgProc", 0, "")
- UIPop 1
- END IF
-
- END SUB
-
-
-
- '*************************************************************************
- '**
- '** SayTooBig - not enough disk space
- '**
- '*************************************************************************
-
- SUB SayTooBig STATIC
-
- SAYTOOBIG_LABEL:
-
- sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO SAYTOOBIG_LABEL
- END IF
- UIPop 1
-
- END SUB
-
-
- '*************************************************************************
- '**
- '** DoAskQuit - confirm for exit
- '**
- '*************************************************************************
-
- SUB DoAskQuit STATIC
-
- ASKQUIT_LABEL:
-
- sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
-
- IF sz$ = "EXIT" THEN
- UIPopAll
- ERROR STFQUIT
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO ASKQUIT_LABEL
- ELSE
- UIPop 1
- END IF
-
- END SUB
-
- '*-------------------------------------------------------------------------
- '*
- '* Invalid Path:
- '* Gives an error message for bad path specified.
- '*
- '*-------------------------------------------------------------------------
-
- FUNCTION InvalidPath (szDir$, szMsg$) STATIC AS INTEGER
-
- SetSymbolValue "InvalidErrMsg", szMsg$
- SetSymbolValue "ProgFileDir", szDir$
-
- BADPATH_INIT:
- sz$ = UIStartDlg(CUIDLL$, INVALID_PATH, "InvalidPathDlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO BADPATH_INIT
- END IF
- UIPop 1
- InvalidPath = 1
-
- END FUNCTION
-