home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD Direkt 1995 #1
/
Image.iso
/
cdd
/
winanw2
/
pcwin
/
install
/
pcwin.ms_
/
pcwin.ms
Wrap
Text File
|
1994-07-02
|
9KB
|
272 lines
'**************************************************************************
'* Personal Composer Setup
'**************************************************************************
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''Dialog ID's
CONST WELCOME = 100
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST OPTIONS = 800
CONST APPHELP = 900
CONST BADPATH = 6400
''Bitmap ID
CONST LOGO = 1
GLOBAL DEST$ ''Default destination directory.
GLOBAL OPTCUR$ ''Option selection from option dialog.
DECLARE SUB Install
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION AddFontResource lib "gdi.exe" (FontFileName$) AS INTEGER
'DECLARE FUNCTION DeleteItem dde "progman.exe" (ItemName$) AS INTEGER
DECLARE FUNCTION RemoveFontResource lib "gdi.exe" (FontFileName$) AS INTEGER
DECLARE FUNCTION CreateScalableFontResource lib "gdi.exe" (hidden%,resource$,fontfile$,path$) AS INTEGER
INIT:
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle "Personal Composer Setup"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "PCWIN.INF"
END IF
ReadInfFile szInf$
OPTCUR$ = "1"
DEST$ = "C:\PCWin"
'$IFDEF DEBUG
i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
WinDrive$ = MID$(GetWindowsDir, 1, 1)
IF IsDriveValid(WinDrive$) = 0 THEN
i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
GOTO QUIT
END IF
'$ENDIF ''DEBUG
GETPATH:
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
GETPATHL1:
sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
DEST$ = GetSymbolValue("EditTextOut")
IF sz$ = "CONTINUE" THEN
IF IsDirWritable(DEST$) = 0 THEN
GOSUB BADPATH
GOTO GETPATHL1
END IF
UIPop 1
ELSE
GOSUB ASKQUIT
GOTO GETPATH
END IF
Install
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = EXITSUCCESS
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
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("Setup sources were corrupted, call Support!", "Setup Message", 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.
'*************************************************************************
SUB Install STATIC
SrcDir$ = GetSymbolValue("STF_SRCDIR")
CreateDir DEST$, cmoNone
OpenLogFile MakePath(DEST$, "LOGFILE.OUT"), 0
WriteToLogFile ""
WriteToLogFile " User chose as destination directory: '" + DEST$ + "'"
WriteToLogFile " User chose option: '" + OPTCUR$ + "'"
WriteToLogFile ""
WriteToLogFile "May have had to create the directory: " + DEST$
WriteToLogFile ""
szShareDir$ = GetWindowsSysDir()
SetRestartDir szShareDir$
szVienna$ = szShareDir$+"pcvienna.ttf"
szStrum$ = szShareDir$+"pcstrum.ttf"
szMuse$ = szShareDir$+"pcmuse.ttf"
RemoveFile szVienna$, cmoForce
RemoveFile szStrum$, cmoForce
RemoveFile szMuse$, cmoForce
' gets error type mismatch, or parse error
rc% = RemoveFontResource("pcVienna.fot")
rc% = RemoveFontResource("pcStrum.fot")
rc% = RemoveFontResource("pcMuse.fot")
' the older font files are NOT being overwritten!
' In Dsklayt I have specified ALWAYS overwrite.
szVienna$ = szShareDir$+"pcvienna.fot"
szStrum$ = szShareDir$+"pcstrum.fot"
szMuse$ = szShareDir$+"pcmuse.fot"
RemoveFile szVienna$, cmoForce
RemoveFile szStrum$, cmoForce
RemoveFile szMuse$, cmoForce
AddSectionFilesToCopyList "Files", SrcDir$, DEST$
AddSectionFilesToCopyList "SysFiles", SrcDir$, szShareDir$
CopyFilesInCopyList
rc% = CreateScalableFontResource(0,szShareDir$+"pcvienna.fot","pcvienna.ttf", szShareDir$)
rc% = CreateScalableFontResource(0,szShareDir$+"pcstrum.fot","pcstrum.ttf", szShareDir$)
rc% = CreateScalableFontResource(0,szShareDir$+"pcmuse.fot","pcmuse.ttf", szShareDir$)
' rc% = CreateScalableFontResource(0,"d:\windows\system\pcvienna.fot","d:\windows\system\pcvienna.ttf", 0)
ini$ = MakePath(DEST$, "PCWin.INI")
CreateIniKeyValue "WIN.INI", "Personal Composer", "dir", DEST$, cmoOverwrite
CreateIniKeyValue ini$, "Personal Composer", "LogoCaption", "1" , cmoNone
CreateIniKeyValue ini$, "Personal Composer", "title", "black", cmoNone
CreateIniKeyValue ini$, "Personal Composer", "menu", "black", cmoNone
CreateIniKeyValue ini$, "Personal Composer", "button", "red", cmoNone
CreateIniKeyValue ini$, "Personal Composer", "pageicon", "sky", cmoNone
CreateIniKeyValue ini$, "Personal Composer", "pageiconnumber", "black", cmoNone
CreateIniKeyValue ini$, "Personal Composer", ";MaxMeasures", "1024" , cmoNone
CreateIniKeyValue ini$, "Personal Composer", ";MaxMeasuresPerSystem", "16" , cmoNone
CreateIniKeyValue ini$, "Personal Composer", ";MaxSystemsPerPage", "8" , cmoNone
CreateIniKeyValue ini$, "Personal Composer", ";MaxSlur", "1024" , cmoNone
' CreateIniKeyValue ini$, "Personal Composer", ";Bank0", "8" , cmoNone
' CreateIniKeyValue ini$, "Personal Composer", ";Bank1", "8" , cmoNone
' CreateIniKeyValue ini$, "Personal Composer", ";Bank2", "64" , cmoNone
' CreateIniKeyValue ini$, "Personal Composer", ";Bank3", "8" , cmoNone
' CreateIniKeyValue ini$, "Personal Composer", ";Bank4", "64" , cmoNone
' CreateIniKeyValue ini$, "Personal Composer", ";Bank5", "8" , cmoNone
' CreateIniKeyValue ini$, "Personal Composer", ";Bank6", "2" , cmoNone
' CreateIniKeyValue ini$, "Fonts", "MusicSymbolFontName", "Personal Vienna", cmoNone
' CreateIniKeyValue ini$, "Fonts", "SystemFontName", "Times New Roman", cmoNone
' WriteToLogFile "Removing Fonts"
CreateIniKeyValue "WIN.INI", "Fonts", "Personal Vienna (TrueType)", "PCVIENNA.FOT", cmoOverwrite
CreateIniKeyValue "WIN.INI", "Fonts", "Personal Strum (TrueType)", "PCSTRUM.FOT", cmoOverwrite
CreateIniKeyValue "WIN.INI", "Fonts", "Personal Muse (TrueType)", "PCMUSE.FOT", cmoOverwrite
rc% = AddFontResource("pcVienna.fot")
rc% = AddFontResource("pcStrum.fot")
rc% = AddFontResource("pcMuse.fot")
AddSectionFilesToCopyList "SampleFiles", SrcDir$, DEST$
CopyFilesInCopyList
CreateProgmanGroup "Personal Composer", "", cmoNone
ShowProgmanGroup "Personal Composer", 1, cmoNone
CreateProgmanItem "Personal Composer", "Personal Composer", MakePath(DEST$,"pcwin.exe"), "", cmoOverwrite
CreateProgmanItem "Personal Composer", "Version 1 Release notes", "write.exe "+MakePath(DEST$,"readme.wri"), "", cmoOverwrite
' AddDos5Help "PCWSetup", "Any Problems with installation?"+chr$(10)+"Call (918) - 742-4292", cmoNone
' CloseLogFile
END SUB
'**
'** Purpose:
'** Appends a file name to the end of a directory path,
'** inserting a backslash character as needed.
'** Arguments:
'** s