home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sitting on the Farm
/
FARM.bin
/
sample1.mst
< prev
next >
Wrap
Text File
|
1994-03-03
|
5KB
|
158 lines
'**************************************************************************
'* SOTF Setup
'**************************************************************************
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''Dialog ID's
CONST WELCOME = 100
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST OPTIONS = 800
CONST APPHELP = 900
CONST OPTIONS2 = 1000
CONST BADPATH = 6400
''Bitmap ID
CONST LOGO = 1
''File Types
CONST APPFILES = 1
CONST OPTFILES1 = 2
CONST OPTFILES2 = 3
GLOBAL DEST$ ''Default destination directory.
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
INIT:
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle "Sitting on the Farm Setup"
GOTO INSTALL
'$IFDEF DEBUG
i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
WinDrive$ = MID$(GetWindowsDir, 1, 1)
IF IsDriveValid(WinDrive$) = 0 THEN
i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
GOTO QUIT
END IF
'$ENDIF ''DEBUG
WELCOME:
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
GOSUB ASKQUIT
GOTO WELCOME
END IF
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = EXITSUCCESS
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
END
ERRQUIT:
i% = DoMsgBox("Installation Incomplete!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO BADPATH
END IF
UIPop 1
RETURN
ASKQUIT:
sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
IF sz$ = "EXIT" THEN
UIPopAll
ERROR STFQUIT
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ASKQUIT
ELSE
UIPop 1
END IF
RETURN
INSTALL:
STARTUPDIR$ = GetSymbolValue("STF_SRCDIR")
ICONID$ = STARTUPDIR$ + "SOTF.ico, 0, 0, 0," + STARTUPDIR$
MOREFUN$ = STARTUPDIR$ + "MOREFUN.ico, 0, 0, 0," + STARTUPDIR$
StartEPath$ = FindFileInTree ("SOTFE.EXE", STARTUPDIR$ + "English")
StartFPath$ = FindFileInTree ("SOTFF.EXE", STARTUPDIR$ + "French")
StartSPath$ = FindFileInTree ("SOTFS.EXE", STARTUPDIR$ + "Spanish")
StartXPath$ = FindFileInTree ("MOREFUN.EXE", STARTUPDIR$ + "External")
'**********************************
'Create the Program Group and Items
'**********************************
IF StartEPath$ <> "" AND StartFPath$ <> "" AND StartSPath <> "" AND StartXPath$ <> "" THEN
CreateProgmanGroup "I_Learn", "", cmoNone
ShowProgmanGroup "I_Learn", 1, cmoNone
CreateProgmanItem "I_Learn", "Farm - English", StartEPath$, ICONID$, cmoOverwrite
CreateProgmanItem "I_Learn", "Farm - French", StartFPath$, ICONID$, cmoOverwrite
CreateProgmanItem "I_Learn", "Farm - Spanish", StartSPath$, ICONID$, cmoOverwrite
CreateProgmanItem "I_Learn", "More Fun", StartXPath$, MOREFUN$, cmoOverwrite
'**********************************
'Copy .INI files to Windows.
'**********************************
IniEPath$ = FindFileInTree ("SOTFE.INI", STARTUPDIR$ + "English")
IniFPath$ = FindFileInTree ("SOTFF.INI", STARTUPDIR$ + "French")
IniSPath$ = FindFileInTree ("SOTFS.INI", STARTUPDIR$ + "Spanish")
WinDir$ = GetWindowsDir()
IF IniEPath$ <> "" AND IniFPath <> "" AND IniSPath <> "" THEN
CopyFile IniEPath$, WinDir$ + "SOTFE.INI", cmoOverwrite, 0
CopyFile IniFPath$, WinDir$ + "SOTFF.INI", cmoOverwrite, 0
CopyFile IniSPath$, WinDir$ + "SOTFS.INI", cmoOverwrite, 0
SOTFARM% = DoMsgBox ( "The installation process is complete.", "Sitting on the Farm", MB_OK)
ELSE
SOTFARM% = DoMsgBox ( "Can't find file needed files", "Install Error", MB_OK)
END IF
ELSE
SOTFARM% = DoMsgBox ( "Can't find Sitting on the Farm", "Install Error", MB_OK)
END IF