home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-17 | 46.9 KB | 1,441 lines |
- '**************************************************************************
- '* $Header: G:/SRC/WCW/MSSETUP/VCS/WINCAKE.MSV 1.68 18 Jun 1996 14:45:36 FP $
- '*
- '* DESCRIPTION: MS-Setup script for Wincake and Wcwdemo.
- '*
- '* $Log: G:/SRC/WCW/MSSETUP/VCS/WINCAKE.MSV $
- '*
- '* Rev 1.68 18 Jun 1996 14:45:36 FP
- '* Add icon for 50demo.bun for demos.
- '*
- '* Rev 1.67 17 Jun 1996 09:53:42 FP
- '* Fix #4652. Correctly reassociate PLY files in registry. Put in missing
- '* Love Street playlist for Song Station.
- '*
- '* Rev 1.66 14 Jun 1996 09:55:36 FP
- '* Add icon for Song Station's CATDISP.EXE.
- '*
- '* Rev 1.65 07 Jun 1996 09:41:50 FP
- '* Correct string typo for MISC SFX.
- '*
- '* Rev 1.64 05 Jun 1996 15:57:26 FP
- '* Add icons for Songs and Sounds playlists for Song Station.
- '*
- '* Rev 1.63 05 Jun 1996 11:44:12 FP
- '* Add Song Station. The modification is trick in that the reference key in
- '* the layout does not match the application EXE name. Must put in additional
- '* logic to work around this.
- '*
- '* Rev 1.62 03 Jun 1996 10:07:46 FP
- '* Update for GMs.
- '*
- '* Rev 1.61 21 May 1996 16:54:20 FP
- '* Fix icon for WAV Farren playlist.
- '*
- '* Rev 1.60 21 May 1996 10:40:00 FP
- '* Change order of techniques icons.
- '*
- '* Rev 1.59 20 May 1996 18:40:06 FP
- '* Add icon for Farren playlist.
- '*
- '* Rev 1.58 15 May 1996 18:25:56 FP
- '* Assume Techniqs is subdir off CD-ROM drive letter.
- '*
- '* Rev 1.56 14 May 1996 17:51:26 FP
- '* Set up template for maybe installing Techniques movie icons.
- '*
- '* Rev 1.55 20 Mar 1996 17:09:56 FP
- '* Update to support all products.
- '*
- '* Rev 1.54 06 Mar 1996 15:35:50 FP
- '* Include Virtual Jukebox.
- '*
- '* Rev 1.53 29 Feb 1996 17:45:18 FP
- '* Take out wave profiler related code.
- '*
- '* Rev 1.52 24 Jan 1996 16:46:52 FP
- '* Update to separate "Pro Audio" and "Professional".
- '*
- '* Rev 1.51 04 Jan 1996 11:37:24 FP
- '* Just have README.WRI icon title be README.WRI.
- '*
- '* Rev 1.50 21 Dec 1995 12:16:24 FP
- '* Put in message concerning running Wave Profiler.
- '*
- '* Rev 1.49 21 Dec 1995 10:23:30 FP
- '* Add messagebox to remind user to run Wave Profiler.
- '*
- '* Rev 1.48 19 Dec 1995 17:06:06 FP
- '* Pro 4.01 update disk.
- '*
- '* Rev 1.47 19 Dec 1995 14:53:36 FP
- '* Take out what's new section.
- '*
- '* Rev 1.46 14 Dec 1995 09:58:50 FP
- '* Introduce whatsnew.wri.
- '*
- '* Rev 1.45 14 Nov 1995 17:56:34 PS
- '* Added Import button to Chord dialog. CHORDSNEW.LIW vs. CHORDS.LIW.
- '*
- '* Rev 1.44 18 Sep 1995 15:02:24 PS
- '* MSACM no longer installed.
- '*
- '* Rev 1.43 30 Aug 1995 19:05:30 FP
- '* Associate BUN files with Cakewalk Pro Audio.
- '*
- '* Rev 1.42 30 Aug 1995 15:08:16 FP
- '* RC1 changes to reflect PR name change to Cakewalk Pro Audio. Bring back
- '* install of VPiano.
- '*
- '* Rev 1.41 23 Aug 1995 16:02:14 FP
- '* Beta G changes.
- '*
- '* Rev 1.40 16 Aug 1995 11:59:16 FP
- '* Beta F changes.
- '*
- '* Rev 1.39 09 Aug 1995 16:14:54 FP
- '* Changes for BETA E.
- '*
- '* Rev 1.38 03 Aug 1995 13:18:52 FP
- '* Beta D changes.
- '*
- '* Rev 1.37 18 Jul 1995 15:18:42 FP
- '* BETA C changes and addition of MSACM.
- '*
- '* Rev 1.36 07 Jul 1995 16:16:44 FP
- '* Beta B changes.
- '*
- '* Rev 1.35 16 Jun 1995 16:42:18 FP
- '* Added Wave Profiler to Program group.
- '*
- '* Rev 1.34 13 Jun 1995 15:14:34 FP
- '* Modified for Edison Beta. VPiano not installed.
- '*
- '* Rev 1.33 20 Dec 1994 16:16:28 PS
- '* Final directory names for 3.01 RC1.
- '*
- '* Rev 1.32 20 Dec 1994 12:53:50 PS
- '* Add VPIANO to Pro & Pro Demo.
- '*
- '* Rev 1.31 13 Dec 1994 18:48:20 PS
- '* Added DEFAULT.INS, INS_NOT_OVERWRITTEN dialog.
- '*
- '* Rev 1.30 01 Dec 1994 16:43:38 PS
- '* New, separate-product production method. Many changes for 3.01 Beta B.
- '*
- '* Rev 1.29 14 Nov 1994 19:31:14 PS
- '* Set dest directory for beta testers.
- '*
- '* Rev 1.28 11 Nov 1994 19:06:48 PS
- '* CAKEXP.EXE. Allow layout per product.
- '*
- '* Rev 1.27 09 May 1994 13:19:02 GH
- '* Detect/require 80386 or higher, warn about no mouse.
- '*
- '* Rev 1.26 28 Apr 1994 21:26:02 GH
- '* Use SRC.INS and MASTER.INS
- '*
- '* Rev 1.25 25 Apr 1994 13:40:06 GH
- '* For CPW, changed DEST$ to C:\CPW30
- '*
- '* Rev 1.24 15 Apr 1994 15:34:48 GH
- '* Changes for 2.5 Beta
- '*
- '* Rev 1.23 17 Feb 1994 13:17:14 PS
- '* Associate .TPL files with us, too.
- '*
- '* Rev 1.22 11 Jan 1994 13:47:38 CP
- '* Create a Home Studio Demo version.
- '*
- '* Rev 1.21 08 Nov 1993 15:41:42 CP
- '* Change Lite name from WCWLITE to CAKEHS.
- '*
- '* Rev 1.20 23 Aug 1993 14:06:06 CP
- '* Default installation directory for Demo is now C:\WCWDEMO to prevent
- '* nuking of previous installations.
- '*
- '* Rev 1.19 24 May 1993 17:09:22 gwh
- '* Removed serial number item from user info prompt.
- '*
- '* Rev 1.18 18 Apr 1993 17:50:40 gwh
- '* More refinements for user name, organization, serial number stamping.
- '*
- '* Rev 1.17 01 Apr 1993 18:32:44 gwh
- '* Prompt user for Name, Organization, and Serial number.
- '* Stamp the .EXE resources for these items.
- '*
- '* Rev 1.16 18 Mar 1993 14:06:42 pws
- '* No more need to clean up old DLL's in Windows sys dir (or TTSSEQ.INI).
- '* Also check for existence of TTSSEQ.INI in install dir before copying
- '* any TTSSEQ.INI found in Windows sys dir before copying new files.
- '*
- '* Rev 1.15 05 Mar 1993 12:08:38 pws
- '* Fix support for multiple-disk installations, which had broken when
- '* we started determining which product we were by testing for the
- '* existence of name.EXE on the first diskette but it had been put
- '* on the second one. Now determine which product we are by testing
- '* for existence of product-specific section in SETUP.INF file.
- '*
- '* Rev 1.14 22 Dec 1992 13:17:36 pws
- '* Reflect changed dialog id's in BLDCUI\DIALOGS.H.
- '*
- '* Rev 1.13 15 Dec 1992 14:47:18 pws
- '* Added CTL3D.DLL.
- '*
- '* Rev 1.12 10 Nov 1992 12:37:56 pws
- '* Made more dialogs product-specific.
- '*
- '* ---
- '* See logfile for earlier revision comments
- '*
- '* Copyright (C) 1990- by Greg Hendershott. All rights reserved.
- '**************************************************************************
-
- '$INCLUDE 'setupapi.inc'
- '$INCLUDE 'msdetect.inc'
- '$INCLUDE 'msregdb.inc'
-
- 'These should have all been in SETUPAPI.INC.
- 'Note that duplicate definitions are errors and so are commented out!
-
- 'CONST MB_OK = &H0000
- CONST MB_OKCANCEL = &H0001
- CONST MB_ABORTRETRYIGNORE = &H0002
- CONST MB_YESNOCANCEL = &H0003
- CONST MB_YESNO = &H0004
- CONST MB_RETRYCANCEL = &H0005
- CONST MB_TYPEMASK = &H000F
-
- 'CONST MB_ICONHAND = &H0010
- CONST MB_ICONQUESTION = &H0020
- CONST MB_ICONEXCLAMATION = &H0030
- CONST MB_ICONASTERISK = &H0040
- CONST MB_ICONMASK = &H00F0
-
- CONST MB_ICONINFORMATION = MB_ICONASTERISK
- CONST MB_ICONSTOP = MB_ICONHAND
-
- CONST MB_DEFBUTTON1 = &H0000
- CONST MB_DEFBUTTON2 = &H0100
- CONST MB_DEFBUTTON3 = &H0200
- CONST MB_DEFMASK = &H0F00
-
- CONST MB_APPLMODAL = &H0000
- CONST MB_SYSTEMMODAL = &H1000
- 'CONST MB_TASKMODAL = &H2000
-
- CONST MB_NOFOCUS = &H8000
-
- CONST IDOK = 1
- CONST IDCANCEL = 2
- CONST IDABORT = 3
- CONST IDRETRY = 4
- CONST IDIGNORE = 5
- CONST IDYES = 6
- CONST IDNO = 7
-
- 'Dialog ID's. NOTE: THIS MUST MATCH BLDCUI\DIALOGS.H!
- CONST WELCOME_PR = 170
- CONST WELCOME_PD = 171
- CONST WELCOME_HS = 172
- CONST WELCOME_HD = 173
- CONST WELCOME_XP = 174
- CONST WELCOME_XD = 175
- CONST WELCOME_PA = 176
- CONST WELCOME_AD = 177
- CONST WELCOME_SS = 178
- CONST ASKQUIT = 200
- CONST DESTPATH = 300
- CONST USERINFO = 310
- CONST EXITFAILURE = 400
- CONST EXITQUIT_PR = 670
- CONST EXITQUIT_PD = 671
- CONST EXITQUIT_HS = 672
- CONST EXITQUIT_HD = 673
- CONST EXITQUIT_XP = 674
- CONST EXITQUIT_XD = 675
- CONST EXITQUIT_PA = 676
- CONST EXITQUIT_AD = 677
- CONST EXITQUIT_SS = 678
- CONST EXITSUCCESS_PR = 770
- CONST EXITSUCCESS_PD = 771
- CONST EXITSUCCESS_HS = 772
- CONST EXITSUCCESS_HD = 773
- CONST EXITSUCCESS_XP = 774
- CONST EXITSUCCESS_XD = 775
- CONST EXITSUCCESS_PA = 776
- CONST EXITSUCCESS_AD = 777
- CONST EXITSUCCESS_SS = 778
- CONST APPHELP_PR = 970
- CONST APPHELP_PD = 971
- CONST APPHELP_HS = 972
- CONST APPHELP_HD = 973
- CONST APPHELP_XP = 974
- CONST APPHELP_XD = 975
- CONST APPHELP_PA = 976
- CONST APPHELP_AD = 977
- CONST APPHELP_SS = 978
- CONST INI_NOT_OVERWRITTEN = 1000
- CONST INS_NOT_OVERWRITTEN = 1100
- CONST CHORDS_NOT_OVERWRITTEN= 1200
- CONST BADPATH = 6400
-
- 'Bitmap ID.
- CONST LOGO = 1
-
- GLOBAL COMPANY$
- GLOBAL PROGNAME$
- GLOBAL PRODUCTNAME$
- GLOBAL DEST$ 'Default destination directory.
-
- DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
- DECLARE SUB MaybeAssociate (szExt$)
- DECLARE SUB MaybeAssociateVJB (szExt$)
- DECLARE SUB SafeCopy(szShort$, szLong$)
- DECLARE FUNCTION ArgStr$ (Fmt$, Arg1$, Arg2$, Arg3$, Arg4$)
-
- INIT:
- '======== beg LOCALIZATION ========
- 'These are the strings that need to be localized for different languages.
- 'Every one of them is located right here in this block.
- CONST COMPANY_$ = "Twelve Tone Systems"
- CONST PRODUCTNAME_PA_$ = "Cakewalk Pro Audio"
- CONST PRODUCTNAME_AD_$ = "Cakewalk Pro Audio Demo"
- CONST PRODUCTNAME_UP_$ = "Cakewalk Pro Audio Update"
- CONST PRODUCTNAME_PR_$ = "Cakewalk Professional"
- CONST PRODUCTNAME_PD_$ = "Cakewalk Professional Demo"
- CONST PRODUCTNAME_HS_$ = "Cakewalk Home Studio"
- CONST PRODUCTNAME_HD_$ = "Cakewalk Home Studio Demo"
- CONST PRODUCTNAME_XP_$ = "Cakewalk Express"
- CONST PRODUCTNAME_XD_$ = "Cakewalk Express Demo"
- CONST PRODUCTNAME_SS_$ = "Cakewalk Song Station"
- CONST PROGMANGROUPNAME_PA_$ = "Cakewalk Pro Audio"
- CONST PROGMANGROUPNAME_PR_$ = "Cakewalk Professional"
- CONST PROGMANGROUPNAME_HS_$ = "Cakewalk Home Studio"
- CONST PROGMANGROUPNAME_XP_$ = "Cakewalk Express"
- CONST PROGMANGROUPNAME_SS_$ = "Cakewalk Song Station"
- CONST PROGNAME_VJB_$ = "VJB"
- CONST SETUP_$ = "Setup"
- CONST SetTitleFmt_$ = "\1 \2"
- CONST setupMessage_$ = "Setup Message"
- CONST setupProblem_$ = "Setup Problem"
- CONST setupQuestion_$ = "Setup Question"
- CONST winVerFmt_$ = "Sorry, but your Windows version is \1 and \2 requires at least Windows \3."
- CONST cpuFmt_$ = "Sorry, but \1 requires at least an 80386 or higher CPU."
- CONST mouseFmt_$ = "Please be aware that \1 requires a mouse for many operations."
- CONST errQuitFmt_$ = "Installation failure. Call \1 Technical Support."
- CONST driveBase_$ = "A" 'drive letters start at this char
- CONST dskSpcFmt_$ = "Sorry, \1 needs \2K bytes more (\3K total) on drive \4:. Clear space or try a new path."
- CONST userInfoNeedName_$ = "You must supply your name or Setup cannot proceed."
- CONST assocConfirmFmt_$ = ".\1 files are currently associated with \2. Switch association to \3?"
- CONST PRODUCTNAME_VP_$ = "Virtual Piano"
- CONST PRODUCTNAME_VJB_$ = "Virtual Jukebox"
- CONST PRODUCTNAME_VJB_DEMO$ = "General MIDI Songs"
- CONST RIFFUNK_DEMO$ = "Audio and MIDI Demo"
- CONST instMustRestartWinFmt_$ = "\1 installed. You must restart Windows before it can be used."
- ' CONST runWaveProfilerCaption_$ = "Run Wave Profiler"
- ' CONST runWaveProfilerMsg_$ = "Please run Wave Profiler to ensure proper operation between Windows digital audio devices and Cakewalk Pro Audio."
-
- '==== Promotional DEMO Song ====
-
- CONST DEMO_DIR_$ = "DemoSong\"
-
- CONST DEMO2_SONG_$ = "50DEMO.BUN"
- CONST DEMO2_DESC_$ = "Cakewalk Will Take You There"
-
- '==== TECHniques ====
-
- CONST TECH_DIR_$ = "Techniqs\"
-
- CONST STR_TECH1_DESC_$ = "TECHniques #1 Watch Me First!"
- CONST STR_TECH1_EXE_$ = "first.exe"
-
- CONST STR_TECH2_DESC_$ = "TECHniques #2 Overview"
- CONST STR_TECH2_EXE_$ = "overview.exe"
-
- CONST STR_TECH3_DESC_$ = "TECHniques #3 Setup"
- CONST STR_TECH3_EXE_$ = "setup.exe"
-
- CONST STR_TECH4_DESC_$ = "TECHniques #4 Recording Audio"
- CONST STR_TECH4_EXE_$ = "audrecrd.exe"
-
- CONST STR_TECH5_DESC_$ = "TECHniques #5 Recording MIDI"
- CONST STR_TECH5_EXE_$ = "recmidi.exe"
-
- CONST STR_TECH6_DESC_$ = "TECHniques #6 Parameters and Controls"
- CONST STR_TECH6_EXE_$ = "control.exe"
-
- CONST STR_TECH7_DESC_$ = "TECHniques #7 How to Select"
- CONST STR_TECH7_EXE_$ = "select.exe"
-
- '==== Charlie Farren Tunes ====
-
- CONST FARREN_DIR_$ = "Farren\"
-
- CONST FARREN_SONG1_$ = "LOVE.BUN"
- CONST FARREN_DESC1_$ = "Love Street - Charlie Farren"
-
- CONST FARREN_SONG2_$ = "ANIMAL.BUN"
- CONST FARREN_DESC2_$ = "Animal Dance - Charlie Farren"
-
- CONST FARREN_PLAY3_$ = "FARREN.PLY"
- CONST FARREN_DESC3_$ = "Charlie Farren Quick Audition"
-
- CONST FARREN_SONG4_$ = "LOVE_EX.BUN"
- CONST FARREN_DESC4_$ = "Love Street - Charlie Farren"
-
- CONST FARREN_PLAY5_$ = "LOVE.PLY"
- CONST FARREN_DESC5_$ = "Charlie Farren Quick Audition"
-
- '==== Song Station ====
-
- CONST SS_CYBERCAT_DIR_$ = "Cybercat\"
- CONST SS_SONGS_DIR_$ = "Songs\"
- CONST SS_SOUNDS_DIR_$ = "Sounds\"
-
- CONST SS_CATDISP_$ = "CATDISP.EXE"
- CONST SS_CATDISPX_$ = "Cakewalk Song Station"
-
- CONST SS_PLAY1_$ = "CAROLS\CAROLS.PLY"
- CONST SS_DESC1_$ = "Holiday Carols"
-
- CONST SS_PLAY2_$ = "WEDDING\WEDDING.PLY"
- CONST SS_DESC2_$ = "Wedding Songs"
-
- CONST SS_PLAY3_$ = "ANTHEMS\ANTHEMS.PLY"
- CONST SS_DESC3_$ = "National Anthems"
-
- CONST SS_PLAY4_$ = "FOLK\FOLK.PLY"
- CONST SS_DESC4_$ = "Folk Music"
-
- CONST SS_PLAY5_$ = "WORLD\WORLD.PLY"
- CONST SS_DESC5_$ = "World Music"
-
- CONST SS_PLAY6_$ = "DANCE\DANCE.PLY"
- CONST SS_DESC6_$ = "Dance Music"
-
- CONST SS_PLAY7_$ = "POP_JAZZ\POP_JAZZ.PLY"
- CONST SS_DESC7_$ = "Pop and Jazz"
-
- CONST SS_PLAY8_$ = "CLASSCAL\CLASSCAL.PLY"
- CONST SS_DESC8_$ = "Classical"
-
- CONST SS_PLAY9_$ = "JOPLIN\JOPLIN.PLY"
- CONST SS_DESC9_$ = "Ragtime"
-
- CONST SS_PLAY10_$ = "SCIFI\SCIFI.PLY"
- CONST SS_DESC10_$ = "Sci-Fi"
-
- CONST SS_PLAY11_$ = "ANIMAL\ANIMAL.PLY"
- CONST SS_DESC11_$ = "Animals"
-
- CONST SS_PLAY12_$ = "TRANSPRT\TRANSPRT.PLY"
- CONST SS_DESC12_$ = "Transportation"
-
- CONST SS_PLAY13_$ = "BACKGNDS\BACKGNDS.PLY"
- CONST SS_DESC13_$ = "Backgrounds"
-
- CONST SS_PLAY14_$ = "MISCSFX\MISCSFX.PLY"
- CONST SS_DESC14_$ = "Miscellaneous SFX"
-
- '======== end LOCALIZATION ========
-
- CUIDLL$ = "mscuistf.dll" 'Custom user interface dll
- HELPPROC$ = "FHelpDlgProc" 'Help dialog procedure
-
- 'Determine full SETUP.INF path+name (same name for all products).
- szInf$ = GetSymbolValue("STF_SRCINFPATH")
- IF szInf$ = "" THEN
- szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
- END IF
- ReadInfFile szInf$
-
- 'Determine which product we are by seeing which .EXE name reference key
- 'is defined. In DSKLAYT we specified a reference key for the .EXE which
- 'is the same as PROGNAME$. This key is also used for StampResource below.
- IF DoesIniKeyExist(szInf$, "Files", """CAKEAUD""") <> 0 THEN
- PROGNAME$ = "CAKEAUD"
- PRODUCTNAME$ = PRODUCTNAME_PA_$
- PROGMANGROUPNAME$ = PROGMANGROUPNAME_PA_$
- INIBASENAME$ = "WINCAKE" 'Yes, this is the same PRO (for now).
- DEST$ = "C:\CAKEAUD"
- ELSEIF DoesIniKeyExist(szInf$, "Files", """CAKEDEMO""") <> 0 THEN
- PROGNAME$ = "CAKEDEMO"
- PRODUCTNAME$ = PRODUCTNAME_AD_$
- PROGMANGROUPNAME$ = PROGMANGROUPNAME_PA_$
- INIBASENAME$ = "WINCAKE" 'Yes, this is the same PRO (for now).
- DEST$ = "C:\CAKEDEMO"
- ELSEIF DoesIniKeyExist(szInf$, "Files", """WINCAKE""") <> 0 THEN
- PROGNAME$ = "WINCAKE"
- PRODUCTNAME$ = PRODUCTNAME_PR_$
- PROGMANGROUPNAME$ = PROGMANGROUPNAME_PR_$
- INIBASENAME$ = "WINCAKE"
- DEST$ = "C:\CAKEPRO"
- ELSEIF DoesIniKeyExist(szInf$, "Files", """WCWDEMO""") <> 0 THEN
- PROGNAME$ = "WCWDEMO"
- PRODUCTNAME$ = PRODUCTNAME_PD_$
- PROGMANGROUPNAME$ = PROGMANGROUPNAME_PR_$
- INIBASENAME$ = "WINCAKE"
- DEST$ = "C:\WCWDEMO"
- ELSEIF DoesIniKeyExist(szInf$, "Files", """CAKEHS""") <> 0 THEN
- PROGNAME$ = "CAKEHS"
- PRODUCTNAME$ = PRODUCTNAME_HS_$
- PROGMANGROUPNAME$ = PROGMANGROUPNAME_HS_$
- INIBASENAME$ = "CAKEHS"
- DEST$ = "C:\CAKEHS" 'normal
- ELSEIF DoesIniKeyExist(szInf$, "Files", """CHSDEMO""") <> 0 THEN
- PROGNAME$ = "CHSDEMO"
- PRODUCTNAME$ = PRODUCTNAME_HD_$
- PROGMANGROUPNAME$ = PROGMANGROUPNAME_HS_$
- INIBASENAME$ = "CAKEHS"
- DEST$ = "C:\CHSDEMO"
- ELSEIF DoesIniKeyExist(szInf$, "Files", """CAKEXP""") <> 0 THEN
- PROGNAME$ = "CAKEXP"
- PRODUCTNAME$ = PRODUCTNAME_XP_$
- PROGMANGROUPNAME$ = PROGMANGROUPNAME_XP_$
- INIBASENAME$ = "CAKEXP"
- DEST$ = "C:\CAKEXP" 'normal
- ELSEIF DoesIniKeyExist(szInf$, "Files", """CAKEXPD""") <> 0 THEN
- PROGNAME$ = "CAKEXPD"
- PRODUCTNAME$ = PRODUCTNAME_XD_$
- PROGMANGROUPNAME$ = PROGMANGROUPNAME_XP_$
- INIBASENAME$ = "CAKEXP"
- DEST$ = "C:\CAKEXPD"
- ELSEIF DoesIniKeyExist(szInf$, "Files", """CAKESS""") <> 0 THEN
- PROGNAME$ = "CAKEXP"
- PRODUCTNAME$ = PRODUCTNAME_SS_$
- PROGMANGROUPNAME$ = PROGMANGROUPNAME_SS_$
- INIBASENAME$ = "CAKEXP"
- DEST$ = "C:\CAKEXP" 'normal
- ELSE
- GOTO ERRQUIT
- END IF
-
- SetBitmap CUIDLL$, LOGO
- SetTitle ArgStr$(SetTitleFmt_$, PRODUCTNAME$, SETUP_$, "", "")
-
- 'Check Windows version.
- winVerReqd$ = "3.1"
- winVer$ = LTRIM$( STR$( GetWindowsMajorVersion() ) ) + "." + LTRIM$( STR$( GetWindowsMinorVersion() ) )
- IF winVer$ < winVerReqd$ THEN 'string sort works
- i% = DoMsgBox( ArgStr$(winVerFmt_$, winVer$, PRODUCTNAME$, winVerReqd$, ""), setupMessage_$, MB_OK+MB_TASKMODAL+MB_ICONHAND )
- END 'exit SETUP
- END IF
-
- 'Check CPU.
- cpu% = GetProcessorType() '2==80286, 3==80386, 4==80486
- IF cpu% < 3 THEN
- i% = DoMsgBox( ArgStr$(cpuFmt_$, PRODUCTNAME$, "", "", ""), setupMessage_$, MB_OK+MB_TASKMODAL+MB_ICONSTOP )
- END 'exit SETUP
- END IF
-
- 'Check for mouse.
- IF HasMouseInstalled() = 0 THEN
- i% = DoMsgBox( ArgStr$(mouseFmt_$, PRODUCTNAME$, "", "", ""), setupMessage_$, MB_OK+MB_TASKMODAL+MB_ICONINFORMATION )
- END IF
-
- 'Disk cost list symbols.
- FILECOSTS$ = "FileCosts"
- EXTRACOSTS$ = "ExtraCosts"
- STILLNEEDED$ = "StillNeeded"
- FOR i% = 1 TO 26 STEP 1
- AddListItem EXTRACOSTS$, "0"
- NEXT i%
- 'Add extra cost to Windows drive for ini/progman, etc.
- ixWinDrive% = ASC(UCASE$( MID$(GetWindowsDir(), 1, 1) )) - ASC("A") + 1
- ReplaceListItem EXTRACOSTS$, ixWinDrive%, "10240"
-
-
- WELCOME:
- IF PRODUCTNAME$ = PRODUCTNAME_SS_$ THEN
- dlg% = WELCOME_SS
- dlghelp% = APPHELP_SS
- ELSEIF PROGNAME$ = "CAKEAUD" THEN
- dlg% = WELCOME_PA
- dlghelp% = APPHELP_PA
- ELSEIF PROGNAME$ = "CAKEDEMO" THEN
- dlg% = WELCOME_AD
- dlghelp% = APPHELP_AD
- ELSEIF PROGNAME$ = "WINCAKE" THEN
- dlg% = WELCOME_PR
- dlghelp% = APPHELP_PR
- ELSEIF PROGNAME$ = "WCWDEMO" THEN
- dlg% = WELCOME_PD
- dlghelp% = APPHELP_PD
- ELSEIF PROGNAME$ = "CAKEHS" THEN
- dlg% = WELCOME_HS
- dlghelp% = APPHELP_HS
- ELSEIF PROGNAME$ = "CHSDEMO" THEN
- dlg% = WELCOME_HD
- dlghelp% = APPHELP_HD
- ELSEIF PROGNAME$ = "CAKEXP" THEN
- dlg% = WELCOME_XP
- dlghelp% = APPHELP_XP
- ELSEIF PROGNAME$ = "CAKEXPD" THEN
- dlg% = WELCOME_XD
- dlghelp% = APPHELP_XD
- END IF
- sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfoDlgProc", dlghelp%, HELPPROC$)
- IF sz$ = "CONTINUE" THEN
- UIPop 1
- ELSE
- GOSUB ASKQUIT
- GOTO WELCOME
- END IF
-
-
- GETPATH:
- SetSymbolValue "EditTextIn", DEST$
- SetSymbolValue "EditFocus", "END"
- GETPATHL1:
- sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", dlghelp%, HELPPROC$)
- DEST$ = GetSymbolValue("EditTextOut")
-
- IF sz$ = "CONTINUE" THEN
- IF IsDirWritable(DEST$) = 0 THEN
- GOSUB BADPATH
- GOTO GETPATHL1
- END IF
- UIPop 1
- ixAppDrive% = ASC(UCASE$( MID$(DEST$, 1, 1) )) - ASC(driveBase_$) + 1
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO GETPATHL1
- ELSEIF sz$ = "BACK" THEN
- UIPop 1
- GOTO WELCOME
- ELSE
- GOSUB ASKQUIT
- GOTO GETPATH
- END IF
-
- 'Install.
- GOSUB INSTALL
- IF StillNeed& > 0 THEN
- GOTO GETPATH
- END IF
-
- QUIT:
- ON ERROR GOTO ERRQUIT
-
- IF ERR = 0 THEN
- IF PRODUCTNAME$ = PRODUCTNAME_SS_$ THEN
- dlg% = EXITSUCCESS_SS
- ELSEIF PROGNAME$ = "CAKEAUD" THEN
- dlg% = EXITSUCCESS_PA
- ELSEIF PROGNAME$ = "CAKEDEMO" THEN
- dlg% = EXITSUCCESS_AD
- ELSEIF PROGNAME$ = "WINCAKE" THEN
- dlg% = EXITSUCCESS_PR
- ELSEIF PROGNAME$ = "WCWDEMO" THEN
- dlg% = EXITSUCCESS_PD
- ELSEIF PROGNAME$ = "CAKEHS" THEN
- dlg% = EXITSUCCESS_HS
- ELSEIF PROGNAME$ = "CHSDEMO" THEN
- dlg% = EXITSUCCESS_HD
- ELSEIF PROGNAME$ = "CAKEXP" THEN
- dlg% = EXITSUCCESS_XP
- ELSEIF PROGNAME$ = "CAKEXPD" THEN
- dlg% = EXITSUCCESS_XD
- END IF
- ELSEIF ERR = STFQUIT THEN
- IF PRODUCTNAME$ = PRODUCTNAME_SS_$ THEN
- dlg% = EXITQUIT_SS
- ELSEIF PROGNAME$ = "CAKEAUD" THEN
- dlg% = EXITQUIT_PA
- ELSEIF PROGNAME$ = "CAKEDEMO" THEN
- dlg% = EXITQUIT_AD
- ELSEIF PROGNAME$ = "WINCAKE" THEN
- dlg% = EXITQUIT_PR
- ELSEIF PROGNAME$ = "WCWDEMO" THEN
- dlg% = EXITQUIT_PD
- ELSEIF PROGNAME$ = "CAKEHS" THEN
- dlg% = EXITQUIT_HS
- ELSEIF PROGNAME$ = "CHSDEMO" THEN
- dlg% = EXITQUIT_HD
- ELSEIF PROGNAME$ = "CAKEXP" THEN
- dlg% = EXITQUIT_XP
- ELSEIF PROGNAME$ = "CAKEXPD" THEN
- dlg% = EXITQUIT_XD
- END IF
- ELSE
- dlg% = EXITFAILURE
- END IF
- QUITL1:
- sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO QUITL1
- END IF
- UIPop 1
-
- END
-
- ERRQUIT:
- i% = DoMsgBox(ArgStr$(errQuitFmt_$, COMPANY_$, "", "", ""), setupMessage_$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
- END
-
-
-
- BADPATH:
- sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO BADPATH
- END IF
- UIPop 1
- RETURN
-
-
-
- ASKQUIT:
- sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
-
- IF sz$ = "EXIT" THEN
- UIPopAll
- ERROR STFQUIT
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO ASKQUIT
- ELSE
- UIPop 1
- END IF
- RETURN
-
-
-
- '**
- '** Purpose:
- '** Builds the copy list and performs all installation operations.
- '** Arguments:
- '** none.
- '** Returns:
- '** none.
- '*************************************************************************
- INSTALL:
-
- 'Get user information; we'll stamp later.
- GOSUB DOUSERINFODIALOG
-
- SrcDir$ = GetSymbolValue("STF_SRCDIR")
-
- 'These (normal) files go to the user's specifed app destination directory.
- AddSectionFilesToCopyList "Files", SrcDir$, DEST$
-
- 'These files go to the Windows System directory.
- AddSectionFilesToCopyList "system", SrcDir$, GetWindowsSysDir()
-
- StillNeed& = GetCopyListCost(EXTRACOSTS$, FILECOSTS$, STILLNEEDED$)
- IF StillNeed& > 0 THEN
- ClearCopyList
- FOR ix% = 1 TO 26 STEP 1 'find first drive that needs space
- need1& = VAL(GetListItem(STILLNEEDED$, ix%))
- IF need1& > 0 THEN
- GOTO FNDDRV
- END IF
- NEXT ix%
- ix = ixAppDrive '(shouldn't happen)
- need1& = 0
- StillNeed& = 1
- FNDDRV:
- need$ = LTRIM$(STR$( (need1&+1023) / 1024 ))
- cost$ = LTRIM$(STR$( (VAL(GetListItem(FILECOSTS$, ix%))+1023) / 1024 ))
- drive$ = CHR$(ix% - 1 + ASC(driveBase_$))
- msg$ = ArgStr$(dskSpcFmt_$, PRODUCTNAME$, need$, cost$, drive$)
- i% = DoMsgBox(msg$, setupProblem_$, MB_RETRYCANCEL+MB_TASKMODAL+MB_ICONHAND)
- IF i% = IDCANCEL THEN
- GOSUB ASKQUIT
- END IF
- RETURN 'must RETURN out of GOSUB to pop stack, not just GOTO
- END IF
-
- CreateDir DEST$, cmoNone
-
- OpenLogFile MakePath(DEST$, "LOGFILE.OUT"), 0
- WriteToLogFile ""
- WriteToLogFile "User chose as destination directory: '" + DEST$ + "'"
- WriteToLogFile "May have had to create the directory: " + DEST$
- WriteToLogFile ""
-
- CopyFilesInCopyList
-
- 'Important: Do this here before any dialogs with an Exit button, so
- 'user cannot avoid stamping.
- GOSUB STAMPUSERINFO
-
- SetRegKeyValue PROGNAME$, PRODUCTNAME$
- SetRegKeyValue PROGNAME$+"\shell\print", ""
- SetRegKeyValue PROGNAME$+"\shell\open\command", MakePath(DEST$,PROGNAME$+".EXE") + " %1"
-
- MaybeAssociate "wrk"
- MaybeAssociate "mid"
- MaybeAssociate "mff"
- MaybeAssociate "tpl"
- MaybeAssociate "bun"
-
- SetRegKeyValue PROGNAME_VJB_$, PRODUCTNAME_VJB_$
- SetRegKeyValue PROGNAME_VJB_$+"\shell\print", ""
- SetRegKeyValue PROGNAME_VJB_$+"\shell\open\command", MakePath(DEST$,PROGNAME_VJB_$+".EXE") + " %1"
-
- MaybeAssociateVJB "ply"
-
- 'IF PROGNAME$ = "CAKEAUD" THEN
- 'MaybeAssociateVJB "set"
- 'ELSEIF PROGNAME$ = "WINCAKE" THEN
- 'MaybeAssociateVJB "set"
-
- IF PROGNAME$ = "CAKEHS" THEN
- MaybeAssociateVJB "set"
- ELSEIF PROGNAME$ = "CAKEXP" THEN
- MaybeAssociateVJB "set"
- END IF
-
- 'Deal with old installation where our app DLL's were in WINDOWS\SYSTEM.
- 'No more need to delete old DLL's, since we don't use any with same name now.
- 'If old TTSSEQ.INI exists in sysdir but not in appdir, copy it now to preserve settings.
- SysDir$ = GetWindowsSysDir()
- IF DoesFileExist(SysDir$+"TTSSEQ.INI",femExists) <> 0 AND DoesFileExist(DEST$+"TTSSEQ.INI",femExists) = 0 THEN
- CopyFile SysDir$+"TTSSEQ.INI", DEST$+"\TTSSEQ.INI", cmoNone, 0
- END IF
-
- 'If this product includes sysx input support, then it includes DRM.INI, which
- 'is the base version of progname.INI containing just the DRM's.
- 'So if this product includes DRM.INI, then copy it to progname.INI, except if
- 'progname.INI already exists, in which case we inform the user that we didn't
- 'overwrite it and he might want to look for new DRM's in DRM.INI.
- drm$ = MakePath(DEST$, "DRM.INI")
- ini$ = MakePath(DEST$, INIBASENAME$+".INI")
- IF DoesFileExist(drm$,femExists) <> 0 THEN 'if this product includes DRM.INI
- IF DoesFileExist(ini$,femExists) = 0 THEN
- CopyFile drm$, ini$, cmoVital, 0
- ELSE
- sz$ = UIStartDlg(CUIDLL$, INI_NOT_OVERWRITTEN, "FInfoDlgProc", 0, "")
- IF sz$ = "EXIT" THEN
- GOSUB ASKQUIT
- ELSE
- UIPop 1
- END IF
- END IF
- END IF
-
- 'SRC.INS (complete .INS) was copied over with no name change.
- 'DEFAULT.INS (basic default .INS) will be copied to MASTER.INS, which is
- 'what the program actually uses, but only if it doesn't already exist.
- default$ = MakePath(DEST$, "DEFAULT.INS")
- master$ = MakePath(DEST$, "MASTER.INS")
- IF DoesFileExist(master$,femExists) = 0 THEN
- CopyFile default$, master$, cmoVital, 0
- ELSE
- sz$ = UIStartDlg(CUIDLL$, INS_NOT_OVERWRITTEN, "FInfoDlgProc", 0, "")
- IF sz$ = "EXIT" THEN
- GOSUB ASKQUIT
- ELSE
- UIPop 1
- END IF
- END IF
-
- 'If this product includes chord library support, then it includes CHORDNEW.LIW,
- 'which is the base version of the chord library. The program uses CHORDS.LIW.
- 'So if this product includes CHORDNEW.LIW, then copy it to CHORDS.LIW, except if
- 'CHORDS.LIW already exists, in which case we inform the user that we didn't
- 'overwrite it and he might want to import the new chords from CHORDNEW.LIW.
- new$ = MakePath(DEST$, "CHORDNEW.LIW")
- use$ = MakePath(DEST$, "CHORDS.LIW")
- IF DoesFileExist(new$,femExists) <> 0 THEN 'if this product includes CHORDSNEW.LIW
- IF DoesFileExist(use$,femExists) = 0 THEN
- CopyFile new$, use$, cmoVital, 0
- ELSE
- sz$ = UIStartDlg(CUIDLL$, CHORDS_NOT_OVERWRITTEN, "FInfoDlgProc", 0, "")
- IF sz$ = "EXIT" THEN
- GOSUB ASKQUIT
- ELSE
- UIPop 1
- END IF
- END IF
- END IF
-
- CreateProgmanGroup PROGMANGROUPNAME$, "", cmoNone
- ShowProgmanGroup PROGMANGROUPNAME$, 1, cmoNone
-
- '==== Take care of special case Song Station. ====
-
- IF PRODUCTNAME$ = PRODUCTNAME_SS_$ THEN
- szPath$ = MID$( GetSymbolValue("STF_SRCDIR"), 1, 1 ) + ":\"
- IF DoesFileExist( MakePath( szPath$, SS_CYBERCAT_DIR_$+SS_CATDISP_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, SS_CATDISPX_$, MakePath( szPath$, SS_CYBERCAT_DIR_$+SS_CATDISP_$ ), "", cmoOverwrite
- END IF
- CreateProgmanItem PROGMANGROUPNAME$, PRODUCTNAME_XP_$, MakePath(DEST$,PROGNAME$+".EXE"), "", cmoOverwrite
- ELSE
- CreateProgmanItem PROGMANGROUPNAME$, PRODUCTNAME$, MakePath(DEST$,PROGNAME$+".EXE"), "", cmoOverwrite
- END IF
-
- '==== Riff Funk ====
-
- IF DoesFileExist( MakePath(DEST$,"RIFFUNK.BUN"), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, RIFFUNK_DEMO$, MakePath(DEST$,PROGNAME$+" RIFFUNK.BUN" ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath(DEST$,"RIFFUNKX.BUN"), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, RIFFUNK_DEMO$, MakePath(DEST$,PROGNAME$+" RIFFUNKX.BUN" ), "", cmoOverwrite
- END IF
-
- '==== Virtual Jukebox ====
-
- CreateProgmanItem PROGMANGROUPNAME$, PRODUCTNAME_VJB_$, MakePath(DEST$,"VJB.EXE"), "", cmoOverwrite
- CreateProgmanItem PROGMANGROUPNAME$, PRODUCTNAME_VJB_DEMO$, MakePath(DEST$,"VJB DEMO.PLY"), "", cmoOverwrite
-
- WriteToLogFile ""
-
- '==== Virtual Piano ====
-
- GOSUB INSTALL_VPIANO
-
- '==== README ====
-
- CreateProgmanItem PROGMANGROUPNAME$, "README.WRI", "write.exe "+MakePath(DEST$,"README.WRI"), "", cmoOverwrite
-
- '==== Install ICONS for Song Station or CD-ROM Edition icons. ====
-
- IF PRODUCTNAME$ = PRODUCTNAME_SS_$ THEN
- GOSUB INSTALL_SS_ICONS
- ELSE
- GOSUB MAYBE_CDROM
- END IF
-
- WriteToLogFile "SUB Install completed."
- CloseLogFile
-
- RETURN
-
- '**
- '** Purpose:
- '** Install a file without replacing an existing one.
- '** Arguments:
- '** szShort$ - Name like SRC.INS
- '** szLong$ - Name like MASTER.INS
- '*************************************************************************
- SUB SafeCopy (szShort$, szLong$) STATIC
- szShortPathName$ = MakePath(DEST$, szShort$)
- szLongPathName$ = MakePath(DEST$, szLong$)
- IF DoesFileExist(szLongPathName$,femExists) = 0 THEN
- CopyFile szShortPathName$, szLongPathName$, cmoVital, 0
- END IF
- END SUB
-
-
-
- '**
- '** Purpose:
- '** Appends a file name to the end of a directory path,
- '** inserting a backslash character as needed.
- '** Arguments:
- '** szDir$ - full directory path (with optional ending "\")
- '** szFile$ - filename to append to directory
- '** Returns:
- '** Resulting fully qualified path name.
- '*************************************************************************
- FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
- IF szDir$ = "" THEN
- MakePath = szFile$
- ELSEIF szFile$ = "" THEN
- MakePath = szDir$
- ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
- MakePath = szDir$ + szFile$
- ELSE
- MakePath = szDir$ + "\" + szFile$
- END IF
- END FUNCTION
-
-
-
- '**
- '** Purpose:
- '** Arguments:
- '** Returns:
- '** none.
- '*************************************************************************
- DOUSERINFODIALOG:
- 'Get user info for stamping later.
- IF PROGNAME$ <> "CAKEDEMO" AND PROGNAME$ <> "WCWDEMO" AND PROGNAME$ <> "CHSDEMO" AND PROGNAME$ <> "CAKEXPD" THEN
- GETUSERINFO:
- sz$ = UIStartDlg(CUIDLL$, USERINFO, "FNameOrgDlgProc", dlghelp%, HELPPROC$)
- IF sz$ = "REACTIVATE" THEN
- GOTO GETUSERINFO
- END IF
-
- szUser$ = GetSymbolValue( "NameOut" )
- szCo$ = GetSymbolValue( "OrgOut" )
-
- 'Company may be blank, but not the other two.
- IF szUser$ = "" THEN
- i% = DoMsgBox(userInfoNeedName_$, setupProblem_$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
- GOTO GETUSERINFO
- END IF
-
- 'Dismiss dialog now that we've validated.
- UIPop 1
- END IF
-
- RETURN
-
-
- '**
- '** Purpose:
- '** Arguments:
- '** Returns:
- '** none.
- '*************************************************************************
- STAMPUSERINFO:
- 'Stamp user info into our .EXE file.
- IF PROGNAME$ <> "CAKEDEMO" AND PROGNAME$ <> "WCWDEMO" AND PROGNAME$ <> "CHSDEMO" AND PROGNAME$ <> "CAKEXPD" THEN
-
- 'szUser$ szCo$ were prompted for above.
-
- szDat$ = CHR$(LEN(szUser$)) + szUser$
- szDat$ = szDat$ + CHR$(LEN(szCo$)) + szCo$
-
- '"Files" is the section name in our .INF file of the .EXE file.
- '
- '6 is the resource type for STRINGTABLE entries.
- '
- '&H401 is the upper 12 bits of IDS_USERNAME (0x4000) + 1.
- '
- 'In DSKLAYT we specified a reference key for the .EXE which
- 'is the same as PROGNAME$.
- 'The ONLY exception is SONG STATION.
-
- IF PRODUCTNAME$ = PRODUCTNAME_SS_$ THEN
- StampResource "Files","CAKESS",DEST$,6,&H401,szDat$,LEN(szDat$)
- ELSE
- StampResource "Files",PROGNAME$,DEST$,6,&H401,szDat$,LEN(szDat$)
- ENDIF
- END IF
-
- RETURN
-
-
- '**
- '** Purpose:
- '** Associates given filetype with us, but asks for user confirmation
- '** if already set to something else.
- '** Arguments:
- '** szExt$ - filetype extension, e.g. "mid"
- '** Returns:
- '** none.
- '*************************************************************************
- SUB MaybeAssociate (szExt$) STATIC
- oldProg$ = ""
- ok% = IDYES
-
- 'Check Registration Database (overrides WIN.INI [Extensions]).
-
- oldCmd$ = UCASE$( LTRIM$( GetRegKeyValue("."+szExt$+"\shell\open\command") ) )
- IF oldCmd$ = "" THEN 'didn't find direct association, check via prog name
- oldProg$ = LTRIM$( RTRIM$( GetRegKeyValue("."+szExt$) ) )
- IF oldProg$ <> "" THEN
- oldCmd$ = UCASE$( LTRIM$( GetRegKeyValue(oldProg$+"\shell\open\command") ) )
- oldProduct$ = LTRIM$( RTRIM$( GetRegKeyValue(oldProg$) ) )
- IF oldProduct$ <> "" THEN 'long product name found, use it
- oldProg$ = oldProduct$
- END IF
- END IF
- END IF
- IF oldCmd$ <> "" THEN
- IF INSTR(oldCmd$, PROGNAME$+".EXE") = 0 THEN 'not us, must confirm
- IF oldProg$ = "" THEN 'no short or long name, parse command string
- j% = INSTR(oldCmd$, " ")
- IF j% > 1 THEN
- oldProg$ = MID$(oldCmd$, 1, j%-1)
- ELSE
- oldProg$ = oldCmd$
- END IF
- END IF
- ELSE 'it's us, clear oldProg$ => no confirm
- oldProg$ = ""
- END IF
- GOTO MAYBE_CONFIRM 'found association, no need to examine WIN.INI
- END IF
-
- 'Check WIN.INI [Extensions].
-
- oldCmd$ = UCASE$( LTRIM$( GetIniKeyString("WIN.INI","Extensions",szExt$) ) )
- IF oldCmd$ <> "" THEN
- IF INSTR(oldCmd$, PROGNAME$+".EXE") = 0 THEN 'not us, must confirm
- j% = INSTR(oldCmd$, " ")
- IF j% > 1 THEN
- oldProg$ = MID$(oldCmd$, 1, j%-1)
- ELSE
- oldProg$ = oldCmd$
- END IF
- END IF
- END IF
-
- 'Get user confirmation if necessary, and do the association if ok.
-
- MAYBE_CONFIRM:
- IF oldProg$ <> "" THEN
- ok% = DoMsgBox(ArgStr$(assocConfirmFmt_$, UCASE$(szExt$), oldProg$, PRODUCTNAME$, ""), setupQuestion_$, MB_YESNO+MB_TASKMODAL+MB_ICONQUESTION)
- END IF
-
- IF ok% = IDYES THEN
- DeleteRegKey "."+szExt$ 'delete all keys for any old direct association
- SetRegKeyValue "."+szExt$, PROGNAME$
- CreateIniKeyValue "WIN.INI", "Extensions", szExt$, MakePath(DEST$,PROGNAME$+".EXE") + " ^." + szExt$, cmoOverwrite
- END IF
-
- END SUB
-
- '**
- '** Purpose:
- '** VIRTUAL JUKEBOX
- '** Associates given filetype with us, but asks for user confirmation
- '** if already set to something else.
- '** Arguments:
- '** szExt$ - filetype extension, e.g. "ply" or "set"
- '** Returns:
- '** none.
- '*************************************************************************
- SUB MaybeAssociateVJB (szExt$) STATIC
- oldProg$ = ""
- ok% = IDYES
-
- 'Check Registration Database (overrides WIN.INI [Extensions]).
-
- oldCmd$ = UCASE$( LTRIM$( GetRegKeyValue("."+szExt$+"\shell\open\command") ) )
- IF oldCmd$ = "" THEN 'didn't find direct association, check via prog name
- oldProg$ = LTRIM$( RTRIM$( GetRegKeyValue("."+szExt$) ) )
- IF oldProg$ <> "" THEN
- oldCmd$ = UCASE$( LTRIM$( GetRegKeyValue(oldProg$+"\shell\open\command") ) )
- oldProduct$ = LTRIM$( RTRIM$( GetRegKeyValue(oldProg$) ) )
- IF oldProduct$ <> "" THEN 'long product name found, use it
- oldProg$ = oldProduct$
- END IF
- END IF
- END IF
- IF oldCmd$ <> "" THEN
- IF INSTR(oldCmd$, PROGNAME_VJB_$+".EXE") = 0 THEN 'not us, must confirm
- IF oldProg$ = "" THEN 'no short or long name, parse command string
- j% = INSTR(oldCmd$, " ")
- IF j% > 1 THEN
- oldProg$ = MID$(oldCmd$, 1, j%-1)
- ELSE
- oldProg$ = oldCmd$
- END IF
- END IF
- ELSE 'it's us, clear oldProg$ => no confirm
- oldProg$ = ""
- END IF
- GOTO MAYBE_CONFIRM 'found association, no need to examine WIN.INI
- END IF
-
- 'Check WIN.INI [Extensions].
-
- oldCmd$ = UCASE$( LTRIM$( GetIniKeyString("WIN.INI","Extensions",szExt$) ) )
- IF oldCmd$ <> "" THEN
- IF INSTR(oldCmd$, PROGNAME_VJB_$+".EXE") = 0 THEN 'not us, must confirm
- j% = INSTR(oldCmd$, " ")
- IF j% > 1 THEN
- oldProg$ = MID$(oldCmd$, 1, j%-1)
- ELSE
- oldProg$ = oldCmd$
- END IF
- END IF
- END IF
-
- 'Get user confirmation if necessary, and do the association if ok.
-
- MAYBE_CONFIRM:
- IF oldProg$ <> "" THEN
- ok% = DoMsgBox(ArgStr$(assocConfirmFmt_$, UCASE$(szExt$), oldProg$, PRODUCTNAME_VJB_$, ""), setupQuestion_$, MB_YESNO+MB_TASKMODAL+MB_ICONQUESTION)
- END IF
-
- IF ok% = IDYES THEN
- DeleteRegKey "."+szExt$ 'delete all keys for any old direct association
- SetRegKeyValue "."+szExt$, PROGNAME_VJB_$
- CreateIniKeyValue "WIN.INI", "Extensions", szExt$, MakePath(DEST$,PROGNAME_VJB_$+".EXE") + " ^." + szExt$, cmoOverwrite
- END IF
-
- END SUB
-
- '**
- '** Purpose:
- '** Installs Virtual Piano and its driver, if part of this product.
- '** Arguments:
- '** none.
- '** Returns:
- '** none.
- '*************************************************************************
- INSTALL_VPIANO:
-
- 'If this product doesn't include the Virtual Piano, return now.
- '(Currently all products include it.)
-
- 'Set up the Virtual Piano program icon.
-
- CreateProgmanItem PROGMANGROUPNAME$, PRODUCTNAME_VP_$, MakePath(DEST$,"VPIANO.EXE"), "", cmoOverwrite
-
- 'Display message that it was installed and Windows should be restarted.
-
- i% = DoMsgBox( ArgStr$(instMustRestartWinFmt_$, PRODUCTNAME_VP_$, "", "", ""), setupMessage_$, MB_OK+MB_TASKMODAL+MB_ICONINFORMATION )
-
- 'If there's already a SYSTEM.INI [drivers] MIDIn key set to us, we're done.
- 'Else find next available SYSTEM.INI [drivers] MIDIn key.
-
- szSysIni$ = GetWindowsDir()+"SYSTEM.INI"
- szSect$ = "drivers"
- szValue$ = "vpiano.drv"
- szKey$ = "MIDI99"
-
- FOR i% = 0 TO 98 STEP 1
- IF i% = 0 THEN
- szKeyThis$ = "MIDI"
- ELSE
- szKeyThis$ = "MIDI" + LTRIM$( STR$(i%) )
- END IF
-
- szOldValue$ = LCASE$( GetIniKeyString(szSysIni$,szSect$,szKeyThis$) )
- IF szOldValue$ = szValue$ THEN
- RETURN 'already set, we're done
- ELSEIF szOldValue$ = "" AND szKey$ = "MIDI99" THEN
- szKey$ = szKeyThis$ 'found next key, remember it
- END IF
- NEXT i%
-
- 'Found next available SYSTEM.INI [drivers] MIDIn key. Set it to point to us.
-
- CreateIniKeyValue szSysIni$, szSect$, szKey$, szValue$, cmoNone
-
- RETURN
-
-
-
- '**
- '** Purpose:
- '** Give user option of running Wave Profiler.
- '** Arguments:
- '** none.
- '** Returns:
- '** none.
- '*************************************************************************
- REMIND_RUN_WAVE_PROFILER:
-
- 'If this product doesn't include Wave Profiler, return now.
- '(Currently just Pro Audio includes it.)
-
- i% = DoMsgBox( runWaveProfilerMsg_$, runWaveProfilerCaption_$, MB_OK+MB_TASKMODAL+MB_ICONINFORMATION )
- RETURN
-
-
- '**
- '** Purpose:
- '** Substitutes string args by number into a format string.
- '** Useful for localization, since arg order is now controlled by Fmt$.
- '** The backslash is used as an escape char.
- '** A backslash followed by a digit string substitutes that arg num.
- '** A backslash not followed by digits subs in the next literal char.
- '** Arguments:
- '** Fmt$ - format string containing instances of \N, N is arg num
- '** ArgN$ - string arg to sub in for each instance of \N
- '** Returns:
- '** Final output string with all arg substitution done.
- '** Example:
- '** Fmt$ = "\\1 = \1, \\2 = \2, \\3 = \3, \\Z = \Z, \\11 = \11."
- '** Out$ = ArgStr$(Fmt$, "Arg1", "Arg2", "", "")
- '** REM ...This sets Out$ to "\1 = Arg1, \2 = Arg2, \3 = , \Z = Z, \11 = ."
- '*************************************************************************
- FUNCTION ArgStr$ (Fmt$, Arg1$, Arg2$, Arg3$, Arg4$) STATIC
-
- rtn$ = Fmt$ 'our returned output string is built here
- esc$ = "\" 'this is the esc char we use
- i% = 1 'current index into string
-
- WHILE 1
- i% = INSTR(i%, rtn$, esc$) 'loc of next esc char
- IF i% = 0 THEN
- EXIT WHILE 'no more esc chars, quit
- END IF
- j% = i% + 1
- WHILE j% <= LEN(rtn$) AND INSTR("0123456789", MID$(rtn$, j%, 1)) <> 0
- j% = j% + 1
- WEND 'i%+1 is start of number string, j% is end+1
- IF j% = i% + 1 THEN 'digit string empty, drop esc char and take next char as literal
- rtn$ = MID$(rtn$, 1, i% - 1) + MID$(rtn$, j%)
- i% = i% + 1 'next search pos in string
- ELSE 'digit string non-empty, read int and sub in arg
- num% = VAL(MID$(rtn$, i% + 1, j% - i% - 1))
- SELECT CASE num%
- CASE 1
- Arg$ = Arg1$
- CASE 2
- Arg$ = Arg2$
- CASE 3
- Arg$ = Arg3$
- CASE 4
- Arg$ = Arg4$
- CASE ELSE
- Arg$ = ""
- END SELECT
- rtn$ = MID$(rtn$, 1, i% - 1) + Arg$ + MID$(rtn$, j%)
- i% = i% + LEN(Arg$) 'next search pos in string
- END IF
- WEND
-
- ArgStr$ = rtn$
-
- END FUNCTION
-
-
- '**
- '** Purpose:
- '** Installs Techniques icons, if movie files exist.
- '** Arguments:
- '** none.
- '** Returns:
- '** none.
- '** WARNING:
- '** The current method used here only works with Windows 3.1!
- '*************************************************************************
- MAYBE_CDROM:
-
- 'Determine drive letter. Techniques is subdir off drive root.
-
- szPath$ = MID$( GetSymbolValue("STF_SRCDIR"), 1, 1 ) + ":\"
-
- IF DoesFileExist( MakePath( szPath$, TECH_DIR_$+STR_TECH1_EXE_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, STR_TECH1_DESC_$, MakePath( szPath$, TECH_DIR_$+STR_TECH1_EXE_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, TECH_DIR_$+STR_TECH2_EXE_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, STR_TECH2_DESC_$, MakePath( szPath$, TECH_DIR_$+STR_TECH2_EXE_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, TECH_DIR_$+STR_TECH3_EXE_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, STR_TECH3_DESC_$, MakePath( szPath$, TECH_DIR_$+STR_TECH3_EXE_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, TECH_DIR_$+STR_TECH4_EXE_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, STR_TECH4_DESC_$, MakePath( szPath$, TECH_DIR_$+STR_TECH4_EXE_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, TECH_DIR_$+STR_TECH5_EXE_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, STR_TECH5_DESC_$, MakePath( szPath$, TECH_DIR_$+STR_TECH5_EXE_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, TECH_DIR_$+STR_TECH6_EXE_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, STR_TECH6_DESC_$, MakePath( szPath$, TECH_DIR_$+STR_TECH6_EXE_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, TECH_DIR_$+STR_TECH7_EXE_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, STR_TECH7_DESC_$, MakePath( szPath$, TECH_DIR_$+STR_TECH7_EXE_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$+FARREN_DIR_$, FARREN_SONG1_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, FARREN_DESC1_$, MakePath(DEST$,PROGNAME$+" "+szPath$+FARREN_DIR_$+FARREN_SONG1_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$+FARREN_DIR_$, FARREN_SONG2_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, FARREN_DESC2_$, MakePath(DEST$,PROGNAME$+" "+szPath$+FARREN_DIR_$+FARREN_SONG2_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, FARREN_DIR_$+FARREN_PLAY3_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, FARREN_DESC3_$, MakePath( szPath$, FARREN_DIR_$+FARREN_PLAY3_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$+FARREN_DIR_$, FARREN_SONG4_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, FARREN_DESC4_$, MakePath(DEST$,PROGNAME$+" "+szPath$+FARREN_DIR_$+FARREN_SONG4_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, FARREN_DIR_$+FARREN_PLAY5_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, FARREN_DESC5_$, MakePath( szPath$, FARREN_DIR_$+FARREN_PLAY5_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$+DEMO_DIR_$, DEMO2_SONG_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, DEMO2_DESC_$, MakePath(DEST$,PROGNAME$+" "+szPath$+DEMO_DIR_$+DEMO2_SONG_$ ), "", cmoOverwrite
- END IF
-
- RETURN
-
- '**
- '** Purpose:
- '** Installs ICONS for SONG STATION
- '** Arguments:
- '** none.
- '** Returns:
- '** none.
- '** WARNING:
- '** The current method used here only works with Windows 3.1!
- '*************************************************************************
- INSTALL_SS_ICONS:
-
- 'Determine drive letter. Songs and Sounds are subdir off drive root.
-
- szPath$ = MID$( GetSymbolValue("STF_SRCDIR"), 1, 1 ) + ":\"
-
- IF DoesFileExist( MakePath( szPath$, TECH_DIR_$+STR_TECH1_EXE_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, STR_TECH1_DESC_$, MakePath( szPath$, TECH_DIR_$+STR_TECH1_EXE_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, TECH_DIR_$+STR_TECH2_EXE_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, STR_TECH2_DESC_$, MakePath( szPath$, TECH_DIR_$+STR_TECH2_EXE_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, SS_SONGS_DIR_$+SS_PLAY1_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, SS_DESC1_$, MakePath( szPath$, SS_SONGS_DIR_$+SS_PLAY1_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, SS_SONGS_DIR_$+SS_PLAY2_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, SS_DESC2_$, MakePath( szPath$, SS_SONGS_DIR_$+SS_PLAY2_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, SS_SONGS_DIR_$+SS_PLAY3_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, SS_DESC3_$, MakePath( szPath$, SS_SONGS_DIR_$+SS_PLAY3_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, SS_SONGS_DIR_$+SS_PLAY4_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, SS_DESC4_$, MakePath( szPath$, SS_SONGS_DIR_$+SS_PLAY4_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, SS_SONGS_DIR_$+SS_PLAY5_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, SS_DESC5_$, MakePath( szPath$, SS_SONGS_DIR_$+SS_PLAY5_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, SS_SONGS_DIR_$+SS_PLAY6_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, SS_DESC6_$, MakePath( szPath$, SS_SONGS_DIR_$+SS_PLAY6_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, SS_SONGS_DIR_$+SS_PLAY7_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, SS_DESC7_$, MakePath( szPath$, SS_SONGS_DIR_$+SS_PLAY7_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, SS_SONGS_DIR_$+SS_PLAY8_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, SS_DESC8_$, MakePath( szPath$, SS_SONGS_DIR_$+SS_PLAY8_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, SS_SONGS_DIR_$+SS_PLAY9_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, SS_DESC9_$, MakePath( szPath$, SS_SONGS_DIR_$+SS_PLAY9_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, SS_SOUNDS_DIR_$+SS_PLAY10_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, SS_DESC10_$, MakePath( szPath$, SS_SOUNDS_DIR_$+SS_PLAY10_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, SS_SOUNDS_DIR_$+SS_PLAY11_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, SS_DESC11_$, MakePath( szPath$, SS_SOUNDS_DIR_$+SS_PLAY11_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, SS_SOUNDS_DIR_$+SS_PLAY12_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, SS_DESC12_$, MakePath( szPath$, SS_SOUNDS_DIR_$+SS_PLAY12_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, SS_SOUNDS_DIR_$+SS_PLAY13_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, SS_DESC13_$, MakePath( szPath$, SS_SOUNDS_DIR_$+SS_PLAY13_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, SS_SOUNDS_DIR_$+SS_PLAY14_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, SS_DESC14_$, MakePath( szPath$, SS_SOUNDS_DIR_$+SS_PLAY14_$ ), "", cmoOverwrite
- END IF
-
- IF DoesFileExist( MakePath( szPath$, FARREN_DIR_$+FARREN_PLAY5_$ ), femExists ) THEN
- CreateProgmanItem PROGMANGROUPNAME$, FARREN_DESC5_$, MakePath( szPath$, FARREN_DIR_$+FARREN_PLAY5_$ ), "", cmoOverwrite
- END IF
-
- RETURN
-
-
-