home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dinosaurusten Jäljillä
/
CDRDINO.ISO
/
dksetup
/
dksetup.mst
< prev
next >
Wrap
Text File
|
1997-02-07
|
35KB
|
908 lines
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
' DKSETUP.MST Generic Setup File
'
' VERSION
' -------
CONST STR_VERSION = "V 2.10.010"
'
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'Change History
'--------------
'Version Date By Description
'------- ---- -- -----------
'2.10.011 07/02/97 Wyn Call to function IsFloppyDrive added . This was created because
' the Japanese NEC machines have A:\ as their internal hard drive24/10/96
'2.10.010 BJO Prevent users installing to a root directory. This causes problems
' when attempting to uninstall the product.
'2.10.009 02/04/96 CR Re-Organised the groups of system drivers. No longer installs VFW
' or the MSADPCM sound drivers on Windows 95.
'2.10.008 10/04/96 CR Stopped the user from being able to install to A:\.
' It caused a crash on Win95.
'2.10.007 03/04/96 CR Removed the path in the device=dva.386 entry which is
' put into system.ini. The Code is in UpdateWingDrivers in
' Dkgen.inc. This stops a crash when installing Windows followed by
' our product and then Office.
'2.10.006 22/03/96 CR Change the define WITH_SAMPLER_NOCM to WITH_FULL_SAMPLER.
' This now installs the full sampler into the \DKMM\SAMPLER dir.
'2.10.005 14/03/96 CR Hide the Program Group window while adding the program icons.
'2.10.004 27/02/96 CR Changed most of the define names to make them more consistent.
'2.10.003 27/02/96 CR Added the INST_QTW define for installing QuickTime for Windows.
'2.10.002 22/02/96 CR The Fonts section in setup.inf needs a dummy placeholder
' called NOFONT.ZZZ. Fonts are not registered for uninstall.
'2.10.001 20/02/96 CR Changed the setup files to separate Product Specific,
' Localise Only and Generic information.
'
'16/02/96 Made the cursor 'Busy' while creating the program group/items.
'14/02/96 Add the Sampler Icon name to the MMAPP.ini when using WITH_SAMPLER_NOCOM,
' so that uninstall can delete the Sampler Icon.
'12/02/96 Added option to bundle sampler WITHOUT the Custom Menu.
'25/01/96 Add WITH_ORDERING_INFO and MUSEUM_TITLE defines.
'22/01/96 Fix the dialogs in the TestSystem function in Dkgen.inc.
'15/12/95 Fix the Set Restart Directory problem when installing Win32s
'14/12/95 Only delete files from the previous install if it was in a
' different directory. Otherwise it deletes the files just installed!
'05/12/95 Reset the default install path when selecting back from the custom
' install dialog box and clear the copy list.
'04/12/95 Move the mmapp.ini entry updates after the install.
'31/11/95 Check the msacm.ini to make sure the audio compression is enabled.
'29/11/95 Add the line in DKCODE\VERSION.INI to the main ini file. This is only
' used by the sampler3 product at the moment.
'21/11/95 Can now handle a product + sampler3 bundle disc.
'13/11/95 Add the Setup Version number to the About dialog box in the Setup.
'08/11/95 Use the test for cirrus logic dirvers all of the time, not just
' when bundled with a sampler.
'03/11/95 Cater for Win32s install and general tidy up of this script file.
' Unfortunately still need to use comments to select / deselect
' the specific font code parts.
'18/08/95 rc and this have no min install. Changed dlg boxes custom,
' custom help and speed
'18/08/95 Register notes most recent lang used
'11/08/95 Register created using inf file
'26/07/95 Uninstall code added
'07/07/95 Correct dkgen.inc so unregisters use of ctl3d
'04/07/95 Make sure files in bin section of inf file 'always' overwrite
'28/07/95 Ini file not created for minimum install, uses file provided in dkcode
'27/06/95 Test for directory names max 8 chars
'26/06/95 For minimum install, ini file is now not installed
'19/06/95 Moved test for cirrus drivers to mst file as only applies to sampler
'05/06/95 Fonts installed on users machine
'01/06/95 No choice about adding icon to prog man, altered dkgen.inc & rc file
' (custom, customhelp & speed dlg boxes need changing)
'22/05/95 Code for bundling with sampler
'22/05/95 Large readme need Write (will need to change dlg box in rc file)
'15/05/95 No warning that directory does not exist
'03/05/95 Ini file put in executable directory rather than Windows dir to stop
' clash with foreign products with same name files
'
'------------------------------------------------------------------------------
'
' All of the defines which are used to control the flow of Setup are listed here.
'
' SCRUNGED Product will run in scrunge mode not test mode.
' The ini file is different.
' WITH_UNINSTALL Installs Uninstall with the product.
' WITH_ORDERING_INFO Installs Ordering Information with the product.
' WITH_SAMPLER Installs the Sampler with the product.
' This sampler goes into the product directory.
' This sampler has a Custom Menu.
' WITH_FULL_SAMPLER Installs the full Sampler with the product.
' This sampler goes into the sampler directory \DKMM\SAMPLER.
' This sampler has its own icon and can be uninstalled separately.
' The sampler files are listed in the SAMPBIN section of setup.inf.
' NEEDS_MUSEUM_LIFT Installs the museum lift. (DKSWTCH.EXE)
' NEEDS_WIN32S Installs Win32s.
' NEEDS_WING Installs WinG.
' NEEDS_QTW Installs QuickTime for Windows using Apple's own installer.
' NEEDS_VFW Installs Video for Windows.
' NEEDS_SOUND Installs ADPCM sound drivers.
'
'------------------------------------------------------------------------------
''$DEFINE DEBUG
'$INCLUDE 'dkgen.inc'
'
'$IFDEF NEEDS_WIN32S
' Include extra Win32s specific routines
'$INCLUDE 'win32s.inc'
'$ENDIF
DECLARE SUB CreateReg()
DECLARE SUB Install()
DECLARE SUB AddFilesToCopyList(szInstallType$)
DECLARE SUB UpdateFonts()
DECLARE FUNCTION IsCDROMDrive LIB "dkutils.dll" (wDrive%) As INTEGER
DECLARE FUNCTION DeleteFiles LIB "dkutils.dll" (szDiffPath$, szProdName$, szDKREgIni$) AS INTEGER
DECLARE FUNCTION DeleteDir LIB "dkutils.dll" (szDiffPath$) AS INTEGER
DECLARE FUNCTION DeleteSection LIB "dkutils.dll" (szProdName$, szDKREgIni$) AS INTEGER
DECLARE FUNCTION TestForCirrus LIB "dkutils.dll" () As INTEGER
DECLARE FUNCTION GetCdVolumeLabel LIB "dkutils.dll" ( szCdVolumeLabel$, szCdDrive$ ) As INTEGER
DECLARE FUNCTION InstallFont LIB "dkutils.dll" (szFont$) AS INTEGER
DECLARE FUNCTION IsFloppyDrive LIB "dkutils.dll" (wDrive%) As INTEGER
Init:
Initialise STR_PRODUCTNAME, DEFAULT_INSTALL_PATH, STR_MSGCAPTION
WelcomeDlg:
if Welcome() = NAV_BACK then
' Don nothing - cant go back
end if
if TestSystem() = NAV_BACK then
goto WelcomeDlg
end if
'+++
'$IFDEF NEEDS_WIN32S
if bInstalledWin32s = 0 then
goto InstallWin32s
endif
FinishedWin32s:
'$ENDIF
'---
'+++
'$IFDEF NEEDS_QTW
ret% = InstallQTW() ' Install QuickTime for Windows
'$ENDIF
'---
' TestCirrus:
if TestForCirrus() = 1 then
dButton = DoMsgBox(STR_CIRRUS, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
end if
'$IFDEF NEEDS_SOUND
' Update the Sound driver ini entries
if UpdateADPCMDrivers() = NAV_BACK then
goto WelcomeDlg
end if
'$ENDIF
ExpressCustomDlg:
' defaults to Express
'if szExpressCustomChoice = "EXPRESS" then
' SetSymbolValue "RadioDefault", "1"
'else
' SetSymbolValue "RadioDefault", "1"
'end if
ECDlgLoop:
szButton = UIStartDlg(CUIDLL_FILENAME, DLG_SPEED, "FRadioDlgProc", DLG_WHIZZHELP, PROC_HELP)
select case szButton
case "REACTIVATE"
goto ECDlgLoop
case "BACK"
UIPop 1
goto WelcomeDlg
case "CONTINUE" ' Install
UIPop 1
if GetSymbolValue("ButtonChecked") = "1" then
szExpressCustomChoice = "EXPRESS"
goto ExpressInstallLoop
else
szExpressCustomChoice = "CUSTOM"
goto CustomInstallLoop
end if
case "EXIT" , "CANCEL"
AskQuit
goto ECDlgLoop
end select
CustomInstallLoop:
GetPathDlg:
SetSymbolValue "EditTextIn", szDestPath
szOldDestPath = szWinDrive + ":" + DEFAULT_INSTALL_PATH
SetSymbolValue "EditFocus", "ALL"
GetPathDlgLoop:
szButton = UIStartDlg(CUIDLL_FILENAME, DLG_DESTPATH, "FEditDlgProc", DLG_PATHHELP, PROC_HELP)
select case szButton
case "REACTIVATE"
goto GetPathDlgLoop
case "BACK"
UIPop 1
szDestPath = szOldDestPath
ClearCopyList
goto ECDlgLoop
case "CONTINUE"
UIPop 1
szDestPath = GetSymbolValue("EditTextOut")
' Add backslash if missing
if mid$(szDestPath, 2, 1) = ":" and mid$(szDestPath, 3, 1) <> "\" then
szTemp$ = mid$(szDestPath, 1, 2) + "\" + mid$(szDestPath, 3, len(szDestPath)-2)
szDestPath = szTemp
end if
' Add drive letter and :\ if missing
if mid$(szDestPath, 2, 1) <> ":" then
if mid$(szDestPath, 1,1) <> "\" then
szDestPath = mid$(szWinPath, 1,1) + ":\" + szDestPath
else
szDestPath = mid$(szWinPath, 1,1) + ":" + szDestPath
end if
elseif IsDriveValid(mid$(szDestPath, 1,1)) = 0 then
szDestPath = szOldDestPath
UIPop 1
BadPath
goto GetPathDlg
end if
slength% = len(szDestPath)
'Check dir names not > 8 chars
dirlength% = 0
i% = 3
while i% <> slength%
i% =i%+1
dirlength% = dirlength% +1
if mid$(szDestPath, i%, 1)="\" then
if dirlength% > 9 then
szDestPath = szOldDestPath
dButton = DoMsgBox( STR_DIRTOOLONG, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
goto GetPathDlg
else
dirlength% = 0
endif
end if
wend
if dirlength% > 8 then
szDestPath = szOldDestPath
dButton = DoMsgBox( STR_DIRTOOLONG, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
goto GetPathDlg
endif
' check for "foreign" chars in path
found% = 0
for i% = 1 to slength%
if asc(mid$(szDestPath, i%, 1)) > 126 then
found% = 1
end if
next i%
if found% = 1 then
szDestPath = szOldDestPath
UIPop 1
BadPath
goto GetPathDlg
end if
wDrive% = asc(mid$(szDestPath, 1,1)) - asc("A")
if IsCDROMDrive(wDrive%) > 0 then
szDestPath = szOldDestPath
UIPop 1
BadPath
goto GetPathDlg
end if
if IsDriveNetwork(mid$(szDestPath,1,1)) = 1 then
szDestPath = szOldDestPath
UIPop 1
NetworkDrive
goto GetPathDlg
end if
'do not allow product to be installed in root directory - 5-2-97 Wyn
slength% = len(szDestPath)
if slength% < 4 then
UIPop 1
BadPath
goto GetPathDlg
end if
'Test if A:\ is a floppy drive.
'if it is do not install product
wDrive% = asc(mid$(szDestPath, 1,1)) - asc("A")
if IsFloppyDrive(wDrive%) > 0 then
szDestPath = szOldDestPath
UIPop 1
BadPath
goto GetPathDlg
end if
' IsDirWritable() Crashes on Win95 if looking at A:\ with no disk in!
if IsDirWritable(szDestPath) = 0 then
szDestPath = szOldDestPath
UIPop 1
BadPath
goto GetPathDlg
end if
' if DoesDirExist(szDestPath) = 0 then
' dButton = DoMsgBox( STR_DIRNOTEXIST, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
' if dButton = 7 then
' goto GetPathDlg
' end if
' end if
UIPop 1
case "EXIT" , "CANCEL"
AskQuit
goto GetPathDlg
end select
GetCustomChoicesDlg:
SetSymbolValue "CheckItemsState", ""
' AddListItem "CheckItemsState", szMinimalInstall
' AddListItem "CheckItemsState", szAddPMItem
GetCustomChoicesLoop:
ClearCopyList
' if szMinimalInstall = "OFF" then
AddFilesToCopyList "FULL"
' else
' AddFilesToCopyList "MINIMAL"
' end if
dDestDrive = asc(mid$(szDestPath, 1,1)) - asc("A")+1
dWinDrive = asc(mid$(szWinPath, 1,1)) - asc("A")+1
SetSymbolValue "DriveStatusText", ""
AddListItem "DriveStatusText", mid$(szDestPath, 1,1) + ":"
AddListItem "DriveStatusText", str$(GetDiskSpaceNeeded(dDestDrive) / 1024) + " K"
AddListItem "DriveStatusText", str$(GetFreeSpaceForDrive(mid$(szDestPath, 1,1))/1024) + " K"
if dDestDrive = dWinDrive then
AddListItem "DriveStatusText", ""
AddListItem "DriveStatusText", ""
AddListItem "DriveStatusText", ""
else
AddListItem "DriveStatusText", mid$(szWinPath, 1,1) + ":"
AddListItem "DriveStatusText", str$(GetDiskSpaceNeeded(dWinDrive)/ 1024 ) + " K"
AddListItem "DriveStatusText", str$(GetFreeSpaceForDrive(mid$(szWinPath, 1,1))/1024) + " K"
end if
AddListItem "DriveStatusText", szDestPath
ChooseInstall:
szButton = UIStartDlg(CUIDLL_FILENAME, DLG_CUSTOM, "FCustInstDlgProc", DLG_CUSTOMHELP, PROC_HELP)
' szMinimalInstall = GetListItem("CheckItemsState", 1)
' szAddPMItem = GetListItem("CheckItemsState", 2)
select case szButton
case "REACTIVATE"
goto GetCustomChoicesLoop
case "BACK"
UIPop 1
goto GetPathDlg
case "CONTINUE"
UIPop 1
case "EXIT" , "CANCEL"
AskQuit
goto GetCustomChoicesLoop
end select
ClearCopyList
' if szMinimalInstall = "OFF" then
AddFilesToCopyList "FULL"
' else
' AddFilesToCopyList "MINIMAL"
' end if
goto CommonInstallLoop
ExpressInstallLoop:
AddFilesToCopyList "FULL"
goto CommonInstallLoop
CommonInstallLoop:
InitCommonInstall
if szMinimalInstall = "ON" and GetFreeSpaceForDrive(mid$(szDestPath,1,1)) < MINIMUM_DISK_SPACE then
error ERR_NODISKSPACE
elseif GetFreeSpaceForDrive(mid$(szDestPath,1,1)) < GetDiskSpaceNeeded( asc(mid$(szDestPath, 1,1))-asc("A")+1 ) then
error ERR_NODISKSPACE
end if
'+++
'$IFDEF NEEDS_WING
UpdateWinGDrivers
'$ENDIF
'---
'+++
'$IFDEF NEEDS_VFW
' Don't need to install VFW on Windows 95, it is already there.
if not OS_Windows95 then
UpdateIndeoAVIDrivers
end if
'$ENDIF
'---
UpdateFonts ' Installs specific fonts
Install ' Installs all of the necessary files.
'****************************************************************************************************************
'****************************************************************************************************************
' Copied from the VR Bird Setup Program... Should create the Extra directory....
'****************************************************************************************************************
'****************************************************************************************************************
CreateDir ( szDestPath + "\" + "TOURS" ), cmoNone
CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
ShowProgmanGroup STR_COMPANYNAME, 1, cmoNone
' szReadmeTitle$ = STR_PRODUCTNAME + " " + STR_README 'not used now
'****************************************************************************************************************
'****************************************************************************************************************
dCursor = ShowWaitCursor()
' Always create the DK Registry and enter the details
CreateIniKeyValue "Win.ini", "MMAPP", WIN_INI_ENTRY, szWinDrive+":"+DKREG_INI_PATH, cmoOverwrite
CreateReg
' Get the current window handle for setting its properties later
hwndSetup = GetActiveWindow
CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
ShowProgmanGroup STR_COMPANYNAME, 1, cmoNone
' Set the main window properties to bring the main window to the front.
' This is so the user cannot start the app now, but will see the prog group after setup!
i% = SetWindowPos(hwndSetup, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE+SWP_NOMOVE)
'+++
'$IFDEF WITH_SAMPLER
' if szMinimalInstall = "ON" then
' szSamplerPath$ = MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), SAMPLER_PATH)
' szSamplerPath$ = MakePath(szSamplerPath$, SAMPLER_EXE_FILE)
' szInf$ = MakePath(szSrcBinPath, APPLICATION_MENU_FILE) + " " + MakePath(szSrcBinPath, APPLICATION_EXE_FILE) + " " + MakePath(szSrcBinPath, APPLICATION_PENGE_FILE) + " " + szSamplerPath$
' CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
' CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szSrcBinPath, APPLICATION_README_FILE), "", cmoOverwrite
' else
szSamplerPath$ = MakePath(szDestPath, SAMPLER_EXE_FILE)
szInf$ = MakePath(szDestPath, APPLICATION_MENU_FILE) + " " + MakePath(szDestPath, APPLICATION_EXE_FILE) + " " + MakePath(szDestPath, APPLICATION_PENGE_FILE) + " " + szSamplerPath$
CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szDestPath, APPLICATION_README_FILE), "", cmoOverwrite
'$IFDEF WITH_ORDERING_INFO
CreateProgmanItem STR_COMPANYNAME, STR_ORDER, EDITOR_EXE + MakePath(szWinDrive + ":" + DKREG_INI_DIR, ORDER_FILE), "", cmoOverwrite
'$ENDIF
' end if
'$ELSE
'NO SAMPLER
' if szMinimalInstall = "ON" then
' szInf$ = MakePath(szSrcBinPath, APPLICATION_EXE_FILE) + " " + MakePath(szSrcBinPath, "dkpage")'APPLICATION_PENGE_FILE)
' CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
' CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szSrcBinPath, APPLICATION_README_FILE), "", cmoOverwrite
' else
szInf$ = MakePath(szDestPath, APPLICATION_EXE_FILE) + " " + MakePath(szDestPath, "dkpage")'APPLICATION_PENGE_FILE)
CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szDestPath, APPLICATION_README_FILE), "", cmoOverwrite
'$IFDEF WITH_ORDERING_INFO
CreateProgmanItem STR_COMPANYNAME, STR_ORDER, EDITOR_EXE + MakePath(szWinDrive + ":" + DKREG_INI_DIR, ORDER_FILE), "", cmoOverwrite
'$ENDIF
'$IFDEF WITH_FULL_SAMPLER
CreateProgmanItem STR_COMPANYNAME, STR_SAMPLER, MakePath(szFullSampPath, SAMPLER_EXE_FILE), "", cmoOverwrite
CreateProgmanItem STR_COMPANYNAME, STR_SAMPLER_README, MakePath(szFullSampPath, SAMPLER_README_FILE), "", cmoOverwrite
'$ENDIF
' end if
'$ENDIF
'---
'+++
'$IFDEF WITH_UNINSTALL
'Uninstall icon
szDKUninstall$ = szWinDrive + ":" + DKREG_INI_DIR
szInf$ = MakePath( szDKUninstall, UNINSTALL_EXE_FILE)
CreateProgmanItem STR_COMPANYNAME, STR_UNINSTALL, szInf, szInf, cmoOverwrite
'$ENDIF
'---
'$IFDEF DEBUG
DumpCopyList MakePath(szDestPath, "copylist.txt")
'$ENDIF
RestoreCursor( dCursor )
If EndCommonInstall( APPLICATION_README_FILE, 0, EDITOR_EXE ) = NAV_EXIT then
stop
end
endif
quit:
on error goto quit
select case ERR
case 0
hDlg = DLG_SUCCESS
case STFQUIT
hDlg = DLG_BADEXIT
case ERR_NODISKSPACE
hDlg = DLG_NODISKSPACE
case else
hDlg = DLG_ABORT
end select
UIPop 10
quit2:
szButton = UIStartDlg(CUIDLL_FILENAME, hDlg, "FInfo0DlgProc", 0, "")
select case szButton
case "REACTIVATE"
goto quit2
end select
UIPop 1
DeInitialise
stop
end
quitError:
dButton = DoMsgBox (STR_QUITERROR, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
DeInitialise
stop
end
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub Install() STATIC
cursor% = ShowWaitCursor()
CreateDir szDestPath, cmoNone
'$IFNDEF NEEDS_WIN32S
SetRestartDir szDestPath ' Already set if needs Win32s
'$ENDIF
RestoreCursor(cursor%)
CopyFilesInCopyList 'creates dir even if min install
'+++
'$IFDEF NEEDS_VFW
' Don't need to install VFW on Windows 95, it is already there.
if OS_Windows95 = 0 then
Run ("regedit.exe /s " + MakePath(szWinPath, "mplayer.reg"))
Run ("regedit.exe /s " + MakePath(szWinSysPath, "OLE2.reg"))
'+++
'$IFNDEF NEEDS_WIN32S
' NOT with WIN32S
Run ("regedit.exe /s " + MakePath(szWinSysPath, "cleanup.reg"))
'$ENDIF
'---
Run ("profdisp.exe")
end if
'$ENDIF
'---
if INI_FILE_SOURCE = "AppPath" then
szAppINIPath = MakePath(szDestPath, APPLICATION_INI_FILE)
else
szAppINIPath = MakePath(szWinPath, APPLICATION_INI_FILE)
end if
'=d:\ =d:\dksetup =dksetup
szPengePath = mid$(szSrcSetupPath, 1,len(szSrcSetupPath)-len(SOURCE_SETUP_SUBDIR)-2) ' -2 removes backslash
'+++
'$IFDEF WITH_SAMPLER
szSampINIPath = MakePath(szDestPath, SAMPLER_INI_FILE)
'data =
szSampData = szPengePath + "\" + SAMPLER_PATH
CreateIniKeyValue szSampINIPath, PRODUCT_INI_DIR_SECTION_NAME, PRODUCT_INI_DIR_ENTRY_NAME, szSampData, cmoOverwrite
'volumelabel =
szCdDrive$ = mid$( szSrcSetupPath, 1, 1 )
szCdVolumeLabel$ = STRING$( 20, 32 )
if( GetCdVolumeLabel( szCdVolumeLabel$, szCdDrive$ ) ) then
CreateIniKeyValue MakePath(szDestPath, SAMPLER_INI_FILE), PRODUCT_INI_DIR_SECTION_NAME, "VolumeLabel", szCdVolumeLabel$, cmoOverwrite
endif
'$ENDIF
'---
'+++
'$IFDEF WITH_FULL_SAMPLER
szSampINIPath = MakePath(szFullSampPath, SAMPLER_INI_FILE)
'data =
szSampData = szPengePath + "\" + SAMPLER_PATH
CreateIniKeyValue szSampINIPath, PRODUCT_INI_DIR_SECTION_NAME, PRODUCT_INI_DIR_ENTRY_NAME, szSampData, cmoOverwrite
' Don't want to force a specific cd for the full sampler!
' 'volumelabel =
' szCdDrive$ = mid$( szSrcSetupPath, 1, 1 )
' szCdVolumeLabel$ = STRING$( 20, 32 )
' if( GetCdVolumeLabel( szCdVolumeLabel$, szCdDrive$ ) ) then
' CreateIniKeyValue MakePath(szDestPath, SAMPLER_INI_FILE), PRODUCT_INI_DIR_SECTION_NAME, "VolumeLabel", szCdVolumeLabel$, cmoOverwrite
' endif
'$ENDIF
'---
'+++
'$IFDEF SCRUNGED
' if szMinimalInstall = "OFF" then
'data =
CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, PRODUCT_INI_DIR_ENTRY_NAME, szPengePath, cmoOverwrite
' endif
'$ELSE
'DEBUG VERSION
'data =
CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, PRODUCT_INI_DIR_ENTRY_NAME, MakePath(szPengePath,"data"), cmoOverwrite
'pages =
CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Pages", MakePath(szPengePath,"dkpage"), cmoOverwrite
CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Scrunge", "0", cmoOverwrite
CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Developer", "1", cmoOverwrite
CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Debug", "1", cmoOverwrite
'$ENDIF
'---
if APPLICATION_EXE_FILE = "sampler.exe" then
' Add version entry from version.ini if found
szSampVersion = GetIniKeyString( MakePath( szSrcBinPath, "VERSION.INI" ), "VERSION", "VERSION" )
if len( szSampVersion ) > 0 then
CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Version", szSampVersion, cmoOverwrite
endif
endif
' Add any custom ini entries in the function in product.inc
CustomIniEntries
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub AddFilesToCopyList(szInstallType$) STATIC
cursor% = ShowWaitCursor()
szDKUninstall$ = szWinDrive + ":" + DKREG_INI_DIR
'Shared Files : For ORDER.WRI & FOR MUSEUM TITLES (DKSWTCHW.EXE) Put in \MMAPP
'$IFDEF WITH_ORDERING_INFO OR NEEDS_MUSEUM_LIFT
AddSectionFilesToCopyList SETUP_INI_SH_BINARIES_SECTION_NAME, szSrcBinPath, szDKUninstall
'$ENDIF
'+++
'$IFDEF WITH_FULL_SAMPLER
AddSectionFilesToCopyList SAMPLER_BINARIES_SECTION_NAME, szSrcBinPath, szFullSampPath
'$ENDIF
'---
'+++
'$IFDEF WITH_UNINSTALL
AddSectionFilesToCopyList "UNINSTALL", szSrcBinPath, szDKUninstall
'$ENDIF
'---
' select case szInstallType
' case "FULL"
AddSectionFilesToCopyList SETUP_INI_BINARIES_SECTION_NAME, szSrcBinPath, szDestPath
' case "MINIMAL"
' ' nothing
' end select
'+++
'$IFDEF NEEDS_WING
AddSectionFilesToCopyList SETUP_INI_WING_BINARIES_NAME, szSrcBinPath, szWinSysPath
AddSectionFilesToCopyList SETUP_INI_WING32_BINARIES_NAME, szSrcBinPath, szWinSysPath
'$ENDIF
'---
'+++
'$IFDEF NEEDS_VFW
' Don't need to install VFW on Windows 95, it is already there.
if OS_Windows95 = 0 then
AddSectionFilesToCopyList "VfW Runtime", szSrcBinPath, szWinSysPath
AddSectionFilesToCopyList "MPlayer", szSrcBinPath, szWinPath
AddSectionFilesToCopyList "AVICodecs", szSrcBinPath, szWinSysPath
'+++
'$IFNDEF NEEDS_WIN32S
' Win32s has its own 32-bit OLE
AddSectionFilesToCopyList "OLE2", szSrcBinPath, szWinSysPath
'$ENDIF
'---
end if
'$ENDIF
'$IFDEF NEEDS_SOUND
' Don't need to install Sound on Windows 95, it is already there.
if OS_Windows95 = 0 then
if fSystemUpdated = 1 then
AddSectionFilesToCopyList "ACM Drivers", szSrcBinPath, szWinSysPath
end if
end if
'$ENDIF
RestoreCursor(cursor%)
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub UpdateFonts() STATIC
' Check TT enabled
MakeListFromSectionFilename "Fonts_list", "Fonts"
listLength% = GetListLength("Fonts_list")
if listLength% > 0 then
' Check to see if the list is just a placeholder or a real list.
szFontFile$ = GetListItem("Fonts_list", 1)
if szFontFile <> "NOFONT.ZZZ" then
' Do the Win.ini entries
RegisterFonts
for item% = 1 to listLength%
szFontFile = GetListItem("Fonts_list", item%)
' Check if exists
' Install font
ret% = InstallFont(MakePath(szSrcBinPath, szFontFile))
' Write WIN.INI
next
end if
end if
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub CreateReg() STATIC
' The MMAPP.INI path
szDKRegIni = szWinDrive + ":" + DKREG_INI_PATH
if DoesFileExist( szDKRegIni, femExist) = 0 then
'dkreg.ini doesn't exist - initialize AppCount, create dir, add to InstalledApp
AppCount% = 1
CreateDir (szWinDrive+":"+DKREG_INI_DIR), cmoNone
CreateIniKeyValue szDKRegIni, "InstalledApp", "Applications", str$(AppCount%), cmoOverwrite
szNum$=str$(AppCount%)
CreateIniKeyValue szDKRegIni, "InstalledApp",ltrim$(szNum), STR_PRODUCTNAME, cmoOverwrite
'$IFDEF WITH_FULL_SAMPLER
' Create separate Sampler entry
AppCount% = 2
CreateIniKeyValue szDKRegIni, "InstalledApp", "Applications", str$(AppCount%), cmoOverwrite
szNum$=str$(AppCount%)
CreateIniKeyValue szDKRegIni, "InstalledApp",ltrim$(szNum), STR_SAMPLER, cmoOverwrite
'$ENDIF
else
if DoesIniSectionExist( szDKRegIni, STR_PRODUCTNAME )=1 then
szDiffPath$=GetIniKeyString(szDKRegIni, STR_PRODUCTNAME, "Path")
if(szDestPath$ <> szDiffPath$) then
' product is also installed in a different dir - delete files and dir and ini section
ret% = DeleteFiles (szDiffPath, STR_PRODUCTNAME, szDKRegIni)
ret% = DeleteDir (szDiffPath)
ret% = DeleteSection(STR_PRODUCTNAME, szDKRegIni)
endif
'product is installed in same dir - do nothing, has overwritten files
else
'product name does not exist - increment AppCount, add to InstalledApp
szAppCount$ = GetIniKeyString( szDKRegIni, "InstalledApp", "Applications" )
AppCount% = Val(szAppCount$) + 1
CreateIniKeyValue szDKRegIni, "InstalledApp", "Applications", str$(AppCount%), cmoOverwrite
'assign product to first available number (maybe gaps due to deletion)
i%=1
while( GetIniKeyString( szDKRegIni, "InstalledApp",str$(i%) )<>"")
i=i+1
wend
szNum$=str$(i%)
CreateIniKeyValue szDKRegIni, "InstalledApp",ltrim$(szNum), STR_PRODUCTNAME, cmoOverwrite
endif
'$IFDEF WITH_FULL_SAMPLER
' Create separate Sampler entry
if DoesIniSectionExist( szDKRegIni, STR_SAMPLER )=1 then
szDiffPath$=GetIniKeyString(szDKRegIni, STR_SAMPLER, "Path")
if(szFullSampPath$ <> szDiffPath$) then
' Sampler is installed in a different dir - delete files and dir and ini section
ret% = DeleteFiles (szDiffPath, STR_SAMPLER, szDKREgIni)
ret% = DeleteDir (szDiffPath)
ret% = DeleteSection(STR_SAMPLER, szDKREgIni)
endif
'Sampler is installed in same dir - do nothing, will overwrite files
else
'Sampler does not exist - increment AppCount, add to InstalledApp
szAppCount$ = GetIniKeyString( szDKRegIni, "InstalledApp", "Applications" )
AppCount% = Val(szAppCount$) + 1
CreateIniKeyValue szDKRegIni, "InstalledApp", "Applications", str$(AppCount%), cmoOverwrite
'assign product to first available number (maybe gaps due to deletion)
i%=1
while( GetIniKeyString( szDKRegIni, "InstalledApp",str$(i%) )<>"")
i=i+1
wend
szNum$=str$(i%)
CreateIniKeyValue szDKRegIni, "InstalledApp",ltrim$(szNum), STR_SAMPLER, cmoOverwrite
endif
'$ENDIF
endif
CreateIniKeyValue szDKRegIni, "InstalledApp","RecentLang", LANG_DLL, cmoOverwrite
CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME, "Path", szDestPath, cmoOverwrite
CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME, "Company", STR_COMPANYNAME, cmoOverwrite
CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME, "Readme", STR_README, cmoOverwrite
CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME, "Order", STR_ORDER, cmoOverwrite
CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME, "Exe", APPLICATION_EXE_FILE, cmoOverwrite
CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME, "1", APPLICATION_INI_FILE , cmoOverwrite 'Ini
' if szMinimalInstall = "OFF" then
MakeListFromSectionFilename "BIN_list", "BIN"
listLength% = GetListLength("BIN_list")
if listLength% > 0 then
for item% = 1 to listLength%
szBinFile$ = GetListItem("BIN_list", item%)
szNum$=str$(item%+1)
CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME, ltrim$(szNum), szBinFile , cmoOverwrite
next
end if
' end if
'$IFDEF WITH_SAMPLER
szNum$=str$(item%+1)
CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME, ltrim$(szNum), SAMPLER_INI_FILE , cmoOverwrite
item% = item% + 1
'$ENDIF
' Add Uninstall only files to the list
UninstallOnly( item% )
'$IFDEF WITH_FULL_SAMPLER
' Create entries in the sampler section
CreateIniKeyValue szDKRegIni, STR_SAMPLER, "Path", szFullSampPath, cmoOverwrite
CreateIniKeyValue szDKRegIni, STR_SAMPLER, "Company", STR_COMPANYNAME, cmoOverwrite
CreateIniKeyValue szDKRegIni, STR_SAMPLER, "Readme", STR_SAMPLER_README, cmoOverwrite
CreateIniKeyValue szDKRegIni, STR_SAMPLER, "Exe", SAMPLER_EXE_FILE, cmoOverwrite
CreateIniKeyValue szDKRegIni, STR_SAMPLER, "1", SAMPLER_INI_FILE , cmoOverwrite 'Ini
' if szMinimalInstall = "OFF" then
MakeListFromSectionFilename "SAMP_BIN_list", "SAMPBIN"
listLength% = GetListLength("SAMP_BIN_list")
if listLength% > 0 then
for item% = 1 to listLength%
szBinFile$ = GetListItem("SAMP_BIN_list", item%)
szNum$=str$(item%+1)
CreateIniKeyValue szDKRegIni, STR_SAMPLER, ltrim$(szNum), szBinFile , cmoOverwrite
next
end if
' end if
'$ENDIF
' Add fonts to the uninstall list.
' listLength% = GetListLength("Fonts_list")
' if listLength% > 0 then
' for item% = 1 to listLength%
' szFontFile$ = GetListItem("Fonts_list", item%)
' szNum$=str$(item%)
' CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME,"F"+ltrim$(szNum), szFontFile, cmoOverwrite
' next
' end if
End Sub