home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 February
/
PCWK0297.iso
/
narzedzi
/
futlock3
/
setup.ms_
/
setup.bin
Wrap
Text File
|
1996-09-09
|
5KB
|
175 lines
'**************************************************************************
'* MSSetup Toolkit FutureLock
'**************************************************************************
'$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 WINDEST$ ''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 "FutureLock V2.0 Setup"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
END IF
ReadInfFile szInf$
OPTCUR$ = "1"
EXEDEST$ = GetWindowsDir() + "FUTURE\LOCK"
DLLDEST$ = GetWindowsSysDir()
WINDEST$ = GetWindowsDir()
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& > 500000 THEN
Install
ELSE
i% = DoMsgBox("Insufficient disk space for installation, 500k 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
CopyFile SrcDir$ + "REGISTER.WRI", EXEDEST$ + "\REGISTER.WRI", 0, 0
CopyFile SrcDir$ + "LICENSE.TXT", EXEDEST$ + "\LICENSE.TXT", 0, 0
CopyFile SrcDir$ + "VENDOR.TXT", EXEDEST$ + "\VENDOR.TXT", 0, 0
CopyFile SrcDir$ + "README.WRI", EXEDEST$ + "\README.WRI", 0, 0
AddSectionFilesToCopyList "FutureLockEXE", SrcDir$, EXEDEST$
AddSectionFilesToCopyList "FutureLockDLL", SrcDir$, DLLDEST$
AddSectionFilesToCopyList "FutureLockWIN", SrcDir$, WINDEST$
CopyFilesInCopyList
iniFut$ = MakePath(GetWindowsDir(), "FUTURE.INI")
ini$ = MakePath(GetWindowsDir(), "FUTLOCK.INI")
iniSys$ = MakePath(GetWindowsDir(), "SYSTEM.INI")
CreateProgmanGroup "Future", "", cmoNone
ShowProgmanGroup "Future", 1, cmoNone
CreateProgmanItem "Future", "Readme", EXEDEST$ + "\readme.wri", "", cmoOverwrite
CreateProgmanItem "Future", "FutureLock Registration Form", EXEDEST$ + "\register.wri", "", cmoOverwrite
CreateProgmanItem "Future", "FutureLock", EXEDEST$ + "\futlock.exe", "", cmoOverwrite
CreateProgmanItem "Future", "FutureLock Uninstall", DLLDEST$ + "uninstal.exe", "", cmoOverwrite
CreateIniKeyValue ini$, "FutureLock", "path", EXEDEST$, cmoOverwrite
CreateIniKeyValue iniFut$, "BubbleHelp", "~FSDFutureLockSetup", EXEDEST$ + "\FSDLKBUB.HLP", cmoOverwrite
CreateIniKeyValue iniFut$, "BubbleHelp", "~FSDFutureLockShell", EXEDEST$ + "\FSDLKBUB.HLP", cmoOverwrite
CreateIniKeyValue iniFut$, "BubbleHelp", "~FSDFutureLockUninstall", EXEDEST$ + "\FSDLKBUB.HLP", cmoOverwrite
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
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