home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CC-CD 2
/
cc_cd_2.nrg
/
view.mst
< prev
next >
Wrap
Text File
|
1994-11-02
|
20KB
|
549 lines
'$DEFINE DEBUG
'**************************************************************************
'*
'* TITLE.MST - Viewer Runtime Setup Script
'*
'* CUSTOMIZING TITLE.MST
'*
'* For a simple Setup routine, you just need to assign values to the
'* series of variables following the heading "Setup Variables". This
'* script also provides for the following more-advanced options, which
'* are supported by subroutines located later in this script:
'*
'* Option See Subroutine
'* ------------------------------------------ ---------------------
'* Install more than one .MVB file ModifyViewerIni
'* Install Help title ModifyViewerIni
'* Install custom DLLs ModifyViewerIni
'* Install multiple Program Manager items ModifyProgramManager
'* Display a custom icon with the ProgMan item ModifyProgramManager
'* Install custom fonts RegisterCustomFonts
'* Install Video for Windows runtime files RegisterDrivers
'*
'* Each customization note starts with the heading CUSTOMIZATION.
'*
'**************************************************************************
'' Global variables
GLOBAL TitleShortName$
GLOBAL TitleLongName$
GLOBAL MVBFileName$
GLOBAL PromptForPath%
GLOBAL DefaultPath$
GLOBAL ProgManGroup$
GLOBAL ProgManItem$
'' directory names on CD to find source files
GLOBAL CDWinDir$
GLOBAL CDSysDir$
GLOBAL CDViewDir$
GLOBAL CDMvbDir$
GLOBAL CDMvbFullDir$
GLOBAL CDMvbFullName$
GLOBAL CDOurDir$
GLOBAL CDDrive$
GLOBAL SetupFileName$
GLOBAL ListWin$
GLOBAL ListSys$
GLOBAL ListView$
GLOBAL ListOur$
'' ****************************************************************
'' ** Setup Variables
'' ****************************************************************
'' fill in directory names for source files
'' assuming we (the setup program) are in the root directory
'' of the CD
'' titles to be copied to WIN directory
CDWinDir$ = "WIN"
'' titles to be copied to WIN\SYSTEM directory
CDSysDir$ = "SYSTEM"
'' titles to be copied to user chosen directory
CDViewDir$ = "MVSYS"
'' where to find our MVB stuff on the CD-ROM - end up with backslash !!!
CDMvbDir$ = "CATALOG"
'' where to find our own stuff to be copied onto harddisk
CDOurDir$ = "BESTEL"
'' name of the setup .LST file
SetupFileName$ = "VIEW.INF"
'' name of entry in .LST for WIN files
ListWin$ = "WINWIN"
'' name of entry in .LST for WIN/SYSTEM files
ListSys$ = "WINSYS"
'' name of entry in .LST for VIEWER files
ListView$ = "VIEWER"
'' name of entry in .LST for our own files to be copied
ListOur$ = "CCCD"
'' Set the following string to a short form of the title name
'' (for example, "Gallery")
TitleShortName$ = "CATALOG2"
'' Set the following string to a long form of the title name
'' (for example, "Viewer 2.0 Gallery")
'' NB-hl mag niet te lang zijn !!!!
TitleLongName$ = "CC Catalogus Nr.2"
'' Set the following variable to the name of the MVB file, without
'' the filename extension (for example, "GALLERY")
MVBFileName$ = "CCCD2"
'' The following variable determines whether Setup prompts the user
'' to specify a directory in which to install title files. (Files
'' to be installed on the hard disk must be listed in the TITLE.INF
'' file under the [Installed Title Files] section.) Specify one of
'' the following values:
''
'' 0 Install title files in the Windows directory (default setting).
'' This is an appropriate setting if you have a limited number
'' of files to copy (for example, a single custom icon or DLL).
''
'' 1 Display a dialog box to prompt the user for a directory in
'' which to install files
PromptForPath% = 0
'' If you have specified 1 in PromptForPath%, set the following
'' variable to the default path that will be displayed in the dialog
'' box (for example, "C:\GALLERY").
DefaultPath$ = "C:\VIEWER"
'' Set the following variable to the name of the program manager
'' group you would like to create (for example, "Viewer 2.0 Gallery")
ProgManGroup$ = "CD-ROM Viewer"
'' Set the following variable to the caption of the program manager
'' item for your title (for example, "Gallery")
ProgManItem$ = "Computercollectief Catalogus nr.2"
'***********************************************************************
'** Mainline
'***********************************************************************
GLOBAL CUIDLL$
'' Include files
'$INCLUDE 'setupapi.inc'
'' Custom UI dll
CUIDLL$ = "mscuistf.dll"
'' Dialog ID's
CONST DESTPATH = 1000
CONST APPHELP = 2000
CONST TOOBIG = 3000
CONST BADPATH = 4000
CONST SUCCESS = 5000
'' Bitmap ID
CONST LOGO = 1
'' Functions and subroutines
DECLARE FUNCTION AddFont LIB "mscuistf.dll" (szFont$, szName$) AS INTEGER
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION GetTitleDir (szDefault$) AS STRING
DECLARE FUNCTION CopyFiles(szTitleDir$) AS INTEGER
DECLARE SUB RegisterFont(fontfile$, fontname$)
DECLARE SUB ModifyViewerIni
DECLARE SUB RegisterCustomFonts
DECLARE SUB ModifyProgramManager
DECLARE SUB ShowSuccess(szDestDir$)
DECLARE SUB RegisterDrivers
DECLARE SUB DebugInfo(szText$)
'' The following statement turns size checking off. Set it to scmOnFatal
'' to enable size checking, where Setup will compare the disk file size
'' with the INF file size and report an error if they are not the same.
i% = SetSizeCheckMode(scmOnFatal)
'' set up some (full) path names
CDMvbFullDir$ = MakePath(GetSymbolValue("STF_SRCDIR"), CDMvbDir$)
CDMvbFullName$ = CDMvbFullDir$ + "\" + MVBFileName$ + ".MVB"
CDDrive$ = MID$(CDMvbFullDir$, 1, 1)
'' Set the title and banner bitmap. You must rebuild MSCUISTF.DLL to
'' alter the banner bitmap.
SetTitle "Installatie Catalogus Computercollectief"
SetBitmap CUIDLL$, LOGO
'' Read in the INF file.
ReadInfFile MakePath(GetSymbolValue("STF_SRCDIR"), SetupFileName$)
'' Decide where to put title files
IF PromptForPath% = 1 THEN
szTitleDir$ = GetTitleDir(DefaultPath$)
IF szTitleDir$ = "" THEN
GOTO QUIT
ENDIF
ELSE
szTitleDir$ = GetWindowsDir()
ENDIF
'' Copy files
IF CopyFiles(szTitleDir$) = 0 THEN
GOTO QUIT
ENDIF
'' Create the MVIEWER2.EXE MVB association
CreateIniKeyValue "WIN.INI", "Extensions", "MVB", "mviewer2.exe ^.mvb", cmoOverwrite
'' Register in VIEWER.INI
ModifyViewerIni
'' Register custom fonts
'' RegisterCustomFonts
'' Register drivers
RegisterDrivers
'' Modify Program Manager
ModifyProgramManager
'' Success dialog
'' ShowSuccess(szTitleDir$)
'' Now start the title
CHDRIVE CDDrive$
CHDIR CDMvbFullDir$
RUN "mviewer2.exe " + MVBFileName$ + ".MVB", NOWAIT
QUIT:
END
'********************************************************************