home *** CD-ROM | disk | FTP | other *** search
/ CC-CD 2 / cc_cd_2.nrg / view.mst < prev    next >
Text File  |  1994-11-02  |  20KB  |  549 lines

  1. '$DEFINE DEBUG
  2.  
  3. '**************************************************************************
  4. '*
  5. '* TITLE.MST - Viewer Runtime Setup Script
  6. '*
  7. '* CUSTOMIZING TITLE.MST
  8. '*
  9. '* For a simple Setup routine, you just need to assign values to the
  10. '* series of variables following the heading "Setup Variables". This
  11. '* script also provides for the following more-advanced options, which
  12. '* are supported by subroutines located later in this script:
  13. '*
  14. '* Option                                         See Subroutine
  15. '* ------------------------------------------     ---------------------
  16. '* Install more than one .MVB file                ModifyViewerIni
  17. '* Install Help title                             ModifyViewerIni
  18. '* Install custom DLLs                            ModifyViewerIni
  19. '* Install multiple Program Manager items         ModifyProgramManager
  20. '* Display a custom icon with the ProgMan item    ModifyProgramManager
  21. '* Install custom fonts                           RegisterCustomFonts
  22. '* Install Video for Windows runtime files        RegisterDrivers
  23. '*
  24. '* Each customization note starts with the heading CUSTOMIZATION.
  25. '*
  26. '**************************************************************************
  27.  
  28.         '' Global variables
  29.  
  30.         GLOBAL TitleShortName$
  31.         GLOBAL TitleLongName$
  32.         GLOBAL MVBFileName$
  33.         GLOBAL PromptForPath%
  34.         GLOBAL DefaultPath$
  35.         GLOBAL ProgManGroup$
  36.         GLOBAL ProgManItem$
  37.  
  38.         '' directory names on CD to find source files
  39.         GLOBAL CDWinDir$
  40.         GLOBAL CDSysDir$
  41.         GLOBAL CDViewDir$
  42.         GLOBAL CDMvbDir$
  43.         GLOBAL CDMvbFullDir$
  44.         GLOBAL CDMvbFullName$
  45.         GLOBAL CDOurDir$
  46.         GLOBAL CDDrive$
  47.         GLOBAL SetupFileName$
  48.         GLOBAL ListWin$
  49.         GLOBAL ListSys$
  50.         GLOBAL ListView$
  51.         GLOBAL ListOur$
  52.  
  53.  
  54.         '' ****************************************************************
  55.         '' ** Setup Variables
  56.         '' ****************************************************************
  57.  
  58.         '' fill in directory names for source files
  59.         ''   assuming we (the setup program) are in the root directory
  60.         ''   of the CD
  61.         '' titles to be copied to WIN directory
  62.         CDWinDir$  = "WIN"
  63.         '' titles to be copied to WIN\SYSTEM directory
  64.         CDSysDir$  = "SYSTEM"
  65.         '' titles to be copied to user chosen directory
  66.         CDViewDir$ = "MVSYS"
  67.         '' where to find our MVB stuff on the CD-ROM  - end up with backslash !!!
  68.         CDMvbDir$  = "CATALOG"
  69.         '' where to find our own stuff to be copied onto harddisk
  70.         CDOurDir$  = "BESTEL"
  71.         '' name of the setup .LST file
  72.         SetupFileName$ = "VIEW.INF"
  73.         '' name of entry in .LST for WIN files
  74.         ListWin$ = "WINWIN"
  75.         '' name of entry in .LST for WIN/SYSTEM files
  76.         ListSys$ = "WINSYS"
  77.         '' name of entry in .LST for VIEWER files
  78.         ListView$ = "VIEWER"
  79.         '' name of entry in .LST for our own files to be copied
  80.         ListOur$ = "CCCD"
  81.         '' Set the following string to a short form of the title name
  82.         '' (for example, "Gallery")
  83.  
  84.         TitleShortName$ = "CATALOG2"
  85.  
  86.         '' Set the following string to a long form of the title name
  87.         '' (for example, "Viewer 2.0 Gallery")
  88.         '' NB-hl  mag niet te lang zijn !!!!
  89.         TitleLongName$ = "CC Catalogus Nr.2"
  90.  
  91.         '' Set the following variable to the name of the MVB file, without
  92.         '' the filename extension (for example, "GALLERY")
  93.  
  94.         MVBFileName$ = "CCCD2"
  95.  
  96.         '' The following variable determines whether Setup prompts the user
  97.         '' to specify a directory in which to install title files. (Files
  98.         '' to be installed on the hard disk must be listed in the TITLE.INF
  99.         '' file under the [Installed Title Files] section.) Specify one of
  100.         '' the following values:
  101.         ''
  102.         '' 0    Install title files in the Windows directory (default setting).
  103.         ''      This is an appropriate setting if you have a limited number
  104.         ''      of files to copy (for example, a single custom icon or DLL).
  105.         ''
  106.         '' 1    Display a dialog box to prompt the user for a directory in
  107.         ''      which to install files
  108.  
  109.         PromptForPath% = 0
  110.  
  111.         '' If you have specified 1 in PromptForPath%, set the following
  112.         '' variable to the default path that will be displayed in the dialog
  113.         '' box (for example, "C:\GALLERY").
  114.  
  115.         DefaultPath$ = "C:\VIEWER"
  116.  
  117.         '' Set the following variable to the name of the program manager
  118.         '' group you would like to create (for example, "Viewer 2.0 Gallery")
  119.  
  120.         ProgManGroup$ = "CD-ROM Viewer"
  121.  
  122.         '' Set the following variable to the caption of the program manager
  123.         '' item for your title (for example, "Gallery")
  124.  
  125.         ProgManItem$ = "Computercollectief Catalogus nr.2"
  126.  
  127.         '***********************************************************************
  128.         '** Mainline
  129.         '***********************************************************************
  130.  
  131.         GLOBAL CUIDLL$
  132.  
  133.         '' Include files
  134.         '$INCLUDE 'setupapi.inc'
  135.  
  136.         '' Custom UI dll
  137.         CUIDLL$ = "mscuistf.dll"
  138.  
  139.         '' Dialog ID's
  140.         CONST DESTPATH      = 1000
  141.         CONST APPHELP       = 2000
  142.         CONST TOOBIG        = 3000
  143.         CONST BADPATH       = 4000
  144.         CONST SUCCESS       = 5000
  145.  
  146.         '' Bitmap ID
  147.         CONST LOGO = 1
  148.  
  149.         '' Functions and subroutines
  150.         DECLARE FUNCTION AddFont LIB "mscuistf.dll" (szFont$, szName$) AS INTEGER
  151.         DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  152.         DECLARE FUNCTION GetTitleDir (szDefault$) AS STRING
  153.         DECLARE FUNCTION CopyFiles(szTitleDir$) AS INTEGER
  154.         DECLARE SUB RegisterFont(fontfile$, fontname$)
  155.         DECLARE SUB ModifyViewerIni
  156.         DECLARE SUB RegisterCustomFonts
  157.         DECLARE SUB ModifyProgramManager
  158.         DECLARE SUB ShowSuccess(szDestDir$)
  159.         DECLARE SUB RegisterDrivers
  160.         DECLARE SUB DebugInfo(szText$)
  161.  
  162.         '' The following statement turns size checking off. Set it to scmOnFatal
  163.         '' to enable size checking, where Setup will compare the disk file size
  164.         '' with the INF file size and report an error if they are not the same.
  165.  
  166.         i% = SetSizeCheckMode(scmOnFatal)
  167.  
  168.         '' set up some (full) path names
  169.         CDMvbFullDir$ = MakePath(GetSymbolValue("STF_SRCDIR"), CDMvbDir$)
  170.         CDMvbFullName$ = CDMvbFullDir$ + "\" + MVBFileName$ + ".MVB"
  171.         CDDrive$ = MID$(CDMvbFullDir$, 1, 1)
  172.  
  173.         '' Set the title and banner bitmap. You must rebuild MSCUISTF.DLL to
  174.         '' alter the banner bitmap.
  175.  
  176.         SetTitle "Installatie Catalogus Computercollectief"
  177.         SetBitmap CUIDLL$, LOGO
  178.  
  179.         '' Read in the INF file.
  180.  
  181.         ReadInfFile MakePath(GetSymbolValue("STF_SRCDIR"), SetupFileName$)
  182.  
  183.         '' Decide where to put title files
  184.         IF PromptForPath% = 1 THEN
  185.                 szTitleDir$ = GetTitleDir(DefaultPath$)
  186.                 IF szTitleDir$ = "" THEN
  187.                         GOTO QUIT
  188.                 ENDIF
  189.         ELSE
  190.                 szTitleDir$ = GetWindowsDir()
  191.         ENDIF
  192.  
  193.         '' Copy files
  194.         IF CopyFiles(szTitleDir$) = 0 THEN
  195.                 GOTO QUIT
  196.         ENDIF
  197.  
  198.         '' Create the MVIEWER2.EXE MVB association
  199.         CreateIniKeyValue "WIN.INI", "Extensions", "MVB", "mviewer2.exe ^.mvb", cmoOverwrite
  200.  
  201.         '' Register in VIEWER.INI
  202.         ModifyViewerIni
  203.  
  204.         '' Register custom fonts
  205. ''      RegisterCustomFonts
  206.  
  207.         '' Register drivers
  208.         RegisterDrivers
  209.  
  210.         '' Modify Program Manager
  211.         ModifyProgramManager
  212.  
  213.         '' Success dialog
  214. ''      ShowSuccess(szTitleDir$)
  215.  
  216.         '' Now start the title
  217.  
  218.         CHDRIVE CDDrive$
  219.         CHDIR CDMvbFullDir$
  220.         RUN "mviewer2.exe " + MVBFileName$ + ".MVB", NOWAIT
  221.  
  222. QUIT:
  223.  
  224.         END
  225.  
  226.  
  227. '********************************************************************