home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Direct 1997 April
/
970129_1439.ISO
/
SPELL
/
SETUP.MS_
/
SETUP.bin
Wrap
Text File
|
1997-04-09
|
5KB
|
168 lines
'**************************************************************************
'* MSSetup Toolkit SpellWrite
'**************************************************************************
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''Dialog ID's
CONST WELCOME = 100
CONST INSTALLED = 200
CONST ASKQUIT = 300
CONST DESTPATH = 400
CONST EXITFAILURE = 500
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST OPTIONS = 800
CONST APPHELP = 900
''Bitmap ID
CONST LOGO = 1
GLOBAL EXEDEST$ ''Default destination directory.
GLOBAL DLLDEST$ ''Default destination directory.
GLOBAL OPTCUR$ ''Option selection from option dialog.
DECLARE SUB Install
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
INIT:
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle "SpellWrite Setup"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
END IF
ReadInfFile szInf$
OPTCUR$ = "1"
EXEDEST$ = GetWindowsDir() + "FUTURE\SPELLWRI"
DLLDEST$ = GetWindowsSysDir()
WELCOME:
SetSymbolValue "EditTextIn", EXEDEST$
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
EXEDEST$ = GetSymbolValue("EditTextOut")
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
GOSUB ASKQUIT
GOTO WELCOME
END IF
drive$ = MID$(EXEDEST$, 1, 1)
free& = GetFreeSpaceForDrive(drive$)
IF free& > 1000000 THEN
Install
ELSE
i% = DoMsgBox("Insufficient disk space for installation, 1.1MB required.", "Warning", MB_OK+MB_TASKMODAL+MB_ICONHAND)
GOTO QUITL1
ENDIF
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = EXITSUCCESS
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSE
dlg% = EXITFAILURE
END IF
QUITL1:
END
ERRQUIT:
i% = DoMsgBox("Setup sources were corrupted, call Technical Support on 091-4910500!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
ASKQUIT:
sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", APPHELP, "")
IF sz$ = "EXIT" THEN
UIPopAll
ERROR STFQUIT
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ASKQUIT
ELSE
UIPop 1
END IF
RETURN
'**
'** Purpose:
'** Builds the copy list and performs all installation operations.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
SUB Install STATIC
SrcDir$ = GetSymbolValue("STF_SRCDIR")
CreateDir EXEDEST$, cmoNone
AddSectionFilesToCopyList "SpellWriteEXE", SrcDir$, EXEDEST$
AddSectionFilesToCopyList "SpellWriteDLL", SrcDir$, DLLDEST$
CopyFilesInCopyList
ini$ = MakePath(GetWindowsDir(), "FUTURE.INI")
CreateProgmanGroup "Future", "", cmoNone
ShowProgmanGroup "Future", 1, cmoNone
CreateProgmanItem "Startup", "SpellWrite", EXEDEST$ + "\spellwri.exe", "", cmoOverwrite
CreateProgmanItem "Future", "SpellWrite", EXEDEST$ + "\spellwri.exe", "", cmoOverwrite
CreateIniKeyValue "WIN.INI", "sounds", "SpellWrite_Correct", ",Spelling correct", cmoNone
CreateIniKeyValue "WIN.INI", "sounds", "SpellWrite_Mistake", ",Spelling incorrect", cmoNone
CreateIniKeyValue ini$, "SpellWrite", "path", EXEDEST$, cmoOverwrite
CreateIniKeyValue ini$, "SpellWrite", "Custom", EXEDEST$ + "\FSD_CUST.DCT", cmoOverwrite
CreateIniKeyValue ini$, "SpellWrite", "OnlyAddToCustomDict", "0", cmoOverwrite
CreateIniKeyValue ini$, "SpellWrite", "LoadWrite", "0", cmoOverwrite
CreateIniKeyValue ini$, "SpellWrite", "ShowLogo", "0", cmoOverwrite
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
i% = DoMsgBox("Installation complete.", "SpellWrite Setup", MB_OK+MB_TASKMODAL+MB_ICONHAND)
sz$ = UIStartDlg(CUIDLL$, INSTALLED, "InstalledProc", APPHELP, INSTALLEDPROC$)
END SUB
'**
'** Purpose:
'** Appends a file name to the end of a directory path,
'** inserting a backslash character as needed.
'** Arguments:
'** szDir$ - full directory path (with optional ending "\")
'** szFile$ - filename to append to directory
'** Returns:
'** Resulting fully qualified path name.
'*************************************************************************
FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
IF szDir$ = "" THEN
MakePath = szFile$
ELSEIF szFile$ = "" THEN
MakePath = szDir$
ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
MakePath = szDir$ + szFile$
ELSE
MakePath = szDir$ + "\" + szFile$
END IF
END FUNCTION