home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Today - The Disc! 2 / CD-ROM_Today_-_The_Disc_2_June-July_1994.iso / wfsound / specific.in_ / specific.bin
Text File  |  1993-11-08  |  9KB  |  276 lines

  1. ''
  2. '' Wired for Sound Pro Limited-edition-specific install functions
  3. '' Copyright (c) 1993 Aristosoft, Inc.
  4. ''
  5.  
  6. '' Set up product-specific titles, etc.
  7. SUB SetProductTitles STATIC
  8.     SetTitle "Wired for Sound Pro Limited Edition"
  9.     WFSAPP$ = "WFS"
  10. END SUB
  11.  
  12.  
  13. FUNCTION InfFile() STATIC AS STRING
  14.     InfFile = "WFSPSAMP.INF"
  15. END FUNCTION
  16.  
  17.  
  18. FUNCTION MakeInstDir(D$) STATIC AS STRING
  19.  
  20.     '' If we're lucky, this will tell us where we're located
  21.     S$ = GetIniKeyString("win.ini", "Aristosoft", "WFS")
  22.  
  23.     '' If that didn't work, then we'll punt with the default
  24.     IF S$ = "" THEN
  25.     S$ = D$ + ":\WFSOUND"
  26.     END IF
  27.  
  28.     '' WFSOUND.INF must be in any installed WFS product
  29.     IF EXISTS(MakePath(S$, "WFSOUND.INF")) THEN
  30.     r% = DoMsgBox("An installed copy of Wired for Sound was found in " + S$+ ".", "WFS Pro Limited Edition", MB_OK)
  31.     END IF
  32.  
  33.     MakeInstDir = S$
  34. END FUNCTION
  35.  
  36.  
  37. SUB AddInfSectionNames(BASE$, TAPPS$, SOUNDS$, VOICES$, BASEINST$, TAPPSINST$, SOUNDSINST$, VOICESINST$) STATIC
  38.  
  39.     '' These are the base files we can install
  40.     AddListItem BASE$, "Base Files"
  41.     SetSymbolValue BASEINST$, GetSymbolValue(BASE$)
  42.  
  43.     '' By default, we install all the above
  44.     SetSymbolValue SOUNDSINST$, GetSymbolValue(SOUNDS$)
  45. END SUB
  46.  
  47.  
  48. SUB RecalcPath STATIC
  49.     CursorSave% = ShowWaitCursor()
  50.     RecalcOptFiles BASEFILES
  51.     RecalcOptFiles SOUNDFILES
  52.     RestoreCursor CursorSave%
  53. END SUB
  54.  
  55.  
  56. SUB AddOptFiles STATIC
  57.     AddOptFilesToCopyList BASEFILES
  58.     AddOptFilesToCopyList SOUNDFILES
  59. END SUB
  60.  
  61.  
  62. SUB AddOptFilesToCopyList (ftype%) STATIC
  63.  
  64.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  65.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  66.     IF ftype% = BASEFILES THEN
  67.         ''Base files
  68.         l% = GetListLength(BASEINST$)
  69.         FOR i% = 1 TO l% STEP 1
  70.         AddSectionFilesToCopyList GetListItem(BASEINST$, i%), SrcDir$, DEST$
  71.         NEXT i%
  72.  
  73.         IF INSTDSOUND% OR EXISTS(MakePath(SYSDIR$, "DSOUND.DLL")) THEN
  74.         dsDest$ = GetWindowsSysDir()
  75.         AddSpecialFileToCopyList "DSOUND Files", "DSOUND", SrcDir$, MakePath(dsDest$, "DSOUND.DLL")
  76.         END IF
  77.  
  78.         '' Install 3d control manager
  79.         AddSpecialFileToCopyList "System Files", "CTL3D", SrcDir$, MakePath(SYSDIR$, "CTL3D.DLL")
  80.  
  81.         '' Install msvideo and iccvid
  82.         AddSpecialFileToCopyList "System Files", "MSVIDEO", SrcDir$, MakePath(SYSDIR$, "MSVIDEO.DLL")
  83.         AddSpecialFileToCopyList "System Files", "ICCVID", SrcDir$, MakePath(SYSDIR$, "ICCVID.DRV")
  84.         AddSpecialFileToCopyList "System Files", "DIB", SrcDir$, MakePath(SYSDIR$, "DIB.DRV")
  85.  
  86.     END IF
  87.     SrcDir$ = ""
  88.     END IF
  89.  
  90. END SUB
  91.  
  92.  
  93. SUB SetDriveStatus STATIC
  94.     FITS% = 0
  95.     drive$ = MID$(DEST$, 1, 1)
  96.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  97.  
  98.     cost& = VAL(GetListItem(BASENEEDS$, ndrive%))
  99.  
  100.     free& = GetFreeSpaceForDrive(drive$)
  101.     IF cost& > free& THEN
  102.     FITS% = 1
  103.     END IF
  104.     ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
  105.     ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
  106.     ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
  107.  
  108.     IF drive$ = WINDRIVE$ THEN
  109.     ReplaceListItem DRIVETEXT$, 4, ""
  110.     ReplaceListItem DRIVETEXT$, 5, ""
  111.     ReplaceListItem DRIVETEXT$, 6, ""
  112.     ELSE
  113.     ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  114.  
  115.     cost& = VAL(GetListItem(BASENEEDS$, ndrive%))
  116.  
  117.     IF cost& = 0 THEN
  118.         ReplaceListItem DRIVETEXT$, 4, ""
  119.         ReplaceListItem DRIVETEXT$, 5, ""
  120.         ReplaceListItem DRIVETEXT$, 6, ""
  121.     ELSE
  122.         free& = GetFreeSpaceForDrive(WINDRIVE$)
  123.         IF cost& > free& THEN
  124.         FITS% = 1
  125.         END IF
  126.         ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
  127.         ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
  128.         ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
  129.     END IF
  130.     END IF
  131. END SUB
  132.  
  133.  
  134. '' Add billboard dialogs for this app
  135. SUB AddBillboards STATIC
  136.     AddToBillboardList CUIDLL$, BBD1, "FModelessDlgProc", 100
  137.     AddToBillboardList CUIDLL$, BBD2, "FModelessDlgProc", 100
  138.     AddToBillboardList CUIDLL$, BBD3, "FModelessDlgProc", 100
  139. END SUB
  140.  
  141.  
  142. CONST IDC_OWNER = 104
  143. CONST IDC_WORKPLACE = 106
  144. CONST RT_RCDATA = 10
  145.  
  146. SUB ConfigureApps STATIC
  147.  
  148.     '' This is so Fixer can find where we're installed
  149.     CreateIniKeyValue "win.ini", "Aristosoft", "WFS", DEST$, cmoOverwrite
  150.  
  151.     '' This is the name of the group we'll install into
  152.     GROUP$ = "WFS Pro Ltd."
  153.  
  154.     '' Configure base applications
  155.     IF GetListItem(CHECKSTATES$, BASEFILES) = "ON" THEN
  156.  
  157.     '' Create a group for us...
  158.     CreateProgmanGroup GROUP$, "", cmoNone
  159.  
  160.     '' Setup WFS Pro
  161.     CreateProgmanItem GROUP$, WFSAPP$, MakePath(DEST$, "wfsound.exe"), "", cmoOverwrite
  162.  
  163.     ''Setup up default association file
  164.     CreateIniKeyValue MakePath(DEST$, "WFSOUND.INF"), "WFSound", "ActiveProfile", MakePath(DEST$, "DEFAULT.WFS"), cmoNone
  165.  
  166.     ''Turn on icon events only if we support the shell
  167.     s$ = LCASE$(GetIniKeyString(SYSINI$, "boot", "shell"))
  168.     IF INSTR(s$, "progman.exe") THEN
  169.         i$ = "1"
  170.     ELSEIF INSTR(s$, "ndw.exe") THEN
  171.         i$ = "1"
  172.     ELSEIF INSTR(s$, "wndt.exe") THEN
  173.         i$ = "1"
  174.     ELSE
  175.         i$ = "0"
  176.     END IF
  177.     CreateIniKeyValue MakePath(DEST$, "DEFAULT.WFS"), "Status", "Icon", i$, cmoNone
  178.     s$ = ""
  179.     i$ = ""
  180.  
  181.     '' Disable Win 3.1 system startup and exit sounds
  182.     INI$ = "win.ini"
  183.     s$ = GetIniKeyString(INI$, "Sounds", "SystemStart")
  184.     CreateIniKeyValue INI$, "Sounds", "OldSystemStart", s$, cmoOverwrite
  185.     CreateIniKeyValue INI$, "Sounds", "SystemStart", "<none>,System Start", cmoOverwrite
  186.  
  187.     s$ = GetIniKeyString(INI$, "Sounds", "SystemExit")
  188.     CreateIniKeyValue INI$, "Sounds", "OldSystemExit", s$, cmoOverwrite
  189.     CreateIniKeyValue INI$, "Sounds", "SystemExit", "<none>,System Exit", cmoOverwrite
  190.  
  191.     '' Remove vox.drv
  192.     IF LCASE$(GetIniKeyString(SYSINI$, "drivers", "wavemapper")) = "vox.drv" THEN
  193.         s$ = GetIniKeyString(SYSINI$, "drivers", "vox.wavemapper")
  194.         CreateIniKeyValue SYSINI$, "drivers", "wavemapper", s$, cmoOverwrite
  195.     END IF
  196.  
  197.     ''Stamp the WFSABOUT resources
  198.     IF len(OWNER$) > 0 THEN
  199.         StampResource "Base Files", "WFS About", DEST$, RT_RCDATA, IDC_OWNER, OWNER$ + chr$(0), len(OWNER$) + 1
  200.     ELSE
  201.         StampResource "Base Files", "WFS About", DEST$, RT_RCDATA, IDC_OWNER, " " + chr$(0), 2
  202.     END IF
  203.     IF len(WORKPLACE$) > 0 THEN
  204.         StampResource "Base Files", "WFS About", DEST$, RT_RCDATA, IDC_WORKPLACE, WORKPLACE$ + chr$(0), len(WORKPLACE$) + 1
  205.     ELSE
  206.         StampResource "Base Files", "WFS About", DEST$, RT_RCDATA, IDC_WORKPLACE, " " + chr$(0), 2
  207.     END IF
  208.  
  209.     '' Install ICCVID Codec
  210.     CreateIniKeyValue SYSINI$, "Drivers", "VIDC.CVID", "iccvid.drv", cmoNone
  211.  
  212.     END IF
  213.  
  214.     '' Configure Talking Applications
  215.  
  216.     CreateProgmanItem GROUP$, "Wallpaper Changer", MakePath(DEST$, "wally.exe"), "", cmoOverwrite
  217.     INI$ = MakePath(DEST$, "WALLY.INI")
  218.     CreateIniKeyValue INI$, "Settings", "WallFile", MakePath(DEST$, "default.wal"), cmoNone
  219.  
  220.     CreateProgmanItem GROUP$, "Icon Changer", MakePath(DEST$, "iconplus.exe"), "", cmoOverwrite
  221.  
  222.     CreateProgmanItem GROUP$, "Cursor Changer", MakePath(DEST$, "cursor.exe") + " /foo /bar", "", cmoOverwrite
  223.  
  224.     CreateProgmanItem GROUP$, "Talking Clock", MakePath(DEST$, "tclock.exe"), "", cmoOverwrite
  225.     INI$ = MakePath(DEST$, "VOICE.INI")
  226.     CreateIniKeyValue INI$, "Voice Library", "TCLOCK.EXE", "+malel.voi", cmoNone
  227.     INI$ = MakePath(DEST$, "FACE.INI")
  228.     CreateIniKeyValue INI$, "Face", "TCLOCK.EXE", "+WFSFACE.FAC", cmoNone
  229.  
  230.     INI$ = MakePath(DEST$, "SCHEDAPI.INI")
  231.     CreateIniKeyValue INI$, "Settings", "HolidayFile", MakePath(DEST$, "TCAL.HOL"), cmoNone
  232.     CreateIniKeyValue INI$, "Settings", "DefaultApptBook", MakePath(DEST$, "DEFAULT.APP"), cmoNone
  233.  
  234.     '' Install DSOUND.DLL as the wave driver if there isn't one already, somewhere...
  235.     IF INSTDSOUND% AND EXISTS(MakePath(GetWindowsSysDir(), "DSOUND.DLL")) THEN
  236.     CreateIniKeyValue SYSINI$, "drivers", "wave", "DSOUND.DLL", cmoOverwrite
  237.     END IF
  238. END SUB
  239.  
  240.  
  241.  
  242. '' Remove all files and directories...
  243.  
  244. SUB DoUninstall STATIC
  245.     IF IDYES = DoMsgBox("Are you sure you want to remove WFS Pro Limited Edition from your system?", "WFS Pro Limited Edition", MB_YESNO) THEN
  246.     DEST$ = GetIniKeyString("win.ini", "Aristosoft", "WFS")
  247.     IF DEST$ <> "" THEN
  248.         old% = ShowWaitCursor()
  249.  
  250.         RemDirectory DEST$
  251.  
  252.         SendProgmanCommand "[DeleteGroup(""WFS Pro Ltd."")]"
  253.  
  254.         RemoveIniSection "win.ini", "Sound API", cmoNone
  255.  
  256.         '' Reset default startup and exit sounds
  257.         INI$ = "win.ini"
  258.         s$ = GetIniKeyString(INI$, "Sounds", "OldSystemStart")
  259.         RemoveIniKey INI$, "Sounds", "OldSystemStart", cmoNone
  260.         CreateIniKeyValue INI$, "Sounds", "SystemStart", s$, cmoOverwrite
  261.  
  262.         s$ = GetIniKeyString(INI$, "Sounds", "OldSystemExit")
  263.         RemoveIniKey INI$, "Sounds", "OldSystemExit", cmoNone
  264.         CreateIniKeyValue INI$, "Sounds", "SystemExit", s$, cmoOverwrite
  265.  
  266.         RestoreCursor old%
  267.  
  268.         i% = DoMsgBox("WFS Pro Limited Edition has been removed.  You can run Setup later to re-install it.", "WFS Pro Limited Edition", MB_OK)
  269.  
  270.         END
  271.     ELSE
  272.         i% = DoMsgBox("WFS Pro Limited Edition is not installed or cannot be found!", "WFS Pro Limited Edition", MB_OK)
  273.     END IF
  274.     END IF
  275. END SUB
  276.