home *** CD-ROM | disk | FTP | other *** search
/ Multimedia Classic / MultimediaClassic.mdf / app_main / audiosim / disk1 / setup2.ms_ / setup2.ms
Encoding:
Text File  |  1993-09-08  |  37.4 KB  |  1,150 lines

  1.  
  2. ''////////////////////////////////////// include files
  3.  
  4. '$INCLUDE 'setupapi.inc'
  5. '$INCLUDE 'msdetect.inc'
  6.  
  7. ''////////////////////////////////////// WINAPI declarations
  8.  
  9. Declare Function ExitWindows% Lib "User" (dwReserved&, wReturnCode%)
  10. Declare Function WinHelp Lib "User" (hWnd%, lpHelpFile$, wCommand%, dwData) As Integer
  11. DECLARE FUNCTION ShowWindow  LIB "user.exe" (hWnd%,iShow%) AS INTEGER 
  12. DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%, offset%, style&) AS LONG
  13. DECLARE FUNCTION WinExec LIB "Kernel" (lpCmdLine$, nCmdShow%) AS INTEGER
  14. Declare Function MessageBox Lib "User" (hWnd%, lpText$, lpCaption$,wType%) As Integer
  15. Declare Function GetFreeSpace Lib "Kernel" (wFlags%) As Long
  16. Declare Function GetTempFileName Lib "Kernel" (cDriveLetter%, lpPrefixString$, wUnique%, lpTempFileName$) As Integer
  17. Declare Function FindWindow Lib "User" (lpClassName$, lpWindowNam$) As Integer
  18.  
  19. ''////////////////////////////////////// WINAPI constants
  20.     
  21. Const WS_VISIBLE = &H10000000
  22. Const WS_CLIPCHILDREN = &H2000000
  23. Const WS_BORDER = &H800000
  24. Const SW_SHOWMAXIMIZED = 3
  25. CONST GWL_STYLE =-16  
  26. Const MB_ICONQUESTION = &H20
  27. Const MB_ICONEXCLAMATION = &H30
  28. Const MB_ICONASTERISK = &H40
  29. Const MB_ICONINFORMATION = MB_ICONASTERISK
  30. Const MB_OKCANCEL = &H1
  31. Const MB_ABORTRETRYIGNORE = &H2
  32. Const MB_YESNOCANCEL = &H3
  33. Const MB_YESNO = &H4
  34. Const MB_RETRYCANCEL = &H5
  35. Const IDOK = 1
  36. Const IDYES = 6
  37. Const IDNO = 7
  38. Const HELP_CONTEXT = &H1
  39. Const HELP_QUIT = &H2
  40.  
  41. ''////////////////////////////////// check if Sound Impression is currently running
  42.  
  43. findclass1$ = "EDITPARENT"
  44. findclass2$ = "AUDRKPARENT"
  45. findtitle$ = "Sound Impression"
  46. lookforsi1% = FindWindow (findclass1$,findtitle$) 
  47. lookforsimin% = FindWindow (findclass2$,NULL) 
  48.     If lookforsi1% <> 0 or lookforsimin% <> 0 then 
  49.         runningstop% = MessageBox(hwnd%, "Sound Impression is running.  Close it, then run Setup again.","Sound Impression Setup", MB_OK+MB_TASKMODAL+MB_ICONSTOP)
  50.         if IDOK then
  51.             STOP
  52.         end if
  53.     end if
  54.     
  55. ''////////////////////////////////// script subroutines
  56.  
  57. DECLARE SUB Install
  58. DECLARE SUB REMOVESI
  59. DECLARE SUB FINIS 
  60. ON END FINIS 
  61.  
  62. ''///////////////////////////////// script function declarations
  63.  
  64. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING 
  65.  
  66. ''//////////////////////////////////////////CUI Dialog IDs
  67.  
  68. CONST CPMESSAGE      = 9999
  69. CONST CPANNOUNCE     = 5005
  70. CONST DRVCHOICE      = 5099
  71. CONST PICKTASKX      = 6000
  72. CONST STATUSREPORTX  = 6010
  73. CONST DESTPATHX      = 6020
  74. CONST SIPATHX        = 6025
  75. CONST CARDLISTX      = 6030
  76. CONST CARDLISTXLNG   = 6040
  77. CONST BADPATHX       = 6050
  78. CONST ASKQUITX       = 6060
  79. CONST EXITFAILUREX   = 6070  
  80. CONST EXITQUITX      = 6080
  81. CONST EXITSUCCESSX   = 6090
  82. CONST APPHELPX       = 7000
  83. CONST CPANNOUNCEX    = 7007
  84. CONST DRVCHOICEX     = 7099
  85. CONST PICKTASK       = 8000
  86. CONST STATUSREPORT   = 8010
  87. CONST DESTPATH       = 8020
  88. CONST SIPATH         = 8025
  89. CONST CARDLIST       = 8030
  90. CONST CARDLISTLNG    = 8040
  91. CONST BADPATH        = 8050
  92. CONST ASKQUIT        = 8060
  93. CONST EXITFAILURE    = 8070  
  94. CONST EXITQUIT       = 8080
  95. CONST EXITSUCCESS    = 8090
  96. CONST APPHELP        = 9000
  97.  
  98. ''///////////////////////////////// script globals
  99.  
  100. GLOBAL CHECKAGAIN%
  101. GLOBAL DEST$ 
  102. GLOBAL CARD$
  103. GLOBAL CARDLOADLIST$
  104. GLOBAL CARDPICK$
  105. GLOBAL SELECTED$
  106. GLOBAL szInf$
  107. GLOBAL progshell$
  108. GLOBAL STATS$
  109. GLOBAL STATUSITEMS$
  110. GLOBAL STATUSITEMSPICK$
  111. GLOBAL STATPICK$
  112. GLOBAL WINDIRECT$
  113. GLOBAL winsysdir$
  114. GLOBAL winsysini$
  115. GLOBAL INI$
  116. GLOBAL OPTCUR$
  117. GLOBAL PATHNOW$
  118. GLOBAL REMIMPRESSION$
  119. GLOBAL SCRWID%
  120. GLOBAL DELETEFLAG$
  121. GLOBAL SETUPOK$
  122. GLOBAL WORKSTRING$
  123. GLOBAL VIRTSTRING$
  124. GLOBAL PERMSWAP$
  125. GLOBAL TEMPSWAP$
  126. GLOBAL MCIDRIVERS$
  127. GLOBAL CARDDRIVERS$
  128. GLOBAL findarial$
  129. GLOBAL totop$
  130. GLOBAL WAVEOFF$
  131. GLOBAL MIDIOFF$
  132. GLOBAL CDOFF$
  133. GLOBAL CDD$
  134. GLOBAL CDDRIVER$
  135. GLOBAL MCISECT$
  136. GLOBAL MCICD$
  137. GLOBAL MCISEQ$
  138. GLOBAL SEQ$
  139. GLOBAL DRIVETIMER$
  140. GLOBAL TIM$
  141. GLOBAL WAVEDRV$
  142. GLOBAL WAVEDRV1$
  143. GLOBAL WAVEDRV2$
  144. GLOBAL WAVEDRV3$
  145. GLOBAL WAVEDRV4$
  146. GLOBAL WAVEDRV5$
  147. GLOBAL WAVEDRV6$
  148. GLOBAL WAVEDRV7$
  149. GLOBAL WAVEDRV8$
  150. GLOBAL WAVEDRV9$
  151. GLOBAL WAV$
  152. GLOBAL MIDIDRV$
  153. GLOBAL MIDIDRV1$
  154. GLOBAL MIDIDRV2$
  155. GLOBAL MIDIDRV3$
  156. GLOBAL MIDIDRV4$
  157. GLOBAL MIDIDRV5$
  158. GLOBAL MIDIDRV6$
  159. GLOBAL MIDIDRV7$
  160. GLOBAL MIDIDRV8$
  161. GLOBAL MIDIDRV9$
  162. GLOBAL NOPERMSWAP$
  163. GLOBAL TRUTYPKEY$
  164. GLOBAL ARIALKEY$
  165.  
  166. ''////////////////////////////////////// Start 
  167. INIT:
  168. ''////////////////////////////////////// read info file, do backdrop, set main variables
  169.  
  170. HELPPROC$ = "FHelpDlgProc"
  171. WINDIRECT$ = GetWindowsDir()
  172. winsysdir$ = GetWindowsSysDir()
  173. winsysini$ = FindFileInTree("SYSTEM.INI",WINDIRECT$)
  174.  
  175. CUIDLL$ = "cui_oem.dll"                                   ''<<<<<<<<<<<< contains oem-specific logo
  176.  
  177. CONST LOGO1 = 1
  178. CONST LOGO2 = 2
  179.  
  180. mainWnd%=HwndFrame() 
  181. w&=SetWindowLong(mainWnd%,GWL_STYLE,WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN) 
  182. j%=ShowWindow(mainWnd%,SW_SHOWMAXIMIZED)
  183.  
  184. SCRWID% = GetScreenWidth()
  185.     If SCRWID% = 640 then
  186.     SetBitmap CUIDLL$, LOGO1
  187.     else
  188.     SetBitmap CUIDLL$, LOGO2
  189.     end if
  190. szInf$ = GetSymbolValue("STF_SRCINFPATH")
  191. IF szInf$ = "" THEN
  192.    szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP2.INF" ''<<<<<<<<<<<< info file name (can change)
  193. END IF
  194. ReadInfFile szInf$
  195.  
  196. ''/////////////////////// establish Setup Help window position in win.ini
  197.  
  198. helporig7$ = GetIniKeyString("win.ini","Windows Help","M_WindowPosition")
  199.  
  200. If SCRWID% = 640 then
  201.     CreateIniKeyValue "win.ini", "Windows Help", "M_WindowPosition", "[33,262,584,211,0]" , cmoOverwrite
  202. else
  203.     CreateIniKeyValue "win.ini", "Windows Help", "M_WindowPosition", "[100,358,584,211,0]" , cmoOverwrite
  204. end if
  205.  
  206. ''/////////////////////// set more local variables, do system analysis
  207.  
  208. findarial$ = FindFileInTree("ARIAL.FOT",WINDIRECT$)
  209. progini$ = FindFileInTree("PROGMAN.INI",WINDIRECT$)
  210. progshell$ = GetIniKeyString(winsysini$,"boot","shell")
  211.  
  212. MCISECT$ = lcase$("mci")
  213. MCICD$ = lcase$(rtrim$(ltrim$("cdaudio")))
  214. MCISEQ$ = lcase$(rtrim$(ltrim$("sequencer")))
  215. DRVSECT$ = lcase$("drivers")
  216. DRIVETIMER$ = lcase$(rtrim$(ltrim$("timer")))
  217.  
  218. MIDIDRV$ = lcase$(rtrim$(ltrim$("midi")))
  219. MIDIDRV1$ = lcase$(rtrim$(ltrim$("midi1")))
  220. MIDIDRV2$ = lcase$(rtrim$(ltrim$("midi2")))
  221. MIDIDRV3$ = lcase$(rtrim$(ltrim$("midi3")))
  222. MIDIDRV4$ = lcase$(rtrim$(ltrim$("midi4")))
  223. MIDIDRV5$ = lcase$(rtrim$(ltrim$("midi5")))
  224. MIDIDRV6$ = lcase$(rtrim$(ltrim$("midi6")))
  225. MIDIDRV7$ = lcase$(rtrim$(ltrim$("midi7")))
  226. MIDIDRV8$ = lcase$(rtrim$(ltrim$("midi8")))
  227. MIDIDRV9$ = lcase$(rtrim$(ltrim$("midi9")))
  228.  
  229. m0% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV$)
  230. m1% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV1$)
  231. m2% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV2$)
  232. m3% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV3$)
  233. m4% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV4$)
  234. m5% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV5$)
  235. m6% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV6$)
  236. m7% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV7$)
  237. m8% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV8$)
  238. m9% = DoesIniKeyExist(winsysini$,DRVSECT$,MIDIDRV9$)
  239.  
  240. If m0% <> 0 then
  241. goto nextset
  242. elseif m1% <> 0 then
  243. goto nextset
  244. elseif m2% <> 0 then
  245. goto nextset
  246. elseif m3% <> 0 then
  247. goto nextset
  248. elseif m4% <> 0 then
  249. goto nextset
  250. elseif m5% <> 0 then
  251. goto nextset
  252. elseif m6% <> 0 then
  253. goto nextset
  254. elseif m7% <> 0 then
  255. goto nextset
  256. elseif m8% <> 0 then
  257. goto nextset
  258. elseif m9% <> 0 then
  259. goto nextset
  260. else
  261. SEQ$ = "no"
  262. end if
  263.  
  264. nextset:
  265.  
  266. WAVEDRV$ = lcase$(rtrim$(ltrim$("wave")))
  267. WAVEDRV1$ = lcase$(rtrim$(ltrim$("wave1")))
  268. WAVEDRV2$ = lcase$(rtrim$(ltrim$("wave2")))
  269. WAVEDRV3$ = lcase$(rtrim$(ltrim$("wave3")))
  270. WAVEDRV4$ = lcase$(rtrim$(ltrim$("wave4")))
  271. WAVEDRV5$ = lcase$(rtrim$(ltrim$("wave5")))
  272. WAVEDRV6$ = lcase$(rtrim$(ltrim$("wave6")))
  273. WAVEDRV7$ = lcase$(rtrim$(ltrim$("wave7")))
  274. WAVEDRV8$ = lcase$(rtrim$(ltrim$("wave8")))
  275. WAVEDRV9$ = lcase$(rtrim$(ltrim$("wave9")))
  276.  
  277. w0% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV$)
  278. w1% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV1$)
  279. w2% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV2$)
  280. w3% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV3$)
  281. w4% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV4$)
  282. w5% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV5$)
  283. w6% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV6$)
  284. w7% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV7$)
  285. w8% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV8$)
  286. w9% = DoesIniKeyExist(winsysini$,DRVSECT$,WAVEDRV9$)
  287.  
  288. If w0% <> 0 then
  289. goto nextset2
  290. elseif w1% <> 0 then
  291. goto nextset2
  292. elseif w2% <> 0 then
  293. goto nextset2
  294. elseif w3% <> 0 then
  295. goto nextset2
  296. elseif w4% <> 0 then
  297. goto nextset2
  298. elseif w5% <> 0 then
  299. goto nextset2
  300. elseif w6% <> 0 then
  301. goto nextset2
  302. elseif w7% <> 0 then
  303. goto nextset2
  304. elseif w8% <> 0 then
  305. goto nextset2
  306. elseif w9% <> 0 then
  307. goto nextset2
  308. else
  309. WAV$ = "no"
  310. end if
  311.  
  312. nextset2:
  313.  
  314. timesys% = DoesIniKeyExist(winsysini$,DRVSECT$,DRIVETIMER$)
  315. if timesys% = 0 then
  316. TIM$ = "no"
  317. end if
  318.  
  319. cdsys% = DoesIniKeyExist(winsysini$,MCISECT$,MCICD$)
  320. if cdsys% = 0 then
  321. CDD$ = "no"
  322. end if
  323.  
  324. seqsys% = DoesIniKeyExist(winsysini$,MCISECT$,MCISEQ$)
  325. if seqsys% = 0 then
  326. SEQ$ = "no"
  327. end if
  328.  
  329. szTemp$ = String$(144, 0)
  330. tempresult% = GetTempFileName(0, "tst", 0, szTemp$)
  331. workdir$ = Mid$(szTemp$,1,1)
  332. RemoveFile szTemp$,cmoForce
  333. wfree& = GetFreeSpaceForDrive(workdir$)
  334. wfreesz$ = str$(wfree&/10000)
  335. wfreedec$ = mid$(wfreesz$,len(wfreesz$)-1,2)
  336. wfreepredec$ = mid$(wfreesz$,1,len(wfreesz$)-2)
  337. If val(wfreepredec$) < 16 then
  338. WORKSTRING$ = "**** Free space on Windows drive " + "(" + workdir$ + "): " + wfreepredec$ + "." + wfreedec$ + " MB"
  339. else
  340. WORKSTRING$ = "OK. Free space on Windows drive " + "(" + workdir$ + "): " + wfreepredec$ + "." + wfreedec$ + " MB"
  341. end if
  342.  
  343. vmem& = GetFreeSpace(0)
  344. vmemsz$ = str$(vmem&/10000)
  345. vmemdec$ = mid$(vmemsz$,len(vmemsz$)-1,2)
  346. vmempredec$ = mid$(vmemsz$,1,len(vmemsz$)-2)
  347. If val(vmempredec$) < 16 then
  348. VIRTSTRING$ = "**** Virtual memory (current): " + vmempredec$ + "." + vmemdec$ + " MB"
  349. else
  350. VIRTSTRING$ = "OK. Virtual memory (current): " + vmempredec$ + "." + vmemdec$ + " MB"
  351. end if
  352.  
  353. wpermswapd$=GetIniKeyString(winsysini$,"386Enh","PermSwapDOSDrive")  
  354. wtempswapd$=GetIniKeyString(winsysini$,"386Enh","PagingFile")
  355. wpermswap$=GetIniKeyString(winsysini$,"386Enh","PermSwapSizeK")
  356. wtempswap$=GetIniKeyString(winsysini$,"386Enh","MaxPagingFileSize")
  357.  
  358. If len(wpermswap$) > 3 then
  359. wpermswapsz$ = mid$(wpermswap$,1,len(rtrim$(ltrim$(wpermswap$)))-1)
  360. wpermswapkb$ = mid$(wpermswapsz$,len(wpermswapsz$)-2,2)
  361. wpermswapmb$ = mid$(wpermswapsz$,1,len(wpermswapsz$)-2)
  362. if val(wpermswapmb$) < 16 then
  363. PERMSWAP$ = "**** Permanent Swap File (drive " + wpermswapd$ + "): " + wpermswapmb$ + "." + wpermswapkb$ + " MB"
  364. else
  365. PERMSWAP$ = "OK. Permanent Swap File (drive " + wpermswapd$ + "): " + wpermswapmb$ + "." + wpermswapkb$ + " MB"
  366. end if
  367. end if
  368.  
  369. if wpermswapd$ = "" then
  370. NOPERMSWAP$ = "**** Permanent Swap File not found"
  371. end if
  372.  
  373. If len(wtempswap$) > 3 then
  374. wtempswapsz$ = mid$(wtempswap$,1,len(rtrim$(ltrim$(wtempswap$)))-1)
  375. wtempswapkb$ = mid$(wtempswapsz$,len(wtempswapsz$)-2,2)
  376. wtempswapmb$ = mid$(wtempswapsz$,1,len(wtempswapsz$)-2)
  377. TEMPSWAP$ = "**** Temp Swap File (" + wtempswapd$ + "): " + wtempswapmb$ + "." + wtempswapkb$ + " MB"
  378. end if
  379.  
  380. wbitcheck$=GetIniKeyString(winsysini$,"386Enh","32BitDiskAccess")
  381. If lcase$(ltrim$(rtrim$(wbitcheck$))) <> "on" then
  382. WBITRPT$ = "**** 32-bit Disk Access is OFF"
  383. else
  384. WBITRPT$ = ""
  385. end if
  386.  
  387. dosver1% = GetDosMajorVersion()
  388. dosver2% = GetDosMinorVersion()
  389. dosresult1$ = ltrim$(rtrim$(str$(dosver1%))) 
  390. dosresult2$ = ltrim$(rtrim$(str$(dosver2%)))
  391. dosresult$ = dosresult1$ + "." + dosresult2$
  392. If val(dosresult1$) < 5 then
  393. DOSVERRPT$ =  "*** DOS version: " + dosresult$
  394. else
  395. DOSVERRPT$ =  ""
  396. end if
  397.  
  398. winver1% = GetWindowsMajorVersion()
  399. winver2% = GetWindowsMinorVersion()
  400. winresult1$ = ltrim$(rtrim$(str$(winver1%))) 
  401. winresult2$ = ltrim$(rtrim$(str$(winver2%)))
  402. winresult$ = winresult1$ + "." + winresult2$
  403. If val(winresult1$) < 3 and val(winresult2$) < 10 then
  404. WINVERRPT$ =  "**** Windows version: " + winresult$
  405. else
  406. WINVERRPT$ =  ""
  407. end if
  408.  
  409. mouse1% = HasMouseInstalled()
  410. If mouse1% <> 1 then
  411. MOUSERPT$ = "**** Mouse is NOT installed"
  412. else
  413. MOUSERPT$ = ""
  414. end if
  415.  
  416. wmode% = GetWindowsMode()
  417. If wmode% = 2 then
  418. WMODERPT$ = ""
  419. elseif wmode% = 1 then
  420. WMODERPT$ = "**** Windows mode: standard"
  421. elseif wmode% = 0 then
  422. WMODERPT$ = "**** Windows mode: Real"
  423. end if
  424.  
  425. wproctype% = GetProcessorType()
  426. If wproctype% = 4 then
  427. wproctyprpt$ = "OK. Processor type: 80486"
  428. elseif wproctype% = 3 then
  429. wproctyprpt$ = "**** Processor type: 80386"
  430. elseif wproctype% = 2 then
  431. wproctyprpt$ = "**** Processor type: 80286"
  432. elseif wproctype% = 1 then
  433. wproctyprpt$ = "**** Processor type: 80186"
  434. elseif wproctype% = 0 then
  435. wproctyprpt$ = "**** Processor type: 8086"
  436. else
  437. wproctyprpt$ = "**** Processor type: Undetermined"
  438. end if
  439.  
  440. wttfkeycheck% = DoesIniSectionExist("win.ini","TrueType")
  441. If wttfkeycheck% = 0 then
  442. TRUTYPKEY$ = "**** TrueType enabling switch not present"
  443. else
  444. TRUTYPKEY$ = ""
  445. end if
  446.  
  447. if wttfkeycheck% <> 0 then
  448. wttfcheck$=GetIniKeyString("win.ini","TrueType","TTEnable")
  449. If ltrim$(rtrim$(wttfcheck$)) <> "1" then
  450. TRUTYPRPT$ = "**** TrueType is not enabled"
  451. else
  452. TRUTYPRPT$ = ""
  453. end if
  454. end if
  455.  
  456. If findarial$ = "" then
  457. ARIALRPT$ = "**** Arial TrueType font not found"
  458. else
  459. ARIALRPT$ = ""
  460. end if
  461.  
  462. If findarial$ <> "" then
  463. arialkey1% = DoesIniKeyExist("win.ini","fonts","Arial (TrueType)")
  464. arialkey2% = DoesIniKeyExist("win.ini","fonts","Arial(TrueType)")
  465. arialkey3% = DoesIniKeyExist("win.ini","fonts","Arial")
  466. if arialkey1% = 0 and arialkey2% = 0 and arialkey3% = 0 then
  467. ARIALKEY$ = "**** Arial is not on your fonts list"
  468. else
  469. ARIALKEY$ = ""
  470. end if
  471. end if
  472.  
  473. ''/////////////////////////////////////////// opening dialog (3 radio buttons)
  474.  
  475. GETPURPOSE:
  476.     SetSymbolValue "RadioDefault", OPTCUR$
  477. OPTL1:
  478. if scrwid% = 640 then   
  479.     sz$ = UIStartDlg(CUIDLL$, PICKTASKX, "FRadioDlgProc", 0, "")
  480. else
  481.     sz$ = UIStartDlg(CUIDLL$, PICKTASK, "FRadioDlgProc", 0, "")
  482. end if
  483.     OPTCUR$ = GetSymbolValue("ButtonChecked")
  484.  
  485.     IF sz$ = "CONTINUE" THEN
  486.         UIPop 1
  487.     ELSEIF sz$ = "REACTIVATE" THEN
  488.         GOTO OPTL1
  489.     ELSE
  490.         GOSUB ASKQUIT
  491.         GOTO GETPURPOSE
  492.     END IF
  493.  
  494. If OPTCUR$ = "2" then
  495.         PATHNOW$ = GetIniKeyString(MakePath(WINDIRECT$ , "audio.ini"),"SetupInfo","SetupPath")
  496.         GOTO CURPATH
  497. end if
  498. If OPTCUR$ = "3" then
  499.         PATHNOW$ = GetIniKeyString(MakePath(WINDIRECT$ , "audio.ini"),"SetupInfo","SetupPath")
  500.         REMIMPRESSION = "yes"
  501.         GOTO CURPATH
  502. end if
  503.  
  504. ''///////////////////////////// show destination path dialog (if installing)
  505.  
  506. IF OPTCUR$ = "1" then
  507. DEST$ = "C:\AUDIOSIM"
  508. end if
  509. GETPATH:
  510. UIPop 1
  511.     SetSymbolValue "EditTextIn", DEST$
  512.     SetSymbolValue "EditFocus", "END"
  513. GETPATHL1:
  514. If SCRWID% = 640 then
  515.     sz$ = UIStartDlg(CUIDLL$, DESTPATHX, "FEditDlgProc", 0, "")
  516. else
  517.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", 0, "")
  518. end if
  519.     DEST$ = GetSymbolValue("EditTextOut")
  520.  
  521.     IF sz$ = "CONTINUE" THEN
  522.         checkdltr$ = mid$(DEST$,1,1)
  523.         If checkdltr$ <> "" then
  524.         checkexist% = IsDriveValid(checkdltr$)
  525.             If checkexist% = 0 then
  526.             GOSUB BADPATH
  527.             GOTO GETPATHL1
  528.             end if
  529.         end if      
  530.                 IF IsDirWritable(DEST$) = 0 THEN
  531.                 GOSUB BADPATH
  532.                 GOTO GETPATHL1
  533.                 END IF
  534.         checkdspc& = GetFreeSpaceForDrive(checkdltr$)
  535.               if checkdspc& < 2500000 then
  536.                 spcneeded& = 2500000 - checkdspc&
  537.                 notenuff% = MessageBox(hwnd%,"Insufficient space on drive '" + checkdltr$ + "'.  Shortfall: " + str$(spcneeded&) + " bytes.","Sound Impression Setup",MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  538.                 If IDOK then
  539.                 GOTO GETPATHL1
  540.                 end if
  541.               end if
  542.         UIPop 1
  543.     ELSEIF sz$ = "REACTIVATE" THEN
  544.         GOTO GETPATHL1
  545.     ELSE
  546.         GOSUB ASKQUIT
  547.         GOTO GETPATH
  548.     END IF
  549.  
  550. ''///////////////////////////// show destination path dialog (if deinstalling or changing cards)
  551.  
  552. If OPTCUR$ = "2" or OPTCUR$ = "3" then
  553.  
  554. CURPATH:
  555. UIPop 1
  556.     SetSymbolValue "EditTextIn", PATHNOW$
  557.     SetSymbolValue "EditFocus", "END"
  558. CURPATHL1:
  559. If SCRWID% = 640 then
  560.     sz$ = UIStartDlg(CUIDLL$, SIPATHX, "FEditDlgProc", 0, "")
  561. else
  562.     sz$ = UIStartDlg(CUIDLL$, SIPATH, "FEditDlgProc", 0, "")
  563. end if
  564.     PATHNOW$ = GetSymbolValue("EditTextOut")
  565.     IF sz$ = "CONTINUE" THEN
  566.         checkdltr2$ = mid$(PATHNOW$,1,1)
  567.         if checkdltr2$ <> "" then
  568.         checkexist2% = IsDriveValid(checkdltr2$)
  569.             If checkexist2% = 0 then
  570.             GOSUB BADPATH
  571.             GOTO CURPATHL1
  572.             end if
  573.         end if      
  574.                 IF IsDirWritable(PATHNOW$) = 0 THEN
  575.                 GOSUB BADPATH
  576.                 GOTO CURPATHL1
  577.                 END IF
  578.         if OPTCUR$ = "2" then
  579.         checkaudiox% = DoesFileExist(MakePath (PATHNOW$,"AUDIOSIM.EXE"),femExists)
  580.                 If checkaudiox% = 0 then
  581.                 axnotfound% = MessageBox(hwnd%, "Sound Impression program not found in this directory.  Try again.", "Sound Impression Setup", MB_OK+MB_TASKMODAL+MB_ICONQUESTION)
  582.                 GOTO CURPATHL1
  583.                 end if
  584.         checkdspc2& = GetFreeSpaceForDrive(checkdltr2$)
  585.               if checkdspc2& < 850000 then
  586.                 spcneeded2& = 850000 - checkdspc2&
  587.                 notenuff2% = MessageBox(hwnd%,"Insufficient space on drive " + checkdltr2$ + "for Setup temp files.  Shortfall: " + str$(spcneeded2&) + " bytes.","Sound Impression Setup",MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  588.                 If IDOK then
  589.                 GOTO CURPATHL1
  590.                 end if
  591.               end if
  592.         end if          
  593.         If OPTCUR$ = "3" then
  594.                 If REMIMPRESSION = "yes" then
  595.                 lastchance% = MessageBox(hwnd%, "Are you SURE you want to remove Sound Impression from your hard disk?", "Sound Impression Deinstall", MB_YESNO+MB_TASKMODAL+MB_ICONQUESTION)
  596.                         if IDYES then
  597.                         GOTO DEINSTALL
  598.                         else
  599.                         GOTO CURPATHL1
  600.                         end if
  601.                 END IF
  602.         END IF
  603.     UIPop 1
  604.     ELSEIF sz$ = "REACTIVATE" THEN
  605.         GOTO CURPATHL1
  606.     ELSE
  607.         GOSUB ASKQUIT
  608.         GOTO CURPATH
  609.     END IF
  610. end if
  611.  
  612. ''//////////////////////////////////////// prep status report items, 
  613. ''//////////////////////////////////////// get Help file ready to call if needed
  614.  
  615. source$ = GetSymbolValue("STF_SRCDIR")
  616. helpsource$ = MakePath$(source$,"audiotec.hlp")
  617.  
  618. If OPTCUR$ = "1" then
  619. helploc$ = MakePath(DEST$,"audiotec.hlp")
  620. CopyFile helpsource$,helploc$,cmoOverwrite,0 
  621. elseif OPTCUR$ = "2" then
  622. helploc$ = MakePath(PATHNOW$,"audiotec.hlp")
  623. CopyFile helpsource$,helploc$,cmoOverwrite,0 
  624. end if
  625.  
  626. helptitle$ = "Sound Impression Help System"
  627. helpWnd% = FindWindow (NULL,helptitle$)  
  628.  
  629. STATUSITEMS$ = "ListItemsIn"
  630. STATUSITEMSPICK$ = "ListItemsOut"
  631.  
  632. If CDD$ = "no" then
  633. AddListItem STATUSITEMS$,"**** CD-ROM driver not detected"
  634. end if
  635. If SEQ$ = "no" then
  636. AddListItem STATUSITEMS$,"**** MIDI driver not detected"
  637. end if
  638. If WAV$ = "no" then
  639. AddListItem STATUSITEMS$,"**** Wave audio driver not detected"
  640. end if
  641. If TIM$ = "no" then
  642. AddListItem STATUSITEMS$,"**** Multimedia Timer not detected"
  643. end if
  644.  
  645. AddListItem STATUSITEMS$,WORKSTRING$
  646. AddListItem STATUSITEMS$,VIRTSTRING$
  647. If wtempswapd$ <> "" Then
  648.         AddListItem STATUSITEMS$,TEMPSWAP$
  649. end if
  650. If wpermswapd$ <> "" Then
  651.         AddListItem STATUSITEMS$,PERMSWAP$
  652. else
  653.         AddListItem STATUSITEMS$,NOPERMSWAP$
  654. end if
  655. AddListItem STATUSITEMS$,wproctyprpt$
  656. If DOSVERRPT$ <> "" then
  657. AddListItem STATUSITEMS$,DOSVERRPT$
  658. end if
  659. If WINVERRPT <> "" then
  660. AddListItem STATUSITEMS$,WINVERRPT$
  661. end if
  662. If wmode% <> 2 then
  663. AddListItem STATUSITEMS$,WMODERPT$
  664. end if
  665. IF MOUSERPT$ <> "" then
  666. AddListItem STATUSITEMS$,MOUSERPT$
  667. end if
  668. IF ARIALRPT$ <> "" then
  669. AddListItem STATUSITEMS$,ARIALRPT$
  670. end if
  671. IF ARIALKEY$ <> "" then
  672. AddListItem STATUSITEMS$,ARIALKEY$
  673. end if
  674. If TRUTYPRPT$ <> "" then
  675. AddListItem STATUSITEMS$,TRUTYPRPT$
  676. end if
  677. If TRUTYPKEY$ <> "" then
  678. AddListItem STATUSITEMS$,TRUTYPKEY$
  679. end if
  680. If WBITRPT$ <> "" then
  681. AddListItem STATUSITEMS$,WBITRPT$
  682. end if
  683.  
  684. ''//////////////////////////////////////// show status report 
  685.  
  686. SHOWTOP:
  687. sslistlen% = GetListLength(STATUSITEMS$)
  688. totop$ = GetListItem(STATUSITEMS$,1)
  689.     SetSymbolValue "ListItemsOut", totop$
  690. SHOWSTATS:
  691. if SCRWID% = 640 then
  692.     sz$ = UIStartDlg(CUIDLL$, STATUSREPORTX, "FListDlgProc", 0, "")
  693. else
  694.     sz$ = UIStartDlg(CUIDLL$, STATUSREPORT, "FListDlgProc", 0, "")
  695. end if    
  696.         STATS$ = GetSymbolValue(STATUSITEMS$)
  697.         STATPICK$ = GetSymbolValue(STATUSITEMSPICK$)
  698.  
  699.    IF sz$ = "CONTINUE" THEN 
  700.         If STATPICK$ = WORKSTRING$ then
  701.                 show10% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,10)        
  702.                 GOTO SHOWSTATS
  703.         END IF
  704.         If STATPICK$ = VIRTSTRING$ then
  705.                 show20% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,20)        
  706.                 GOTO SHOWSTATS
  707.         END IF
  708.         If STATPICK$ = NOPERMSWAP$ or STATPICK$ = PERMSWAP$ or STATPICK$ = TEMPSWAP$ then
  709.                 show30% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,30)        
  710.                 GOTO SHOWSTATS
  711.         END IF
  712.         If STATPICK$ = wproctyprpt$ then
  713.                 show40% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,40)        
  714.                 GOTO SHOWSTATS
  715.         END IF
  716.         If STATPICK$ = DOSVERRPT$ then
  717.                 show50% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,50)        
  718.                 GOTO SHOWSTATS
  719.         END IF
  720.         If STATPICK$ = WINVERRPT$ or STATPICK$ = WMODERPT$ then
  721.                 show60% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,60)        
  722.                 GOTO SHOWSTATS
  723.         END IF
  724.         If STATPICK$ = ARIALRPT$ or STATPICK$ = ARIALKEY$ then
  725.                 show70% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,70)        
  726.                 GOTO SHOWSTATS
  727.         END IF
  728.         If STATPICK$ = TRUTYPKEY$ or STATPICK$ = TRUTYPRPT$ then
  729.                 show75% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,75)        
  730.                 GOTO SHOWSTATS
  731.         END IF
  732.         If STATPICK$ = WBITRPT$ then
  733.                 show80% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,80)        
  734.                 GOTO SHOWSTATS
  735.         END IF
  736.         If STATPICK$ = MOUSERPT$ then
  737.                 show90% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,90)        
  738.                 GOTO SHOWSTATS
  739.         END IF
  740.         If STATPICK$ = "**** Wave audio driver not detected" then
  741.                 show100% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,100)        
  742.                 GOTO SHOWSTATS
  743.         END IF
  744.         If STATPICK$ = "**** MIDI driver not detected" then
  745.                 show110% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,110)        
  746.                 GOTO SHOWSTATS
  747.         END IF
  748.         If STATPICK$ = "**** CD-ROM driver not detected" then
  749.                 show120% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,120)        
  750.                 GOTO SHOWSTATS
  751.         END IF
  752.         If STATPICK$ = "**** Multimedia Timer not detected" then
  753.                 show130% = WinHelp (mainWnd%,helploc$,HELP_CONTEXT,130)        
  754.                 GOTO SHOWSTATS
  755.         END IF
  756.   
  757.     ELSEIF sz$ = "EXIT" THEN  ''note: this is actually the "continue" button
  758.         UIPop 1
  759.     ELSEIF sz$ = "REACTIVATE" THEN
  760.         GOTO SHOWSTATS
  761.     ELSE
  762.         GOSUB ASKQUIT
  763.         GOTO SHOWTOP
  764.     END IF
  765.   
  766.         SetSymbolValue "ListItemsIn",""
  767.         SetSymbolValue "ListItemsOut",""
  768.  
  769. ''//////////////////////////////////////// show card selection list 
  770.  
  771. CARD$ = "ListItemsIn"
  772. CARDPICK$ = "ListItemsOut"
  773.         AddListItem CARD$,"Mozart Sound System"
  774.         AddListItem CARD$,"Other"
  775. SINGLELIST:
  776.     SetSymbolValue "ListItemsOut", "Mozart Sound System"
  777.  
  778. LISTIT1:
  779. If SCRWID% = 640 then
  780.     sz$ = UIStartDlg(CUIDLL$, CARDLISTX, "FListDlgProc", APPHELPX, HELPPROC$)
  781. else
  782.     sz$ = UIStartDlg(CUIDLL$, CARDLIST, "FListDlgProc", APPHELP, HELPPROC$)
  783. end if
  784.         CARDLOADLIST$ = GetSymbolValue(CARD$)
  785.         SELECTED$ = GetSymbolValue(CARDPICK$)
  786.  
  787.     IF sz$ = "CONTINUE" THEN
  788.     UIPop 1 
  789.  
  790.     ELSEIF sz$ = "REACTIVATE" THEN
  791.         GOTO LISTIT1
  792.     ELSE
  793.         GOSUB ASKQUIT
  794.         GOTO SINGLELIST
  795.     END IF
  796.  
  797.  
  798. ''//////////////////////////////////////// card selection is made; do install 
  799.  
  800. INSTALL
  801.  
  802. ''//////////////////////////////////////// end checks & routines, cleanup 
  803.  
  804. QUIT:
  805.     ON ERROR GOTO ERRQUIT
  806.  
  807.     IF ERR = 0 THEN
  808.  
  809.         SETUPOK = "success"
  810.         helpx% = WinHelp (mainWnd%,helploc$,HELP_QUIT,NULL)
  811.        
  812.         if SCRWID% = 640 then
  813.         dlg% = EXITSUCCESSX
  814.         else
  815.         dlg% = EXITSUCCESS
  816.         end if
  817.        
  818.     ELSEIF ERR = STFQUIT THEN
  819.         helpx% = WinHelp (mainWnd%,helploc$,HELP_QUIT,NULL)
  820.         if SCRWID% = 640 then
  821.         dlg% = EXITQUITX
  822.         else
  823.         dlg% = EXITQUIT
  824.         end if
  825.         REMOVESI
  826.     ELSE
  827.         helpx% = WinHelp (mainWnd%,helploc$,HELP_QUIT,NULL)
  828.         if SCRWID% = 640 then
  829.         dlg% = EXITFAILUREX
  830.         else
  831.         dlg% = EXITFAILURE
  832.         end if
  833.         REMOVESI
  834.     END IF
  835.  
  836. QUITL1:
  837.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  838.     IF sz$ = "REACTIVATE" THEN
  839.         GOTO QUITL1
  840.     END IF
  841.         UIPop 1
  842.     END
  843.  
  844. ERRQUIT:
  845.     er% = ERR
  846.     WHATERR$ = ERROR$(er%)
  847.         iii% = DoMsgBox("Error "+ str$(er%) + ": "+ WHATERR$ + ". Call Technical Support.", "Sound Impression Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  848.     END
  849.  
  850. BADPATH:
  851. if SCRWID% = 640 then
  852.     sz$ = UIStartDlg(CUIDLL$, BADPATHX, "FInfo0DlgProc", 0, "")
  853. else
  854.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  855. end if
  856.     IF sz$ = "REACTIVATE" THEN
  857.         GOTO BADPATH
  858.     END IF
  859.     UIPop 1
  860.     RETURN
  861.  
  862. ASKQUIT:
  863. if SCRWID% = 640 then
  864.     sz$ = UIStartDlg(CUIDLL$, ASKQUITX, "FQuitDlgProc", 0, "")
  865. else
  866.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  867. end if
  868.     DELETEFLAG$ = "NO"
  869.     IF sz$ = "EXIT" THEN
  870.         If OPTCUR$ = "1" then
  871.         RemoveFile MakePath(DEST$ , "audiotec.hlp"),cmoForce
  872.         elseif OPTCUR$ = "2" then
  873.         RemoveFile MakePath(PATHNOW$ , "audiotec.hlp"),cmoForce
  874.         end if
  875.         UIPopAll
  876.         ERROR STFQUIT
  877.     ELSEIF sz$ = "REACTIVATE" THEN
  878.         GOTO ASKQUIT
  879.     ELSE
  880.         UIPop 1
  881.     END IF
  882.     RETURN
  883.  
  884. ''//////////////////////////////////////// deinstallation sequence
  885. DEINSTALL:
  886. ON ERROR GOTO XDEINSTALL
  887. If REMIMPRESSION = "yes" then
  888.     CloseLogFile
  889.     logclosed% = 1
  890. RemoveFile MakePath(PATHNOW$ , "audiocmp.dll"),cmoForce
  891. RemoveFile MakePath(PATHNOW$ , "audiocnv.dll"),cmoForce
  892. RemoveFile MakePath(PATHNOW$ , "audioctl.dll"),cmoForce
  893. RemoveFile MakePath(PATHNOW$ , "audiodlg.dll"),cmoForce
  894. RemoveFile MakePath(PATHNOW$ , "audiodrv.dll"),cmoForce
  895. RemoveFile MakePath(PATHNOW$ , "audiomix.dll"),cmoForce
  896. RemoveFile MakePath(PATHNOW$ , "audiogpl.dll"),cmoForce
  897. RemoveFile MakePath(PATHNOW$ , "audioman.dll"),cmoForce
  898. RemoveFile MakePath(PATHNOW$ , "audioole.dll"),cmoForce
  899. RemoveFile MakePath(PATHNOW$ , "audiorak.dll"),cmoForce
  900. RemoveFile MakePath(PATHNOW$ , "audiosys.dll"),cmoForce
  901. RemoveFile MakePath(PATHNOW$ , "audiowam.dll"),cmoForce
  902. RemoveFile MakePath(PATHNOW$ , "audiowav.dll"),cmoForce
  903. RemoveFile MakePath(PATHNOW$ , "audiored.exe"),cmoForce
  904. RemoveFile MakePath(PATHNOW$ , "audiorcm.exe"),cmoForce
  905. RemoveFile MakePath(PATHNOW$ , "audiormn.exe"),cmoForce
  906. RemoveFile MakePath(PATHNOW$ , "audiosim.exe"),cmoForce
  907. RemoveFile MakePath(PATHNOW$ , "audiohlp.hlp"),cmoForce
  908. RemoveFile MakePath(PATHNOW$ , "audiotec.hlp"),cmoForce
  909. RemoveFile MakePath(PATHNOW$ , "news01.txt"),cmoForce
  910. RemoveFile MakePath(PATHNOW$ , "logfile.out"),cmoForce
  911. RemoveFile MakePath(PATHNOW$ , "logfile.xx1"),cmoForce
  912. RemoveFile MakePath(PATHNOW$ , "logfile.xx2"),cmoForce
  913.  
  914. islog1% = DoesFileExist(MakePath(PATHNOW$,"logfile.out"),femExists)
  915. islog1b% = DoesFileExist(MakePath(PATHNOW$,"logfile.xx1"),femExists)
  916. islog2b% = DoesFileExist(MakePath(PATHNOW$,"logfile.xx2"),femExists)
  917. if log1% = 1 then
  918. RemoveFile MakePath(PATHNOW$ , "logfile.out"),cmoForce
  919. end if
  920. if log1b% = 1 then
  921. RemoveFile MakePath(PATHNOW$ , "logfile.xx1"),cmoForce
  922. end if
  923. if log2b% = 1 then
  924. RemoveFile MakePath(PATHNOW$ , "logfile.xx2"),cmoForce
  925. end if
  926.   
  927.         mixfilex$ = MakePath(PATHNOW$ , "MMMIXER.DLL")
  928.         mmmdatex$ = GetDateOfFile(mixfilex$)
  929.                         If mmmdatex$ = "1993-01-01-00-00-00" then 
  930.                            RemoveFile MakePath(PATHNOW$ , "mmmixer.dll"),cmoForce 
  931.                         end if
  932.  
  933. RemoveFile MakePath(WINDIRECT$ , "audio.ini"),cmoForce
  934. RMDIR PATHNOW$
  935. closeremoval% = MessageBox(hwnd%, "Sound Impression files have been removed.", "Sound Impression deinstallation", MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  936. UIPopAll 
  937. stop
  938.  
  939. XDEINSTALL:
  940. if exists (MakePath(PATHNOW$ , "*.*")) then
  941. verifyfdel% = MessageBox(hwnd%, "One or more files (not identified as Sound Impression program files) remain in directory" + DEST$ + ".","Sound Impression Setup", MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  942. else
  943. CHDIR "c:\"
  944. RMDIR PATHNOW$
  945. end if
  946. stop
  947. end if
  948.  
  949. ''/////////////////////////////////////// installation subroutine (start)
  950.  
  951. SUB Install STATIC
  952.  
  953. RemoveSymbol "ListItemsIn"
  954. RemoveSymbol "ListItemsOut"
  955.  
  956. SrcDir$ = GetSymbolValue("STF_SRCDIR")
  957. If OPTCUR$ = "2" then
  958. DEST$ = PATHNOW$
  959. end if
  960. CreateDir DEST$, cmoNone
  961.  
  962. '' //////////// (installation): create log file (rename old) and write stats
  963.  
  964.         islog2% = DoesFileExist(MakePath(DEST$,"logfile.xx1"),femExists)
  965.         if islog2% = 1 then
  966.                  RenameFile MakePath(DEST$ , "logfile.xx1"), "logfile.xx2"
  967.         end if
  968.         islog% = DoesFileExist(MakePath(DEST$,"logfile.out"),femExists)
  969.         if islog% = 1 then
  970.                  RenameFile MakePath(DEST$ , "logfile.out"), "logfile.xx1"
  971.         end if
  972.     OpenLogFile MakePath(DEST$, "LOGFILE.OUT"), 0
  973.     WriteToLogFile ""
  974.     WriteToLogFile "User chose as destination directory: '" + DEST$ + "'"
  975.     WriteToLogFile "User chose option: '" + SELECTED$ + "'"
  976.     WriteToLogFile ""
  977.     WriteToLogFile "May have had to create the directory: " + DEST$
  978.     WriteToLogFile ""
  979.     WriteToLogFile "SYSTEM CONFIGURATION AT TIME OF INSTALLATION:"
  980.     WriteToLogFile DOSVERRPT$
  981.     WriteToLogFile WINVERRPT$
  982.     WriteToLogFile WPROCTYPRPT$
  983.     WriteToLogFile WORKSTRING$
  984.     WriteToLogFile VIRTSTRING$
  985.     WriteToLogFile PERMSWAP$
  986.     WriteToLogFile TEMPSWAP$
  987.     WriteToLogFile WBITRPT$
  988.     WriteToLogFile MOUSERPT$
  989.     WriteToLogFile WMODERPT$
  990.     WriteToLogFile TRUTYPRPT$
  991.     WriteToLogFile ARIALRPT$
  992.     WriteToLogFile ""
  993.  
  994. '' //////////// (installation): establish copy file list, then copy files
  995.  
  996. AddSectionFilesToCopyList "Files", SrcDir$, DEST$
  997.   
  998. COPYNOW:        
  999. ''<<NEW block ends here
  1000.         
  1001. CopyFilesInCopyList
  1002.  
  1003. ''//////////// (installation): write initial audio.ini keys
  1004.  
  1005.     ini$ = MakePath(WINDIRECT$ , "AUDIO.INI")
  1006.  
  1007.     CreateIniKeyValue ini$, "SetupInfo",  "SetupPath", DEST$ , cmoOverwrite
  1008.     CreateIniKeyValue ini$, "SetupInfo",  "LastRunFrom", DEST$ + "\audiosim.exe", cmoOverwrite   
  1009.     CreateIniKeyValue ini$, "SetupInfo",  "RATProduct", "No" , cmoOverwrite
  1010.     CreateIniKeyValue ini$, "SetupInfo",  "Running", "No" , cmoOverwrite
  1011.     CreateIniKeyValue ini$, "Audio",      "PitchType", "Fixed", cmoOverwrite
  1012.     CreateIniKeyValue ini$, "AudioLevel", "InputImpedance", "Mic", cmoOverwrite
  1013.     CreateIniKeyValue ini$, "AudioLevel", "InputPatch", "On" , cmoOverwrite
  1014.     CreateIniKeyValue ini$, "AudioLevel", "OutputPatch", "On" , cmoOverwrite   
  1015.     CreateIniKeyValue ini$, "AudioLevel", "Focus", "Mic" , cmoOverwrite   
  1016.     CreateIniKeyValue ini$, "AudioLevel", "MicLevel", "32760,32760", cmoOverwrite   
  1017.  
  1018.        if SELECTED$ = "Other" then
  1019.     CreateIniKeyValue ini$, "Audio", "MixerType", "Standard" , cmoOverwrite
  1020.     CreateIniKeyValue ini$, "Audio", "SamplerType", "Fixed" , cmoOverwrite
  1021.     CreateIniKeyValue ini$, "Audio", "SamplerMin", "11025" , cmoOverwrite
  1022.     CreateIniKeyValue ini$, "Audio", "SamplerMax", "44100" , cmoOverwrite
  1023.         end if
  1024.        if SELECTED$ = "Mozart Sound System" then
  1025.     CreateIniKeyValue ini$, "Audio", "MixerType", "OAKMozart" , cmoOverwrite
  1026.     CreateIniKeyValue ini$, "Audio", "SamplerType", "Variable" , cmoOverwrite
  1027.     CreateIniKeyValue ini$, "Audio", "SamplerMin", "11025" , cmoOverwrite
  1028.     CreateIniKeyValue ini$, "Audio", "SamplerMax", "44100" , cmoOverwrite
  1029.         end if
  1030.  
  1031. ''///////////////// (installation): check if PM present; if so, create group & add items
  1032.  
  1033. findpm$ = FindTargetOnEnvVar("progman.exe","path")
  1034. if findpm$ <> "" then
  1035.  
  1036.     CreateProgmanGroup "Sound Impression", "", cmoNone
  1037.     ShowProgmanGroup  "Sound Impression", 1, cmoNone
  1038.     CreateProgmanItem "Sound Impression", "Sound Impression", MakePath(DEST$ , "audiosim.exe"), "", cmoOverwrite
  1039.     CreateProgmanItem "Sound Impression", "Waveform Editor", MakePath(DEST$ , "audiored.exe"), "", cmoOverwrite
  1040. ''<<NEW [removed]    CreateProgmanItem "Sound Impression", "Wave Composer", MakePath(DEST$ , "audiorcm.exe"), "", cmoOverwrite
  1041. ''<<NEW [removed]    CreateProgmanItem "Sound Impression", "Session Manager", MakePath(DEST$ , "audiormn.exe"), "", cmoOverwrite
  1042.     CreateProgmanItem "Sound Impression", "Sound Impression Help", MakePath(DEST$ , "audiohlp.hlp"), "", cmoOverwrite
  1043.  
  1044. else
  1045. nopm% = MessageBox(hwnd%,"Program Manager not found on your path. Add Sound Impression paths and properties to your shell after installation.", "Sound Impression Setup)", MB_OK+MB_ICONINFORMATION)
  1046. end if
  1047.  
  1048. ''///////////////// (installation): if the logfile isn't already closed, close it and end setup
  1049.  
  1050. if logclosed% = 0 then
  1051.     CloseLogFile
  1052. end if
  1053.  
  1054. END SUB
  1055.  
  1056. ''/////////////////////////////////// end subroutine
  1057.  
  1058. SUB FINIS STATIC
  1059. If SETUPOK = "success" then
  1060. endit:
  1061. end if
  1062. END SUB
  1063.  
  1064. ''/////////////////////////////////// subroutine to remove SI files & destination directory
  1065. ''/////////////////////////////////// if process cancelled by user
  1066.  
  1067. SUB REMOVESI STATIC
  1068. If DELETEFLAG = "" THEN
  1069. verifydel1% = MessageBox(hwnd%, "Remove Sound Impression files from " + DEST$ + "?","Sound Impression Setup", MB_YESNO+MB_TASKMODAL+MB_ICONQUESTION)
  1070.         if verifydel1% = IDYES then
  1071.     CloseLogFile
  1072.     logclosed% = 1
  1073. RemoveFile MakePath(DEST$ , "audiocmp.dll"),cmoForce
  1074. RemoveFile MakePath(DEST$ , "audiocnv.dll"),cmoForce
  1075. RemoveFile MakePath(DEST$ , "audioctl.dll"),cmoForce
  1076. RemoveFile MakePath(DEST$ , "audiodlg.dll"),cmoForce
  1077. RemoveFile MakePath(DEST$ , "audiomix.dll"),cmoForce
  1078. RemoveFile MakePath(DEST$ , "audiogpl.dll"),cmoForce
  1079. RemoveFile MakePath(DEST$ , "audioman.dll"),cmoForce
  1080. RemoveFile MakePath(DEST$ , "audioole.dll"),cmoForce
  1081. RemoveFile MakePath(DEST$ , "audiorak.dll"),cmoForce
  1082. RemoveFile MakePath(DEST$ , "audiosys.dll"),cmoForce
  1083. RemoveFile MakePath(DEST$ , "audiowam.dll"),cmoForce
  1084. RemoveFile MakePath(DEST$ , "audiowav.dll"),cmoForce
  1085. RemoveFile MakePath(DEST$ , "audiored.exe"),cmoForce
  1086. RemoveFile MakePath(DEST$ , "audiormn.exe"),cmoForce
  1087. RemoveFile MakePath(DEST$ , "audiorcm.exe"),cmoForce
  1088. RemoveFile MakePath(DEST$ , "audiosim.exe"),cmoForce
  1089. RemoveFile MakePath(DEST$ , "audiohlp.hlp"),cmoForce
  1090. RemoveFile MakePath(DEST$ , "audiotec.hlp"),cmoForce
  1091. RemoveFile MakePath(DEST$ , "news01.txt"),cmoForce
  1092. RemoveFile MakePath(DEST$ , "logfile.out"),cmoForce
  1093. RemoveFile MakePath(DEST$ , "logfile.xx1"),cmoForce
  1094. RemoveFile MakePath(DEST$ , "logfile.xx2"),cmoForce
  1095.  
  1096. islog1% = DoesFileExist(MakePath(DEST$,"logfile.out"),femExists)
  1097. islog1b% = DoesFileExist(MakePath(DEST$,"logfile.xx1"),femExists)
  1098. islog2b% = DoesFileExist(MakePath(DEST$,"logfile.xx2"),femExists)
  1099. if log1% = 1 then
  1100. RemoveFile MakePath(DEST$ , "logfile.out"),cmoForce
  1101. end if
  1102. if log1b% = 1 then
  1103. RemoveFile MakePath(DEST$ , "logfile.xx1"),cmoForce
  1104. end if
  1105. if log2b% = 1 then
  1106. RemoveFile MakePath(DEST$ , "logfile.xx2"),cmoForce
  1107. end if
  1108.                 
  1109.         isit2% = DoesFileExist(MakePath(WINDIRECT$,"audio.ini"),femExists)
  1110.         if isit2% = 1 then
  1111.                 verifydel2% = MessageBox(hwnd%, "Sound Impression initialization file (AUDIO.INI) was found in " + WINDIRECT$ + ". Remove it?","Sound Impression Setup", MB_YESNO+MB_TASKMODAL+MB_ICONQUESTION)
  1112.                 if verifydel2% = IDYES then
  1113.                 RemoveFile MakePath(WINDIRECT$ , "audio.ini"),cmoForce
  1114.                 end if
  1115.         end if
  1116.  
  1117.         mixfiley$ = MakePath(DEST$ , "MMMIXER.DLL")
  1118.         mmmdatey$ = GetDateOfFile(mixfiley$)
  1119.                          If mmmdatey$ = "1993-01-01-00-00-00" then
  1120.                                     RemoveFile MakePath(DEST$ , "mmmixer.dll"),cmoForce
  1121.                          end if
  1122.  
  1123. ''<<<NEW:'end if' that was here moved to end of this sub (it's the third one down there)
  1124. if exists (MakePath(DEST$ , "*.*")) then
  1125. verifydel3% = MessageBox(hwnd%, "One or more files (not identified as Sound Impression program files) remain in directory" + DEST$ + ".","Sound Impression Setup", MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  1126. else
  1127. DESTDRV$ = MID$(DEST$,1,3) ''<<<NEW
  1128. CHDIR DESTDRV$             ''<<<NEW
  1129. RMDIR DEST$
  1130. end if
  1131. end if
  1132. end if
  1133.  
  1134. END SUB
  1135.  
  1136. ''/////////////////////////////////////// script functions
  1137.  
  1138. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  1139.     IF szDir$ = "" THEN
  1140.         MakePath = szFile$
  1141.     ELSEIF szFile$ = "" THEN
  1142.         MakePath = szDir$
  1143.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  1144.         MakePath = szDir$ + szFile$
  1145.     ELSE
  1146.         MakePath = szDir$ + "\" + szFile$
  1147.     END IF
  1148. END FUNCTION
  1149.  
  1150.