home *** CD-ROM | disk | FTP | other *** search
/ Multimedia SongBook / SongBook.iso / setup.mst < prev    next >
Text File  |  1994-09-16  |  18KB  |  595 lines

  1. '**************************************************************************
  2. '*                       Presentation Partner CD-ROM Setup
  3. '*                       Started 5/3/94 Tim Swetonic
  4. '*                       originally adapted from the Music Mentor
  5. '*                       CD-ROM Edition Setup
  6. '*
  7. '*
  8. '* Changes:
  9. '* 1\10\93
  10. '* Bitmap fills screen for 800x600 and greater, title bar and border is on background bitmap,
  11. '* checks if directory is already present, checks for enough hard drive space.
  12. '*
  13. '**************************************************************************
  14.  
  15. '$DEFINE PRESPART
  16.  
  17. '$INCLUDE 'setupapi.inc'
  18. '$INCLUDE 'msdetect.inc'
  19.  
  20. DECLARE FUNCTION ShowWindow  LIB "user.exe" (hWnd%,iShow%) AS INTEGER
  21. DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%, offset%, style&) AS LONG
  22. DECLARE FUNCTION GetWindowLong LIB "user.exe" (hWnd%, offset%) AS LONG
  23. DECLARE FUNCTION WinExec LIB "krnl386.exe" (commandLine$, iShow%) AS INTEGER
  24. Declare Function FindWindow Lib "User" (lpClassName$, lpWindowName$) As Integer
  25. Declare Sub SetWindowPos Lib "User" (hWnd As Integer, hWndInsertAfter As Integer, X As Integer, Y As Integer, cx As Integer, cy As Integer, wFlags As Integer)
  26. Declare Function WritePrivateProfileString Lib "krnl386.exe" (lpApplicationName$, lpKeyName$, lpString$, lplFileName$) As Integer
  27. Declare Function SendMessage Lib "User" (hWnd As Long, wMsg As Integer, wParam As Integer, lParam As Any) As Long
  28. Declare Function AddFontResource Lib "GDI" (lpFilename As String) As Integer
  29.  
  30.  
  31.  
  32.  
  33.  
  34. ''Dialog ID's
  35.  
  36. CONST WELCOME        = 100
  37. CONST WELCOMEX       = 150
  38. CONST ASKQUIT        = 200
  39. CONST ASKQUITX       = 250
  40. CONST DESTPATH1       = 300
  41. CONST DESTPATH1X      = 350
  42. CONST DESTPATH2      = 6401
  43. CONST DESTPATH2X     = 6451
  44. CONST EXITFAILURE    = 400
  45. CONST EXITFAILUREX   = 450
  46. CONST EXITQUIT       = 600
  47. CONST EXITQUITX      = 650
  48. CONST EXITSUCCESS    = 700
  49. CONST EXITSUCCESSX   = 750
  50. CONST APPHELP        = 900
  51. CONST APPHELPX       = 950
  52. CONST ALREADYEXISTS  = 1000
  53. CONST ALREADYEXISTSX = 1050
  54. CONST TOOBIG         = 6300
  55. CONST TOOBIGX        = 6350
  56. CONST BADPATH        = 6400
  57. CONST BADPATHX       = 6450
  58. CONST INFO1          = 109
  59.  
  60. CONST INFO2          = 6455
  61. CONST INFO2X         = 6455
  62. CONST INSTALLVFW     = 108
  63.  
  64. 'CONST INFO3X         = 6457
  65. 'CONST INFO3          = 6458
  66.  
  67. CONST HDSPACE        = 4096000
  68.  
  69. CONST WS_VISIBLE = &H10000000
  70. CONST WS_CLIPCHILDREN = &H2000000
  71. CONST WS_BORDER = &H800000
  72. CONST SW_SHOWMAXIMIZED = 3
  73. CONST SW_SHOWNORMAL = 1
  74. CONST GWL_STYLE =-16
  75. CONST SWP_SHOWWINDOW = &H40
  76.  
  77. CONST HWND_BROADCAST = &HFFFF
  78. CONST WM_FONTCHANGE = &H1D
  79.  
  80. CONST TITLE = "Multimedia Songbook Setup"
  81.  
  82.  
  83. CONST LOGO1 = 1
  84. CONST LOGO2 = 1
  85.  
  86. 'GLOBAL SrcDir$
  87. GLOBAL DEST$        ''Default destination directory.
  88. GLOBAL SESDEST$     ''Default Session directory.
  89. GLOBAL RUNDEST$     ''Default Runtime subdirectory.
  90. GLOBAL OPTCUR$      ''Option selection from option dialog.
  91. GLOBAL SCRWID%
  92. GLOBAL PRESPARTDIR$
  93. GLOBAL CUIDLL$
  94. GLOBAL hdList$
  95. GLOBAL hwndBackground As Integer
  96.  
  97. DECLARE SUB Install
  98. DECLARE SUB CheckInstallVFW
  99. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  100. DECLARE SUB CreateProgGroup
  101. DECLARE SUB ShowBackground(hwnd%)
  102. INIT:
  103.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  104.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  105.  
  106.     aboutStr1$ = "Multimedia Songbook" + Chr$(13)
  107.     aboutStr1$ = aboutStr1$ + "Copyright (c) 1994" + Chr$(13)
  108.     aboutStr2$ = "Release version" + Chr$(13)
  109.     aboutStr2$ = aboutStr2$ + "August 28, 1994" + Chr$(13)
  110.  
  111.     mainWnd%=HwndFrame()
  112.     curLong& = GetWindowLong (mainWnd%, GWL_STYLE)                        'Creates window with
  113.     curLong& = curLong& OR (WS_BORDER OR WS_CLIPCHILDREN OR WS_CAPTION)   'title bar (Note: using
  114.     w&=SetWindowLong (mainWnd%, GWL_STYLE, curLong&)                      'HT video drivers icon
  115.                                                                           'on one screen is corrupt)
  116.  
  117.  
  118.     'Set text shown in the About dialog, selected from the system menu
  119.     SetAbout aboutStr1$, aboutStr2$
  120.     'w&=SetWindowLong(mainWnd%,GWL_STYLE,WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN)
  121.     j%=ShowWindow(mainWnd%,SW_SHOWMAXIMIZED)
  122.  
  123.     'GetLocalHardDrivesList hdList$
  124.     'listStr$ = GetListItem(hdList$, 1)
  125.  
  126.     SCRWID% = GetScreenWidth()
  127.         IF SCRWID% = 640 THEN
  128.             SetBitmap CUIDLL$, LOGO1
  129.         ELSE
  130.             SetBitmap CUIDLL$, LOGO2
  131.         END IF
  132.  
  133.     SetTitle TITLE
  134.  
  135.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  136.     IF szInf$ = "" THEN
  137.         szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  138.     END IF
  139.     ReadInfFile szInf$
  140.  
  141.     OPTCUR$ = "1"
  142.     DEST$ = "C:\SONGBOOK"
  143.     'SESDEST$ = "C:\SESSION"
  144.  
  145. WELCOME:
  146.     IF scrwid% = 640 THEN
  147.         sz$ = UIStartDlg(CUIDLL$, WELCOMEX, "FInfoDlgProc", APPHELP, HELPPROC$)
  148.         ShowBackground hwndBackground
  149.     ELSE
  150.         sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  151.         ShowBackground hwndBackground
  152.     END IF
  153.     ShowBackground hwndBackground
  154.     IF sz$ = "CONTINUE" THEN
  155.         UIPop 1
  156.     ELSE
  157.         GOSUB ASKQUIT
  158.         GOTO WELCOME
  159.     END IF
  160.  
  161.  
  162.  
  163. GETPATH:
  164.     SetSymbolValue "EditTextIn", DEST$
  165.     SetSymbolValue "EditFocus", "END"
  166. GETPATHL1:
  167.  
  168.     IF scrwid% = 640 THEN
  169.         sz$ = UIStartDlg(CUIDLL$, DESTPATH1X, "FEditDlgProc", APPHELP, HELPPROC$)
  170.     ELSE
  171.         sz$ = UIStartDlg(CUIDLL$, DESTPATH1, "FEditDlgProc", APPHELP, HELPPROC$)
  172.     END IF
  173.  
  174.  
  175.     DEST$ = GetSymbolValue("EditTextOut")
  176.  
  177.     IF sz$ = "CONTINUE" THEN
  178.         IF IsDirWritable(DEST$) = 0 THEN
  179.             GOSUB BADPATH
  180.             GOTO GETPATHL1
  181.         END IF
  182.         UIPop 1
  183.     ELSEIF sz$ = "REACTIVATE" THEN
  184.         GOTO GETPATHL1
  185.     ELSEIF sz$ = "BACK" THEN
  186.         UIPop 1
  187.         GOTO WELCOME
  188.     ELSE
  189.         GOSUB ASKQUIT
  190.         GOTO GETPATH
  191.     END IF
  192.  
  193.             'Check if directory exists
  194.     IF DoesDirExist(DEST$) THEN
  195.         UIPop 1
  196.  
  197.         IF SCRWID% = 640 THEN
  198.             sz$ = UIStartDlg(CUIDLL$, ALREADYEXISTSX, "FInfoDlgProc", 0, "")
  199.         ELSE
  200.             sz$ = UIStartDlg(CUIDLL$, ALREADYEXISTS, "FInfoDlgProc", 0, "")
  201.         END IF 'Screen resolution
  202.  
  203.         IF sz$ = "CONTINUE" THEN
  204.                 UIPop 1
  205.  
  206.         ELSEIF sz$ = "REACTIVATE" THEN
  207.             UIPop 1
  208.             GOTO GETPATHL1
  209.  
  210.         ELSEIF sz$ = "BACK" THEN
  211.             UIPop 1
  212.             GOTO GETPATHL1
  213.  
  214.         ELSE
  215.             UIPop 1
  216.             GOSUB ASKQUIT
  217.             GOTO GETPATH
  218.         END IF  'User responses for already exists dialog
  219.  
  220.     END IF  'If directory already exists
  221.  
  222.     checkdltr$ = mid$(DEST$, 1, 1)
  223.     checkdspc& = GetFreeSpaceForDrive(checkdltr$)
  224.     IF checkdspc& < HDSPACE THEN
  225.         IF scrwid% = 640 THEN
  226.             sz$ = UIStartDlg(CUIDLL$, TOOBIGX, "FInfoDlgProc", APPHELP, HELPPROC$)
  227.         ELSE
  228.             sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfoDlgProc", APPHELP, HELPPROC$)
  229.         END IF
  230.  
  231.  
  232.         ERROR STFQUIT
  233.         GOTO QUIT
  234.     END IF
  235.  
  236. '$IFNDEF PRESPART
  237. GETPATH2:
  238.     SetSymbolValue "EditTextIn", SESDEST$
  239.     SetSymbolValue "EditFocus", "END"
  240. GETPATHL2:
  241.  
  242.     IF scrwid% = 640 THEN
  243.         sz$ = UIStartDlg(CUIDLL$, DESTPATH2X, "FEditDlgProc", APPHELP, HELPPROC$)
  244.     ELSE
  245.         sz$ = UIStartDlg(CUIDLL$, DESTPATH2, "FEditDlgProc", APPHELP, HELPPROC$)
  246.     END IF
  247.  
  248.  
  249.     SESDEST$ = GetSymbolValue("EditTextOut")
  250.  
  251.     IF sz$ = "CONTINUE" THEN
  252.         IF IsDirWritable(SESDEST$) = 0 THEN
  253.             GOSUB BADPATH
  254.             GOTO GETPATHL2
  255.         END IF
  256.         UIPop 1
  257.     ELSEIF sz$ = "REACTIVATE" THEN
  258.         GOTO GETPATHL2
  259.     ELSEIF sz$ = "BACK" THEN
  260.         UIPop 1
  261.  
  262.         GOTO GETPATH
  263.     ELSE
  264.         GOSUB ASKQUIT
  265.         GOTO GETPATH2
  266.     END IF
  267.  
  268.               'Check if directory exists
  269.     IF DoesDirExist(SESDEST$) THEN
  270.         UIPop 1
  271.  
  272.         IF SCRWID% = 640 THEN
  273.             sz$ = UIStartDlg(CUIDLL$, ALREADYEXISTSX, "FInfoDlgProc", 0, "")
  274.         ELSE
  275.             sz$ = UIStartDlg(CUIDLL$, ALREADYEXISTS, "FInfoDlgProc", 0, "")
  276.         END IF 'Screen resolution
  277.  
  278.         IF sz$ = "CONTINUE" THEN
  279.             UIPop 1
  280.  
  281.         ELSEIF sz$ = "REACTIVATE" THEN
  282.             UIPop 1
  283.             GOTO GETPATHL2
  284.  
  285.         ELSEIF sz$ = "BACK" THEN
  286.             UIPop 1
  287.             GOTO GETPATHL2
  288.  
  289.         ELSE
  290.             UIPop 1
  291.             GOSUB ASKQUIT
  292.             GOTO GETPATH2
  293.         END IF  'User responses for already exists dialog
  294.  
  295.     END IF  'If directory already exists
  296. '$ENDIF MENTORCD
  297.  
  298.     Install
  299.  
  300.  
  301. QUIT:
  302.     ON ERROR GOTO ERRQUIT
  303.  
  304.     IF ERR = 0 THEN
  305.         IF SCRWID% = 640 THEN
  306.             dlg% = EXITSUCCESSX
  307.         ELSE
  308.             dlg% = EXITSUCCESS
  309.         END IF
  310.  
  311.  
  312.     ELSEIF ERR = STFQUIT THEN
  313.         IF SCRWID% = 640 THEN
  314.             dlg% = EXITQUITX
  315.         ELSE
  316.             dlg% = EXITQUIT
  317.         END IF
  318.     ELSE
  319.         'MsgBox "" + ERROR$(ERR)
  320.         IF SCRWID% = 640 THEN
  321.             dlg% = EXITFAILUREX
  322.         ELSE
  323.             dlg% = EXITFAILURE
  324.         END IF
  325.     END IF
  326. QUITL1:
  327.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfoDlgProc", 0, "")
  328.     IF sz$ = "REACTIVATE" THEN
  329.         GOTO QUITL1
  330.     ELSE
  331.         UIPop 1
  332.         CheckInstallVFW
  333.     END IF
  334.     UIPop 1
  335.  
  336.     END
  337.  
  338. ERRQUIT:
  339.     i% = DoMsgBox("Setup sources were corrupted, please call Midisoft Technical Support", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  340.     END
  341.  
  342.  
  343.  
  344. BADPATH:
  345.     IF scrwid% = 640 THEN
  346.         sz$ = UIStartDlg(CUIDLL$, BADPATHX, "FInfoDlgProc", APPHELP, HELPPROC$)
  347.     ELSE
  348.         sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfoDlgProc", APPHELP, HELPPROC$)
  349.     END IF
  350.  
  351.  
  352.     IF sz$ = "REACTIVATE" THEN
  353.         GOTO BADPATH
  354.     END IF
  355.     UIPop 1
  356.     RETURN
  357.  
  358.  
  359.  
  360. ASKQUIT:
  361.     IF scrwid% = 640 THEN
  362.         sz$ = UIStartDlg(CUIDLL$, ASKQUITX, "FQuitDlgProc", APPHELP, HELPPROC$)
  363.     ELSE
  364.         sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", APPHELP, HELPPROC$)
  365.     END IF
  366.  
  367.  
  368.  
  369.     IF sz$ = "EXIT" THEN
  370.         UIPop 5
  371.         ERROR STFQUIT
  372.     ELSEIF sz$ = "REACTIVATE" THEN
  373.         GOTO ASKQUIT
  374.     ELSE
  375.         UIPop 1
  376.     END IF
  377.     RETURN
  378.  
  379.  
  380.  
  381. '**
  382. '** Purpose:
  383. '**     Builds the copy list and performs all installation operations.
  384. '** Arguments:
  385. '**     none.
  386. '** Returns:
  387. '**     none.
  388. '*************************************************************************
  389. SUB Install STATIC
  390.  
  391.     'Source Directories
  392.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  393.     ROOTDIR$ = SrcDir$
  394.     MIDIDIR$ = MakePath (ROOTDIR$, "MIDI")
  395.     BMPDIR$ = MakePath (ROOTDIR$, "BITMAPS")
  396.     CONTROLSDIR$ = MakePath (ROOTDIR$, "CONTROLS")
  397.     FONTSDIR$ = MakePath(ROOTDIR$, "FONTS")
  398.  
  399.     CreateDir DEST$, cmoNone
  400.     winSysDir$ = GetWindowsSysDir()
  401.     winDir$ = GetWindowsDir()
  402.  
  403.     'check for font files
  404.    ' if EXISTS(winSysDir$ + "CGBSWFTE.FOT") then
  405.    ' else
  406.    '     AddSectionFilesToCopyList "F1", FONTSDIR$, winSysDir$
  407.    '     writeString% = WritePrivateProfileString("fonts", "Garamand Classic Bold (TrueType)","CGBSWFTE.FOT", "win.ini")
  408.    ' end if
  409.  
  410.     'if EXISTS(winSysDir$ + "CGRSWFTE.FOT") then
  411.    ' else
  412.    '     AddSectionFilesToCopyList "F2", FONTSDIR$, winSysDir$
  413.    '     writeString% = WritePrivateProfileString("fonts", "Garamand Classic Book (TrueType)","CGRSWFTE.FOT", "win.ini")
  414.    ' end if
  415.  
  416.     'if EXISTS(winSysDir$ + "FUASWFTE.FOT") then
  417.    ' else
  418.    '     AddSectionFilesToCopyList "F3", FONTSDIR$, winSysDir$
  419.    '     writeString% = WritePrivateProfileString("fonts", "Futuri (TrueType)","FUASWFTE.FOT", "win.ini")
  420.    ' end if
  421.  
  422.     'if EXISTS(winSysDir$ + "FUBSWFTE.FOT") then
  423.    ' else
  424.    '     AddSectionFilesToCopyList "F4", FONTSDIR$, winSysDir$
  425.    '     writeString% = WritePrivateProfileString("fonts", "Futuri Bold (TrueType)","FUBSWFTE.FOT", "win.ini")
  426.    ' end if
  427.  
  428.     'if EXISTS(winSysDir$ + "GAASWFTE.FOT") then
  429.    ' else
  430.    '     AddSectionFilesToCopyList "F5", FONTSDIR$, winSysDir$
  431.    '     writeString% = WritePrivateProfileString("fonts", "Garamand (TrueType)","GAASWFTE.FOT", "win.ini")
  432.    ' end if
  433.  
  434.     'if EXISTS(winSysDir$ + "GABSWFTE.FOT") then
  435.     'else
  436.     '    AddSectionFilesToCopyList "F6", FONTSDIR$, winSysDir$
  437.      '   writeString% = WritePrivateProfileString("fonts", "Garamand Bold (TrueType)","GABSWFTE.FOT", "win.ini")
  438.     'end if
  439.  
  440.     'if EXISTS(winSysDir$ + "GCASWFTE.FOT") then
  441.    ' else
  442.    '     AddSectionFilesToCopyList "F7", FONTSDIR$, winSysDir$
  443.    '     writeString% = WritePrivateProfileString("fonts", "Garamand Condensed (TrueType)","GCASWFTE.FOT", "win.ini")
  444.    ' end if
  445.  
  446.     'if EXISTS(winSysDir$ + "GCBSWFTE.FOT") then
  447.    ' else
  448.    '     AddSectionFilesToCopyList "F8", FONTSDIR$, winSysDir$
  449.    '     writeString% = WritePrivateProfileString("fonts", "Garamand Condensed Bold (TrueType)","GCBSWFTE.FOT", "win.ini")
  450.    ' end if
  451.  
  452.     if EXISTS(winSysDir$ + "CGBSWFTE.TTF") then
  453.     else
  454.         AddSectionFilesToCopyList "T1", FONTSDIR$, winSysDir$
  455.     end if
  456.  
  457.     if EXISTS(winSysDir$ + "CGRSWFTE.TTF") then
  458.     else
  459.         AddSectionFilesToCopyList "T2", FONTSDIR$, winSysDir$
  460.     end if
  461.  
  462.     'if EXISTS(winSysDir$ + "FUASWFTE.TTF") then
  463.    ' else
  464.    '     AddSectionFilesToCopyList "T3", FONTSDIR$, winSysDir$
  465.    ' end if
  466.  
  467.    ' if EXISTS(winSysDir$ + "FUBSWFTE.TTF") then
  468.    ' else
  469.    '     AddSectionFilesToCopyList "T4", FONTSDIR$, winSysDir$
  470.    ' end if
  471.  
  472.   if EXISTS(winSysDir$ + "GAASWFTE.TTF") then
  473.     else
  474.         AddSectionFilesToCopyList "T5", FONTSDIR$, winSysDir$
  475.     end if
  476.  
  477.     if EXISTS(winSysDir$ + "GABSWFTE.TTF") then
  478.     else
  479.         AddSectionFilesToCopyList "T6", FONTSDIR$, winSysDir$
  480.     end if
  481.  
  482.     if EXISTS(winSysDir$ + "GCASWFTE.TTF") then
  483.     else
  484.         AddSectionFilesToCopyList "T7", FONTSDIR$, winSysDir$
  485.     end if
  486.  
  487.     if EXISTS(winSysDir$ + "GCBSWFTE.TTF") then
  488.     else
  489.         AddSectionFilesToCopyList "T8", FONTSDIR$, winSysDir$
  490.     end if
  491.  
  492.     AddSectionFilesToCopyList "Controls", CONTROLSDIR$, winSysDir$
  493.     AddSectionFilesToCopyList "DLLs", CONTROLSDIR$, DEST$
  494.     'AddSectionFilesToCopyList "Windows", ROOTDIR$, winDir$
  495.     AddSectionFilesToCopyList "Songbook", ROOTDIR$, DEST$
  496.  
  497.     ClearBillboardList
  498.  
  499.     AddToBillboardList CUIDLL$, INFO1, "FModelessDlgProc", 50
  500.     AddToBillboardList CUIDLL$, INFO2, "FModelessDlgProc", 50
  501.  
  502.     CopyFilesInCopyList
  503.  
  504.     'ICONPATH$ = MakePath(SrcDir$,"MENTOR.ICO")
  505.     QUICKICONPATH$ = MakePath(SrcDir$,"QUIKTOUR.ICO")
  506.  
  507.     CreateProgmanGroup "Midisoft Multimedia Songbook", "", cmoNone
  508.     ShowProgmanGroup  "Midisoft Multimedia Songbook", 1, cmoNone
  509.     CreateProgmanItem "Midisoft Multimedia Songbook", "Midisoft Multimedia Songbook", DEST$ + "\SONGBOOK.EXE", "", cmoOverwrite
  510.     CreateProgmanItem "Midisoft Multimedia Songbook", "The Songbook Quick Tour", MakePath(SrcDir$,"QUIKTOUR.EXE"), "", cmoOverwrite
  511.  
  512.     'prog$ = "PROGRAM"
  513.    ' basePath$ = "BasePath"
  514.    ' winDir$ = winDir$ + "mentor2.ini"
  515.    ' writeString% = WritePrivateProfileString(prog$, basePath$, SrcDir$, winDir$)
  516.     ini$ = MakePath (GetWindowsDir, "songbk2.ini")
  517.     CreateIniKeyValue ini$, "PROGRAM", "BasePath", SrcDir$, cmoOverwrite
  518.     CreateIniKeyValue ini$, "PROGRAM","MapperLevel","", cmoOverwrite
  519.     CreateIniKeyValue ini$, "Noodler", "NoteMapping", "1", cmoOverwrite
  520.      CreateIniKeyValue ini$, "Noodler", "Loaded", "1", cmoOverwrite
  521.       CreateIniKeyValue ini$, "Video", "Sound", "1", cmoOverwrite
  522.  
  523.  
  524.     addFont = AddFontResource("CGBSWFTE.FOT")
  525.     addFont = AddFontResource("CGRSWFTE.FOT")
  526.     addFont = AddFontResource("GAASWFTE.FOT")
  527.     addFont = AddFontResource("GABSWFTE.FOT")
  528.     addFont = AddFontResource("GCASWFTE.FOT")
  529.     addFont = AddFontResource("GCBSWFTE.FOT")
  530.     addFont = AddFontResource("FUASWFTE.FOT")
  531.     addFont = AddFontResource("FUBSWFTE.FOT")
  532.  
  533.     fontChange = SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0)
  534.  
  535. END SUB
  536.  
  537. SUB CheckInstallVFW STATIC
  538.     sz$ = UIStartDlg(CUIDLL$, INSTALLVFW, "FInfoDlgProc", APPHELP, HELPPROC$)
  539.     if sz$ = "CONTINUE" then
  540.         UIPop 1
  541.         'run Video for Windows Setup
  542.         SrcDir$ = GetSymbolValue("STF_SRCDIR")
  543.         runLine$ = SrcDir$ + "_SETUP.EXE"
  544.         RUN runLine$, NOWAIT
  545.         'exec% = WinExec(runLine$, 1) 'SW_SHOWNORMAL
  546.         END
  547.     else
  548.         UIPop 1
  549.         END
  550.     end if
  551. END SUB
  552.  
  553.  
  554.  
  555. '**
  556. '** Purpose:
  557. '**     Appends a file name to the end of a directory path,
  558. '**     inserting a backslash character as needed.
  559. '** Arguments:
  560. '**     szDir$  - full directory path (with optional ending "\")
  561. '**     szFile$ - filename to append to directory
  562. '** Returns:
  563. '**     Resulting fully qualified path name.
  564. '*************************************************************************
  565. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  566.     IF szDir$ = "" THEN
  567.         MakePath = szFile$
  568.     ELSEIF szFile$ = "" THEN
  569.         MakePath = szDir$
  570.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  571.         MakePath = szDir$ + szFile$
  572.     ELSE
  573.         MakePath = szDir$ + "\" + szFile$
  574.     END IF
  575. END FUNCTION
  576.  
  577.  
  578. '************************************************************************
  579. '   CreateProgGroup
  580. '   This subroutine creates a program manager group if the user elects
  581. '   to run mentor from the cd-rom
  582. SUB CreateProgGroup STATIC
  583.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  584.     RUNDEST$ = MakePath(SrcDir$, "RUNTIME")
  585.     ICONPATH$ = MakePath(RUNDEST$,"MENTOR.ICO")
  586.     CreateIniKeyValue "Win.ini", "Extensions", "mtr", MakePath(DEST$,"TBOOK.EXE"), cmoOverwrite
  587.     CreateProgmanGroup "Music Mentor CD-ROM Edition", "", cmoNone
  588.     ShowProgmanGroup  "Music Mentor CD-ROM Edition", 1, cmoNone
  589.     CreateProgmanItem "Music Mentor CD-ROM Edition", "Music Mentor CD-ROM Edition", MakePath(RUNDEST$,"TBOOK.EXE") + " " + SrcDir$ + "MENTOR.MTR", ICONPATH$, cmoOverwrite
  590. END SUB
  591.  
  592. SUB ShowBackground (hwnd%) STATIC
  593.     SetWindowPos hwnd%, 1, 0, 0, 640, 480, SWP_SHOWWINDOW
  594. END SUB
  595.