home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Desktop Works 1995 - 1996
/
desktopworks1995-1996.iso
/
scrnsave
/
big_desk
/
backdesk.mst
< prev
next >
Wrap
Text File
|
1996-01-01
|
10KB
|
341 lines
'**************************************************************************
'* Microcosm Setup Program
'**************************************************************************
'$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 BADPATH = 6400
CONST RESTART = 1100
CONST MAKESHELL = 7900
CONST PROBSYS = 8000
CONST SYSMENU = 8100
CONST SHELLRESTART = 8200
''Bitmap ID
CONST LOGO = 1
GLOBAL DEST$ ''Default destination directory.
GLOBAL WINDRIVE$ ''Windows drive letter.
GLOBAL szWinDir$ ''Windows directory.
GLOBAL szWinSysDir$ ''Windows system directory
GLOBAL szDirTmp$ ''Temporary directory.
GLOBAL szIniDir$
GLOBAL szIniEntry$
GLOBAL szAutoDir$
GLOBAL CUIDLL$
GLOBAL szOut$
GLOBAL IsShell%
DECLARE SUB Install
DECLARE SUB AskQuitInstall
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION GetPrivateProfileString LIB "kernel" (szSect$, szKey$, szDefault$,szBuf$, cbBuf%, szIni$) AS INTEGER
DECLARE FUNCTION ExitWindows LIB "user" (p1&, p2%) AS INTEGER
INIT:
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle "BackDesk Install Program"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "Setup.INF"
END IF
ReadInfFile szInf$
OPTCUR$ = "1"
i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
WinDrive$ = MID$(GetWindowsDir, 1, 1)
szWinDir$ = GetWindowsDir()
szWinSysDir$ = GetWindowsSysDir()
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
DEST$ = MakePath(szWinDir$,"BackDesk")
'' Check Windows Version
IF (GetWindowsMajorVersion() < 3) OR ((GetWindowsMajorVersion() = 3) AND (GetWindowsMinorVersion() < 1)) THEN
i% = DoMsgBox("BackDesk requires Windows V3.1 to run.","BackDesk Install",MB_OK+MB_ICONEXCLAMATION)
END IF
WELCOME:
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
AskQuitInstall
GOTO WELCOME
END IF
GETPATH:
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
GETPATHL1:
sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
DEST$ = GetSymbolValue("EditTextOut")
IF sz$ = "CONTINUE" THEN
IF IsDirWritable(DEST$) = 0 THEN
GOSUB BADPATH
GOTO GETPATHL1
END IF
UIPop 1
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETPATHL1
ELSEIF sz$ = "BACK" THEN
UIPop 1
GOTO WELCOME
ELSE
AskQuitInstall
GOTO GETPATH
END IF
Install
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
IF IsShell% = 1 THEN
dlg% = SHELLRESTART
ELSE
dlg% = EXITSUCCESS
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
END
ERRQUIT:
i% = DoMsgBox("Setup sources were corrupted!", "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
''AskQuitInstall was here
'**
'** Purpose:
'** Builds the copy list and performs all installation operations.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
SUB Install STATIC
SrcDir$ = GetSymbolValue("STF_SRCDIR")
CreateDir DEST$, cmoNone
SetRestartDir(DEST$)
OpenLogFile MakePath(DEST$, "LOGFILE.OUT"), 0
WriteToLogFile ""
WriteToLogFile " User chose as destination directory: '" + DEST$ + "'"
WriteToLogFile ""
WriteToLogFile "May have had to create the directory: " + DEST$
WriteToLogFile ""
AddSectionFilesToCopyList "BackDesk", SrcDir$, DEST$
AddSectionFilesToCopyList "BackDesk Tools", SrcDir$, DEST$
AddSectionFilesToCopyList "BackDrop Tools", SrcDir$, DEST$
IF IsDIRWritable(szWinSysDir$) = 0 THEN
MYSYSPROB:
sz$ = UIStartDlg(CUIDLL$, PROBSYS, "FInfoDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
AskQuitInstall
GOTO MYSYSPROB
END IF
AddSectionFilesToCopyList "Windows", SrcDir$, DEST$
ELSE
AddSectionFilesToCopyList "Windows", SrcDir$, szWinSysDir$
END IF
CopyFilesInCopyList
CreateIniKeyValue "WIN.INI","Extensions","GRP",MakePath(DEST$,"popgroup.exe")+" ^.GRP",cmoOverwrite
CreateProgmanGroup "BackDesk", "backdesk.grp", cmoNone
ShowProgmanGroup "BackDesk", 1, cmoNone
'
' Main programs
'
CreateProgmanItem "BackDesk", "BackMenu V3.0", MakePath(DEST$,"backmenu.exe"), "", cmoOverwrite
CreateProgmanItem "BackDesk", "BigDesk V3.0", MakePath(DEST$,"bigdesk.exe"), "", cmoOverwrite
CreateProgmanItem "BackDesk", "BackDesk 3.0 Help", MakePath(DEST$,"backdesk.hlp"), "", cmoOverwrite
'
' BackDesk Tools
'
CreateProgmanItem "BackDesk", "WRUN Windows Server", MakePath(DEST$,"wrunserv.exe")+" -hide", "", cmoOverwrite
'
' BackDrop Tools
'
CreateProgmanItem "BackDesk", "Copy Files Tool", MakePath(DEST$,"copytool.exe"), "", cmoOverwrite
CreateProgmanItem "BackDesk", "Drag/Drop Clipboard Tool", MakePath(DEST$,"dropclip.exe"), "", cmoOverwrite
CreateProgmanItem "BackDesk", "Remove Files/Aliases Tool", MakePath(DEST$,"dustbin.exe"), "", cmoOverwrite
CreateProgmanItem "BackDesk", "Task to Alias Tool", MakePath(DEST$,"t2alias.exe"), "", cmoOverwrite
CreateProgmanItem "BackDesk", "Wallpaper Changing Tool", MakePath(DEST$,"wallpapr.exe"), "", cmoOverwrite
'
' Add some interesting aliases in (but only if there aren't any
'
szOut$=""
for i%=1 to 256
szOut$=szout$+"*"
next
spserv$=MakePath(szWinDir$,"SP-SERV.INI")
i%=GetPrivateProfileString("ToolPlaces","Tool0","",szOut$,255,spserv$)
if i% = 0 THEN
CreateIniKeyValue spserv$,"ToolPlaces","Tool0","0,197,1,Notepad,"+MakePath(szWinDir$,"NOTEPAD.EXE")+",0,0,notepad.exe #", cmoOverwrite
CreateIniKeyValue spserv$,"ToolPlaces","Tool1","0,349,1,BackDesk 3.0 Help,winhelp.exe ,0,0,"+MakePath(DEST$,"BACKDESK.HLP")+" #", cmoOverwrite
CreateIniKeyValue spserv$,"ToolPlaces","Tool2","0,121,1,Control Panel,"+MakePath(szWinDir$,"CONTROL.EXE")+",0,0,CONTROL.EXE #", cmoOverwrite
CreateIniKeyValue spserv$,"ToolPlaces","Tool3","0,45,1,File Mangler,"+MakePath(szWinDir$,"WINFILE.EXE")+",0,0,{XPO=53 YPO=37 WID=580 HEI=434 NOR XDESK=0 YDESK=0 SIN TIT=""File Manager""}"+MakePath(szWinDir$,"WINFILE.EXE"), cmoOverwrite
CreateIniKeyValue spserv$,"ToolPlaces","Tool4","0,273,1,BackDesk goodies,"+MakePath(DEST$,"popgroup.exe")+",0,0,"+MakePath(szWinDir,"BACKDESK.GRP"), cmoOverwrite
END IF
'
' Do you want BackDesk to enable system menu hooks or not
'
szSysMenu$ = "0"
sz$ = UIStartDlg(CUIDLL$, SYSMENU, "FInfoDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
szSysMenu$="1"
END IF
UIPop 1
CreateIniKeyValue spserv$,"BackDesk","EnableSystemMenuEntries",szSysMenu$, cmoOverwrite
'
' Add in details of programs which don't like system hooks
'
szDisable$="Disable System Menu Hook"
CreateIniKeyValue spserv$,szDisable$,"_LNOTES.EXE","1",cmoOverwrite
CreateIniKeyValue spserv$,szDisable$,"BMEDIT.EXE","1",cmoOverwrite
'
' Use the default menu used if theres nothing defines
'
szOut$=""
for i%=1 to 256
szOut$=szout$+"*"
next
i%=GetPrivateProfileString("Back-Menu","IniFile","",szOut$,255,spserv$)
IF i%=0 THEN
CreateIniKeyValue spserv$,"Back-Menu","IniFile",MakePath(DEST$,"BACKDESK.MNU"), cmoOverwrite
END IF
'
' M