home *** CD-ROM | disk | FTP | other *** search
/ Multimedia Classic / MultimediaClassic.mdf / app_main / talkto / talkto.ms_ / talkto.ms
Encoding:
Text File  |  1993-10-18  |  21.1 KB  |  697 lines

  1. '**************************************************************************
  2. '*   MSSetup Script for installing Talk->To, Talk->To Plus, and ExecuVoice
  3. '*
  4. '* History
  5. '*    14 Oct 92    sds    Initial version
  6. '*    21 Oct 1992    sds    added "Which Multimedia board?"
  7. '*    22 Oct 1992    sds    loading ProgMan group with applets
  8. '*    23 Oct 1992    sds    added WinFile, MPlayer to ProgMan grp
  9. '*    26 Oct 1992    sds    separate DRAGON.LOD's for Cherry vs Dragon2
  10. '*    30 Oct 1992    sds    ifdef'ed out query for board type - we
  11. '*                  will ship Multimedia version only
  12. '*    3 Dec 1992    sds    switch to Talk->To[Plus] product name
  13. '*                added Tutorial
  14. '*                no longer creates initial user
  15. '*                now asks for user and organization name
  16. '*    10 Dec 1992    sds    removed "Dragon Talk->To" from Tutorial name
  17. '*    15 Dec 1992    steves    added checks for overwrite of existing copy
  18. '*    24 Dec 1992    steves    support for saving username in talk-to.exe
  19. '*    19 Jan 1993    steves    no more lesson plan file for Tutorial
  20. '*    4 Feb 1993    steves    no install if setup disk write-protected
  21. '*    8 Feb 1993    steves    now checks for enough disk space
  22. '*    10 Feb 1993    steves  Now supports ExecuVrs build for Venus
  23. '*                Centralized version dependencies
  24. '*    10 Feb 1993    steves    Discoverred undocumented /D option on
  25. '*                _mstest cmd line.  No more editing this
  26. '*                file to generate different versions.
  27. '*    11 Feb 1993    steves    ExecuVoice now has ReadMe in WRITE file
  28. '*    16 Feb 1993    steves    ExecuVoice now does Pocket Mixer/CD icons
  29. '*                ReadMe.WRI now offered at end of setup
  30. '*    22 Feb 1993    steves    now supports "VoiceControl for Windows"
  31. '*    25 Feb 1993    steves    ProgMan icon now titled "Voicebar"
  32. '*    26 Feb 1993    steves    INI file [known tools] "Toolbar" entry now
  33. '*                  "Voicebar"
  34. '*    26 Feb 1993    steves    SrcDrive$ now extracted when needed.  DLL
  35. '*                  may set it at different times in different
  36. '*                  product versions
  37. '*    1 Mar 1993    steves    restored UserName/Org for VoiceType (TITAN)
  38. '*                VoiceType version has multiple base files
  39. '*    9 Mar 1993    steves    now creates [Program Aliases] in .INI file
  40. '*    19 Mar 1993    steves    TalkToPlus version now asks for base files
  41. '*    23 Mar 1993    steves    VoiceType no longer adds Terminal to group
  42. '*    24 Mar 1993    steves    ExecuVrs doesn't either
  43. '*    25 Mar 1993    steves    fixed bug backing up to User dlgbox
  44. '*    25 Mar 1993    steves    now sets board/mike in .INI file for support
  45. '*    12 May 1993    steves    ExecuVoice now gets dir from .INI for
  46. '*                    mixer and CD
  47. '*    25 May 1993    steves    AudioWave version (TalkTo with no choice
  48. '*                  of microphone)
  49. '*    7 Jun 1993    steves    Austin version (TalkTo with choice of mike
  50. '*                  but not board)
  51. '*    17 Jun 93    steves    AudioWave version now does no mike description
  52. '*    23 Jun 1993    sds    ExecuVoice for SoundBlaster (et all) version
  53. '*                  query for bases, no pocket mixer or CD
  54. '*    25 Jun 1993    sds    Austin version sets gain for IBM mike in
  55. '*                 MWAVE.INI
  56. '*    15 Jul 1993    sds    Crystal version - TalkTo with no mike or
  57. '*                 board choice
  58. '*    19 Jul 1993    sds    Austin is now TalkTo PLUS, and has two mikes
  59. '*                  with different MWAVE.INI gain settings
  60. '*    21 Sep 1993    sds    Crystal now asks for microphones
  61. '*    13 Oct 1993    sds    changed exe names for TTPlus (V1.4)
  62. '*    19 Oct 1993    sds    new HummingBird version, TTPLus with no
  63. '*                    base file selection
  64. '*
  65. '**************************************************************************
  66.  
  67. '* NOTE: There is only one "real" .MST file, TALKTO.MST.  Other versions
  68. '* are mere copies created by MAKE_IT.BAT
  69. '*
  70. '* The following DEFINE's are done on the command line in the various
  71. '* .LST files, each of which become SETUP.LST on the install disk
  72.  
  73. '* '$DEFINE TALKTOPLUS 1    ''Enable for Plus version
  74. '* '$DEFINE EXECUVOICE 1    ''Enable for ExecuVoice Version
  75. '* '$DEFINE EXVOICEALL 1    ''Enable for ExecuVoice Version (all boards)
  76. '* '$DEFINE VOICETYPE 1        ''Enable for VoiceType Version
  77. '* '$DEFINE AUDIOWAVE 1        ''Enable for AudioWave Version
  78. '* '$DEFINE AUSTIN 1        ''Enable for Austin Version
  79. '* '$DEFINE CRYSTAL 1        ''Enable for Crystal Version
  80. '* '$DEFINE HUMMINGBIRD 1    ''Enable for HummingBird Version
  81.  
  82. '* '$DEFINE MIC_DYNAMIC 1    ''For ExecuVoice only - default is Condenser
  83.  
  84.  
  85.  
  86. '* '$DEFINE DEBUG  ''Define for script development/debugging
  87.  
  88.  
  89.  
  90. '$INCLUDE 'setupapi.inc'
  91. '$INCLUDE 'msdetect.inc'
  92.  
  93. '$IFDEF EXVOICEALL
  94. '' ExecuVoice versions are mostly the same, except this one wants base
  95. '' file selection
  96. '$DEFINE EXECUVOICE 1
  97. '$DEFINE WANTBASES 1
  98. '$ENDIF
  99.  
  100. '$IFNDEF EXECUVOICE
  101. '$IFNDEF AUDIOWAVE
  102. '$IFNDEF HUMMINGBIRD
  103. '' everything except these versions wants base files
  104. '$DEFINE WANTBASES 1
  105. '$ENDIF
  106. '$ENDIF
  107. '$ENDIF
  108.  
  109.  
  110. '$IFNDEF EXECUVOICE
  111. DECLARE FUNCTION DlgGetUserOrg LIB "mscuistf.dll" AS INTEGER
  112. DECLARE FUNCTION DlgSetUserOrg LIB "mscuistf.dll" AS INTEGER
  113. '$ENDIF
  114.  
  115. '' TalkTo needs space for itself, plus enough more to create initial
  116. '' user.  About 3.5 MB
  117. '' NOTE: if this number is changed, you must also change string in
  118. '' DLGNOSPACE dialog box!!!!
  119. CONST MIN_DISK_SPACE = 3670016
  120.  
  121. ''Dialog ID's
  122. CONST DLG_WELCOME       = 100
  123. CONST DLG_ASKQUIT       = 200
  124. CONST DLG_DESTPATH      = 300
  125. CONST DLG_EXITFAILURE   = 400
  126. CONST DLG_EXITQUIT      = 600
  127. CONST DLG_EXITSUCCESS   = 700
  128.  
  129. CONST DLG_APPHELP       = 900
  130.  
  131. '' CONST DLG_MODELESS        = 5000
  132. CONST DLG_BADPATH       = 6400
  133. CONST DLG_USERNAME  = 7900
  134. CONST DLG_NOWAY = 8000
  135. CONST DLG_REPLACE = 8100
  136. CONST DLG_WRITEPROTECT = 8200
  137. CONST DLG_NOSPACE = 8300
  138. CONST DLG_BASENAME = 8400
  139.  
  140.  
  141. ''Bitmap ID
  142. CONST LOGO = 1
  143.  
  144. ''
  145. ''File Names and other version-dependent strings
  146. ''
  147. '$IFDEF VOICETYPE
  148. '$DEFINE TALKTOPLUS 1
  149. CONST STR_TITLE = "VoiceType Control For Windows"
  150. CONST FILE_INF = "VTCon.INF"
  151. CONST FILE_INI = "VTCon.INI"
  152. CONST FILE_TOOLBAR = "VTCon.exe"
  153. CONST FILE_TOOLBARCOMP = "VTCon.ex_"
  154. CONST FILE_ACTIVWRD = "VTWords.exe"
  155. CONST FILE_BROWSER = "VTBrowse.exe"
  156. CONST FILEPATH_TUTOR = "tutorial\vt-tutor.exe"
  157. CONST FILEPATH_INSTALL = "c:\VTCon"
  158.  
  159. '$ELSE
  160.  
  161. '$IFDEF EXECUVOICE
  162. CONST STR_TITLE = "ExecuVoice"
  163. CONST FILE_INF = "ExecuVrs.INF"
  164. CONST FILE_INI = "ExecuVrs.INI"
  165. CONST FILE_TOOLBAR = "ExecuVrs.exe"
  166. CONST FILE_TOOLBARCOMP = "ExecuVrs.ex_"
  167. CONST FILE_ACTIVWRD = "EvWords.exe"
  168. CONST FILEPATH_TUTOR = "tutorial\ev-tutor.exe"
  169. CONST FILEPATH_INSTALL = "c:\ExecuVrs"
  170.  
  171. '$ELSE
  172.  
  173. '$IFDEF AUSTIN
  174. '$DEFINE TALKTOPLUS 1
  175. CONST STR_TITLE = "Dragon Talk->To Plus"
  176. CONST FILE_INF = "TalkTo.INF"
  177. CONST FILE_INI = "T2Plus.INI"
  178. CONST FILE_TOOLBAR = "T2Plus.exe"
  179. CONST FILE_TOOLBARCOMP = "T2Plus.ex_"
  180. CONST FILE_ACTIVWRD = "TPWords.exe"
  181. CONST FILE_BROWSER = "TPBrowse.exe"
  182. CONST FILEPATH_TUTOR = "tutorial\TP-tutor.exe"
  183. CONST FILEPATH_INSTALL = "c:\talk-to"
  184. '$ELSE
  185.  
  186. '$IFDEF HUMMINGBIRD
  187. '$DEFINE TALKTOPLUS 1
  188. CONST STR_TITLE = "Dragon Talk->To Plus"
  189. CONST FILE_INF = "TalkTo.INF"
  190. CONST FILE_INI = "T2Plus.INI"
  191. CONST FILE_TOOLBAR = "T2Plus.exe"
  192. CONST FILE_TOOLBARCOMP = "T2Plus.ex_"
  193. CONST FILE_ACTIVWRD = "TPWords.exe"
  194. CONST FILE_BROWSER = "TPBrowse.exe"
  195. CONST FILEPATH_TUTOR = "tutorial\TP-tutor.exe"
  196. CONST FILEPATH_INSTALL = "c:\talk-to"
  197. '$ELSE
  198.  
  199. '$IFDEF TALKTOPLUS
  200. CONST STR_TITLE = "Dragon Talk->To Plus"
  201. '$IFNDEF VOICETYPE
  202. CONST FILE_BROWSER = "tpBrowse.exe"
  203. '$ENDIF
  204.  
  205. '$ELSE
  206. CONST STR_TITLE = "Dragon Talk->To"
  207. '$ENDIF
  208.  
  209. CONST FILE_INF = "TALKTO.INF"
  210. '$IFDEF TALKTOPLUS
  211. CONST FILE_INI = "T2Plus.INI"
  212. CONST FILE_ACTIVWRD = "tpwords.exe"
  213. CONST FILE_TOOLBAR = "T2Plus.exe"
  214. CONST FILE_TOOLBARCOMP = "T2Plus.ex_"
  215. CONST FILEPATH_TUTOR = "tutorial\tp-tutor.exe"
  216. '$ELSE
  217. CONST FILE_INI = "Talk-To.INI"
  218. CONST FILE_TOOLBAR = "Talk-To.exe"
  219. CONST FILE_TOOLBARCOMP = "Talk-To.ex_"
  220. CONST FILE_ACTIVWRD = "ttwords.exe"
  221. CONST FILEPATH_TUTOR = "tutorial\tt-tutor.exe"
  222. '$ENDIF
  223. CONST FILEPATH_INSTALL = "c:\talk-to"
  224. '$ENDIF
  225. '$ENDIF
  226. '$ENDIF
  227. '$ENDIF
  228.  
  229. GLOBAL DEST$        ''Default destination directory.
  230. GLOBAL OPTCUR$      ''Option selection from option dialog.
  231. GLOBAL USER$        ''Initial user name (file name form)
  232. '' GLOBAL FullUserName$
  233. GLOBAL UserName$
  234. GLOBAL SrcDrive$  '' where Setup is coming from
  235. GLOBAL OrgName$
  236. GLOBAL Title$
  237. GLOBAL SetupTitle$  '' used for msg boxes
  238. GLOBAL CUIDLL$
  239. GLOBAL ReInstall%
  240.  
  241. DECLARE SUB Install
  242. DECLARE FUNCTION MakePath (szFile$) AS STRING
  243.  
  244. INIT:
  245.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  246.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  247.  
  248.     DEST$ = FILEPATH_INSTALL        ''Default target directory
  249.  
  250.     SetBitmap CUIDLL$, LOGO
  251.     Title$ = STR_TITLE
  252.  
  253.     SetupTitle$ = Title$ + " Setup"
  254.  
  255.     SetTitle Title$
  256.  
  257.     '' assume this is not a re-install
  258.     ReInstall% = 0
  259.  
  260. '$IFNDEF EXECUVOICE
  261.     SetSymbolValue "UserName", ""
  262.     SetSymbolValue "UserOrg", ""
  263.  
  264.     '' DlgGetUserOrg isn't a dialog box routine at all, it's just named
  265.     '' that way to deter hackers.  It really extracts the user name and
  266.     '' organization from the magic file on first setup disk
  267.     i% = DlgGetUserOrg()
  268.     T$ = GetSymbolValue("BADUSERORGFILE")
  269.     if T$ = "Y" THEN
  270.     '' somebody mucked with user/organization file
  271.     GOTO ERRQUIT
  272.     END IF
  273.     UserName$ = GetSymbolValue("UserName")
  274.     cch% = len(UserName$)
  275.     if cch% > 0 then
  276.     '' re-install from same diskettes
  277.     ReInstall% = 1
  278.     end if
  279. '$ENDIF
  280.  
  281.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  282.     IF szInf$ = "" THEN
  283.         szInf$ = GetSymbolValue("STF_CWDDIR") + FILE_INF
  284.     END IF
  285.     ReadInfFile szInf$
  286.  
  287.     OPTCUR$ = "1"
  288.  
  289. '$IFDEF DEBUG
  290.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  291.     WinDrive$ = MID$(GetWindowsDir, 1, 1)
  292.     IF IsDriveValid(WinDrive$) = 0 THEN
  293.         i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  294.         GOTO QUIT
  295.     END IF
  296. '$ENDIF ''DEBUG
  297.  
  298.                 
  299. WELCOME:
  300.     sz$ = UIStartDlg(CUIDLL$, DLG_WELCOME, "FWelcomeDlgProc", DLG_APPHELP, HELPPROC$)
  301.     IF sz$ = "CONTINUE" THEN
  302.         UIPop 1
  303.     ELSE
  304.         GOSUB ASKQUIT
  305.         GOTO WELCOME
  306.     END IF
  307.  
  308. GETPATH:
  309.     SetSymbolValue "EditTextIn", DEST$
  310.     SetSymbolValue "EditFocus", "END"
  311. GETPATHL1:
  312.     sz$ = UIStartDlg(CUIDLL$, DLG_DESTPATH, "FEditDlgProc", DLG_APPHELP, HELPPROC$)
  313.     IF sz$ = "CONTINUE" THEN
  314.     DEST$ = GetSymbolValue("EditTextOut")
  315.         IF IsDirWritable(DEST$) = 0 THEN
  316.             GOSUB BADPATH
  317.             GOTO GETPATHL1
  318.         END IF
  319.         UIPop 1
  320.     ELSEIF sz$ = "REACTIVATE" THEN
  321.         GOTO GETPATHL1
  322.     ELSEIF sz$ = "BACK" THEN
  323.         UIPop 1
  324.         GOTO WELCOME
  325.     ELSE
  326.         GOSUB ASKQUIT
  327.         GOTO GETPATH
  328.     END IF
  329.  
  330. '' check directory
  331. CheckDir:
  332.     SrcDrive$ = GetSymbolValue("SRCDRIVE")
  333.  
  334.     i% = DoesDirExist(DEST$)
  335.     IF i% > 0 THEN
  336.     '' directory exists
  337.     i% = DoesFileExist(MakePath(FILE_TOOLBAR), femExists)
  338.     IF i% > 0 THEN
  339.         '' there is an existing version installed
  340.         Date_Already$ = GetDateOfFile(MAKEPATH(FILE_TOOLBAR))
  341.         IF Date_Already$ > "1990" THEN
  342.         '' have a file to compare to
  343.         Date_This$ = GetDateOfFile(SrcDrive$ + FILE_TOOLBARCOMP)
  344.         IF Date_This$ = Date_Already$ OR Date_This$ > Date_Already$ THEN
  345.             '' installing same or newer version - warn'em
  346.             sz$ = UIStartDlg(CUIDLL$, DLG_REPLACE, "FReplaceDlgProc", 0, "")
  347.             UIPop 1
  348.             IF sz$ = "CONTINUE" THEN
  349.             GOTO CheckSpace
  350.             ELSE
  351.             GOTO GetPath
  352.             END IF
  353.         ELSE
  354.             '' installing OLDER version over newer - no way
  355.             SetSymbolValue "EditTextIn", DEST$
  356.             SetSymbolValue "EditFocus", "END"
  357. CheckDir1:
  358.             sz$ = UIStartDlg(CUIDLL$, DLG_NOWAY, "FEditDlgProc", DLG_APPHELP, HELPPROC$)
  359.             IF sz$ = "CONTINUE" THEN
  360.             DEST$ = GetSymbolValue("EditTextOut")
  361.             IF IsDirWritable(DEST$) = 0 THEN
  362.                 GOSUB BADPATH
  363.                 GOTO CheckDir1
  364.             END IF
  365.             UIPop 1
  366.             GOTO CheckDir
  367.             ELSEIF sz$ = "REACTIVATE" THEN
  368.             GOTO CheckDir1
  369.             ELSEIF sz$ = "BACK" THEN
  370.             UIPop 1
  371.             GOTO GETPATH
  372.             ELSE
  373.             GOSUB ASKQUIT
  374.             GOTO CheckDir
  375.             END IF
  376.         END IF
  377.         END IF
  378.     END IF
  379.     END IF
  380.  
  381. CheckSpace:
  382.     if MID$(DEST$, 2, 1) = ":" then
  383.     DestDrive$ = MID$(DEST$, 1, 1)
  384.     else
  385.     DestDrive$ = GetSymbolValue("CURDRIVE")
  386.     end if
  387.     FreeSpace& = GetFreeSpaceForDrive(DestDrive$)
  388.  
  389.     if (FreeSpace& > MIN_DISK_SPACE) then
  390.     goto GETUSER
  391.     end if
  392.  
  393.     '' insufficient disk space - warn user
  394.     SetSymbolValue "FREESPACE", STR$(FreeSpace&)
  395.     sz$ = UIStartDlg(CUIDLL$, DLG_NOSPACE, "FNoSpaceDlgProc", DLG_APPHELP, HELPPROC$)
  396.     if sz$ = "CONTINUE" then
  397.     UIPop 1
  398.     '' see if they really freed enough space
  399.         goto CheckSpace
  400.     elseif sz$ = "BACK" then
  401.     UIPop 1
  402.     '' try another drive
  403.     goto GETPATH
  404.     else
  405.     UIPopAll
  406.         ERROR STFQUIT
  407.     end if
  408.  
  409. GETUSER:
  410. '$IFDEF EXECUVOICE
  411.     goto SkipGetUser    '* ExecuVoice does not record user name
  412. '$ELSE
  413.     if ReInstall% > 0 then
  414.     goto SkipGetUser
  415.     end if
  416.  
  417.     S$ = GetSymbolValue("UserName")
  418.     SetSymbolValue "EditTextIn", S$
  419.     S$ = GetSymbolValue("UserOrg")
  420.     SetSymbolValue "EditTextIn2", S$
  421.     SetSymbolValue "EditFocus", "END"
  422. GETUSER1:
  423.     sz$ = UIStartDlg(CUIDLL$, DLG_USERNAME, "FEditDlgProc", DLG_APPHELP, HELPPROC$)
  424.  
  425.     IF sz$ = "CONTINUE" THEN
  426.     '* dlgbox has already done the work
  427.         UIPop 1
  428.     ELSEIF sz$ = "REACTIVATE" THEN
  429.         GOTO GETUSER1
  430.     ELSEIF sz$ = "BACK" THEN
  431.         UIPop 1
  432.     GOTO GETPATH
  433.     ELSEIF sz$ = "WriteProtect" THEN
  434.     sz$ = UIStartDlg(CUIDLL$, DLG_WRITEPROTECT, "FQuitDlgProc", DLG_APPHELP, HELPPROC$)
  435.     UIPopAll
  436.         ERROR STFQUIT
  437.     ELSE
  438.         GOSUB ASKQUIT
  439.         GOTO GETUSER
  440.     END IF
  441. '$ENDIF
  442.  
  443. SkipGetUser:
  444.  
  445. '$IFDEF WANTBASES
  446. '* TalkTo, TalkToPlus, Austin, and VoiceType all use multiple base files
  447. '* ExecuVoice and Audiowave do not
  448. GETBASES:
  449.     SetSymbolValue "BASEGROUP", ""
  450. GETBASE1:
  451.     sz$ = UIStartDlg(CUIDLL$, DLG_BASENAME, "BaseDlgProc", DLG_APPHELP, HELPPROC$)
  452.  
  453.     IF sz$ = "CONTINUE" THEN
  454.         UIPop 1
  455.     ELSEIF sz$ = "REACTIVATE" THEN
  456.         GOTO GETBASE1
  457.     ELSEIF sz$ = "BACK" THEN
  458.         UIPop 1
  459.     if ReInstall% > 0 then
  460.         '' is re-install - we never asked for user
  461.         goto GETPATH
  462.     else
  463. '$IFDEF EXVOICEALL
  464.         goto GETPATH
  465. '$ELSE
  466.         GOTO GETUSER
  467. '$ENDIF
  468.     end if
  469.     ELSE
  470.         GOSUB ASKQUIT
  471.         GOTO GETBASES
  472.     END IF
  473. '$ENDIF
  474.  
  475.     Install
  476.  
  477. QUIT:
  478.     ON ERROR GOTO ERRQUIT
  479.  
  480.     IF ERR = 0 THEN
  481.         dlg% = DLG_EXITSUCCESS
  482.  
  483.     SetSymbolValue "InstallPath", DEST$
  484.     SetSymbolValue "ReadMeCmd", "Write " + MAKEPATH("readme.wri")
  485.  
  486.     ELSEIF ERR = STFQUIT THEN
  487.         dlg% = DLG_EXITQUIT
  488.     ELSE
  489.         dlg% = DLG_EXITFAILURE
  490.     END IF
  491. QUITL1:
  492.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  493.     IF sz$ = "REACTIVATE" THEN
  494.         GOTO QUITL1
  495.     END IF
  496.     UIPop 1
  497.  
  498.     END
  499.  
  500. ERRQUIT:
  501.     i% = DoMsgBox("Setup sources were corrupted, call technical support.", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  502.     END
  503.  
  504. BADPATH:
  505.     sz$ = UIStartDlg(CUIDLL$, DLG_BADPATH, "FInfo0DlgProc", 0, "")
  506.     IF sz$ = "REACTIVATE" THEN
  507.         GOTO BADPATH
  508.     END IF
  509.     UIPop 1
  510.     RETURN
  511.  
  512. ASKQUIT:
  513.     sz$ = UIStartDlg(CUIDLL$, DLG_ASKQUIT, "FQuitDlgProc", 0, "")
  514.  
  515.     IF sz$ = "EXIT" THEN
  516.         UIPopAll
  517.         ERROR STFQUIT
  518.     ELSEIF sz$ = "REACTIVATE" THEN
  519.         GOTO ASKQUIT
  520.     ELSE
  521.         UIPop 1
  522.     END IF
  523.     RETURN
  524.  
  525. '**
  526. '** Purpose:
  527. '**     Builds the copy list and performs all installation operations.
  528. '** Arguments:
  529. '**     none.
  530. '** Returns:
  531. '**     none.
  532. '*************************************************************************
  533. SUB Install STATIC
  534.  
  535.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  536.     CreateDir DEST$, cmoNone
  537.  
  538.     OpenLogFile MakePath("LOGFILE.OUT"), 0
  539.     WriteToLogFile ""
  540.     WriteToLogFile "  Destination directory: '" + DEST$ + "'"
  541.     WriteToLogFile ""
  542.  
  543.     AddSectionFilesToCopyList "Files", SrcDir$, DEST$
  544. '$IFDEF WANTBASES
  545.     BaseFiles$ = GetSymbolValue("BASEGROUP")
  546.  WriteToLogFile "  BaseGroup: '" + BaseFiles$ + "'"
  547.     AddSectionFilesToCopyList BaseFiles$, SrcDir$, DEST$
  548. '$ENDIF
  549.     CopyFilesInCopyList
  550.  WriteToLogFile "  Finished copying..."
  551.  
  552.     hPrev% = ShowWaitCursor()
  553.  
  554. '$IFNDEF EXECUVOICE
  555.     SetSymbolValue "KeyFileName", MakePath(FILE_TOOLBAR)
  556.     i% = DlgSetUserOrg()
  557. '$ENDIF
  558.  
  559.     ini$ = MakePath(FILE_INI)
  560.  
  561.     sec$ = "Defaults"
  562.     CreateIniKeyValue ini$, sec$, "User Directory", MakePath("users"), cmoOverwrite
  563.     CreateIniKeyValue ini$, sec$, "Vocabulary Directory", MakePath("users"), cmoOverwrite
  564.     CreateIniKeyValue ini$, sec$, "Base User", MakePath("users\baseusr.usr"), cmoOverwrite
  565.     CreateIniKeyValue ini$, sec$, "Base Vocabulary", MakePath("users\basevoc.voc"), cmoOverwrite
  566. '$IFDEF EXECUVOICE
  567. '$IFDEF EXVOICEALL
  568.     CreateIniKeyValue ini$, sec$, "Microphone Description", "Dynamic Microphone", cmoOverwrite
  569.     S$ = GetSymbolValue("SoundBoard")
  570.     cch% = len(S$)
  571.     if cch% > 0 then
  572.     CreateIniKeyValue ini$, sec$, "Sound Board Description", S$, cmoOverwrite
  573.     end if
  574. '$ELSE
  575. '$IFDEF MIC_DYNAMIC
  576.     CreateIniKeyValue ini$, sec$, "Microphone Description", "Dynamic Microphone", cmoOverwrite
  577. '$ELSE
  578.     CreateIniKeyValue ini$, sec$, "Microphone Description", "Condenser Microphone", cmoOverwrite
  579. '$ENDIF
  580. '$ENDIF
  581.  
  582. '$ELSE
  583.  
  584. '$IFDEF AUDIOWAVE
  585.     CreateIniKeyValue ini$, sec$, "Microphone Description", "", cmoOverwrite
  586. '$ELSE
  587. '$IFDEF AUSTIN
  588.     S$ = GetSymbolValue("Microphone")
  589.     cch% = len(S$)
  590.     if cch% > 0 then
  591.     CreateIniKeyValue ini$, sec$, "Microphone Description", S$, cmoOverwrite
  592.     end if
  593. '$ELSE
  594.     '' if Microphone or SoundBoard are set, record strings user saw at
  595.     '' Setup time in .INI file, so Support can tell what was installed
  596.     S$ = GetSymbolValue("Microphone")
  597.     cch% = len(S$)
  598.     if cch% > 0 then
  599.     CreateIniKeyValue ini$, sec$, "Microphone Description", S$, cmoOverwrite
  600.     end if
  601.  
  602.     S$ = GetSymbolValue("SoundBoard")
  603.     cch% = len(S$)
  604.     if cch% > 0 then
  605.     CreateIniKeyValue ini$, sec$, "Sound Board Description", S$, cmoOverwrite
  606.     end if
  607. '$ENDIF
  608. '$ENDIF
  609. '$ENDIF
  610.  
  611.     CreateIniKeyValue ini$, "Known Tools", "Voicebar", MakePath(FILE_TOOLBAR), cmoOverwrite
  612.     CreateIniKeyValue ini$, "Known Tools", "Active Words", MakePath(FILE_ACTIVWRD), cmoOverwrite
  613.     CreateIniKeyValue ini$, "Known Tools", "Tutorial", MakePath(FILEPATH_TUTOR), cmoOverwrite
  614. '$IFDEF TALKTOPLUS
  615.     CreateIniKeyValue ini$, "Known Tools", "Browser", MakePath(FILE_BROWSER), cmoOverwrite
  616. '$ENDIF
  617.  
  618.     CreateIniKeyValue ini$, "Program Aliases", "Hgw", "Hgw1,#1", cmoOverwrite
  619.     CreateIniKeyValue ini$, "Program Aliases", "Wpwin", "Wpwinfil,#1", cmoOverwrite
  620.     CreateIniKeyValue ini$, "Program Aliases", "Amipro", "Amiproui", cmoOverwrite
  621.     CreateIniKeyValue ini$, "Program Aliases", "123w", "L1wenv,#1", cmoOverwrite
  622.     UIPop 1
  623.  
  624. '$IFDEF AUSTIN
  625.     ini$ = GetWindowsSysDir()
  626.     ini$ = ini$ + "MWAVESND.INI"
  627.     if BaseFiles$ = "Ultimedia" then
  628.     '' set gain for IBM mike - leave others alone
  629.     CreateIniKeyValue ini$, "WAVEIN", "MIC GAINS", "105", cmoOverwrite
  630.     end if
  631. '$ENDIF
  632.  
  633.     CreateProgmanGroup Title$, "", cmoNone
  634.     ShowProgmanGroup  Title$, 1, cmoNone
  635.     CreateProgmanItem Title$, "Voicebar",MakePath(FILE_TOOLBAR), "", cmoOverwrite
  636. '$IFDEF TALKTOPLUS
  637.     CreateProgmanItem Title$, "Browser",MakePath(FILE_BROWSER), "", cmoOverwrite
  638. '$ENDIF
  639. '$IFDEF EXECUVOICE
  640. '$IFNDEF EXVOICEALL
  641.     S$ = GetSymbolValue("mvdirectory")
  642.  
  643.     CreateProgmanItem Title$, "Pocket Mixer",S$+"PMix.exe", "", cmoOverwrite
  644.     CreateProgmanItem Title$, "Pocket CD",S$+"pkcd.exe", "", cmoOverwrite
  645. '$ENDIF
  646. '$ENDIF
  647.  
  648.     '' Add desktop accessories we know about to VoiceControl group
  649.     '' Sorry to bury this deep in middle of the code - but MSSetup BASIC
  650.     '' seems not to support arrays of strings, which would be about the
  651.     '' only way to define this stuff up at the top and reference it here
  652.  
  653.     CreateProgmanItem Title$, "Program Manager", "ProgMan.exe", "", cmoOverwrite
  654.     CreateProgmanItem Title$, "File Manager", "WinFile.exe", "", cmoOverwrite
  655.     '' (These are in same order as Win3.1 Accessories group)
  656.     CreateProgmanItem Title$, "Write", "Write.exe", "", cmoOverwrite
  657. '$IFNDEF VOICETYPE
  658. '$IFNDEF EXECUVOICE
  659.     CreateProgmanItem Title$, "Terminal", "Terminal.exe", "", cmoOverwrite
  660. '$ENDIF
  661. '$ENDIF
  662.     CreateProgmanItem Title$, "Cardfile", "Cardfile.exe", "", cmoOverwrite
  663.     CreateProgmanItem Title$, "Calendar", "Calendar.exe", "", cmoOverwrite
  664.     CreateProgmanItem Title$, "Calculator", "Calc.exe", "", cmoOverwrite
  665.     CreateProgmanItem Title$, "Media Player", "MPlayer.exe", "", cmoOverwrite
  666.     CreateProgmanItem Title$, "Clock", "Clock.exe", "", cmoOverwrite
  667.     CreateProgmanItem Title$, "Notepad", "Notepad.exe", "", cmoOverwrite
  668.  
  669.     CloseLogFile
  670.     '* remove log when successful
  671.     RemoveFile MakePath("LOGFILE.OUT"), cmoNone
  672.     RestoreCursor hPrev%
  673.  
  674. END SUB
  675.  
  676. '**
  677. '** Purpose:
  678. '**     Appends a file name to the end of a directory path,
  679. '**     inserting a backslash character as needed.
  680. '** Arguments:
  681. '**     szDir$  - full directory path (with optional ending "\")
  682. '**     szFile$ - filename to append to directory
  683. '** Returns:
  684. '**     Resulting fully qualified path name.
  685. '*************************************************************************
  686. FUNCTION MakePath (szFile$) STATIC AS STRING
  687.     IF DEST$ = "" THEN
  688.         MakePath = szFile$
  689.     ELSEIF szFile$ = "" THEN
  690.         MakePath = szDir$
  691.     ELSEIF MID$(DEST$, LEN(DEST$), 1) = "\" THEN
  692.         MakePath = DEST$ + szFile$
  693.     ELSE
  694.         MakePath = DEST$ + "\" + szFile$
  695.     END IF
  696. END FUNCTION
  697.