;;
;;

DefineVariables
Number [DefaultMenuChoice] := 1
Number [InDevices] := 0
Number [OutDevices] := 0
Number [NumberOfColors] := 0
Number [OurWindowHandle] := 0
Text [ProgramGroup] := Musicware
Text [CompanyName] := Musicware Inc.
Text [ProductName] := Musicware PIANO
Text [ProductName2] := Musicware SONGS
Text [ProductVersion] := 1.0
Text [ProductNameAndVersion] := Musicware PIANO 
Text [ProgramExeName] := MPIANO.EXE
Text [DiagProgram] := Midi Information and Diagnostics
Text [DiagProgramExe] := DEVICES.EXE
Text [SongPackCode] := 1sampler
Text [SongPackKey] := Pack1
Text [SongPackTitle] := Song Sampler
Text [FullPathToIni] :=
Logical [OfferInstallationDirectoryChoice] := Y
Logical [FileIsOlder] := N
Directory [DefaultInstallationDirectory] := MWARE
Text [ModifyMode] := UNDECIDED
Number [MinimumFilesSetting] := 0
Number [MinimumBuffersSetting] := 0
Directory [ReadmeFileName] := README.TXT
Logical [InquireAboutSystemFileLocation] := Y
Logical [AskBeforeFileReplacement] := N
Text [ExitMessage] := [ProductName] Installation Is Complete!
Directory [ProgramToRun] :=
Logical [AddInstallDirectoryToPath] := N
Text [MinimumOSVersion] := 3.1
Number [MinimumSystemMemoryRequiredPresent] := 480
Logical [AllowCGA] := N
Logical [AllowMDA] := N
Logical [Allow808x] := N
Logical [Allow80286] := N
Logical [MathCoprocessorRecommended] := N
Logical [FixedDiskRequired] := Y
Text [NetWorkInstallation] := DisallowNetwork
Logical [UseShadows] := Y
Text [MainBorder] := NONE
Text [PopupBorder] := SINGLE
Text [TopLine] := "  [ProductName] Setup  "
Text [TopLineColors] := WhiteOnBrown
Text [BottomLineColors] := WhiteOnLightGray
Text [PopupColors] := WhiteOnCyan
Text [AttentionColors] := WhiteOnRed
Text [SpecialPopupColors] := WhiteOnBrown
Text [ExpressSetupDescription] := Setup [ProductName]
Text [ExtractionOptions] := ShowJustOne  ;; See GetQuedFiles
Logical [NeedToTerminate] := N
Logical [Installed] := N
Text [DisplayAdapterSummary] :=
Text [CPUTypeSummary] :=
Text [NetworkActive] :=
Text [MathCoprocessorStatus] :=
Text [InstallationDriveSummary] :=
Text [OSVersionSummary] :=
Text [SystemMemorySummary] :=
Logical [InsufficientSystem] := N
Logical [CompatibilityNoticeGiven] := N
Logical [NeedToModify] := N
Text [PathTask] :=
Text [BuffersTask] :=
Text [FilesTask] :=
Text [BackgroundCharacter] := B0
Text [ScreenColors] := WhiteOnBlue
Directory [PicturesDirectory] := PICTS
Directory [Pics16Color] := pics16
Directory [Pics256Color] := pics256
Directory [MidiFileDirectory] := MIDI
Logical [Success] := N
Text [OriginalInstall] := 
Text [Temp] :=
EndDefineVariables

;;If [CommandLine1] = -ReplaceFiles
;;  SetReplacementInquiry Off
;;EndIf
;;If [CommandLine2] = -ReplaceFiles
;;  SetReplacementInquiry Off
;;EndIf
;;If [CommandLine3] = -ReplaceFiles
;;  SetReplacementInquiry Off
;;EndIf

If [InquireAboutSystemFileLocation] = NoCharacter
 If DriveIsPresent [BootDrive]  ;; if not, COMSPEC has been changed
    NoSysFileConfirmation
  EndIf
EndIf



;;If [AskBeforeFileReplacement] = NoCharacter
;;  SetReplacementInquiry Off
;;EndIf

;;Do makeProgramGroup

Do SetupInstalit
Do PrepareSystemReport

Do CheckMidiDrivers



:Again
SetBackgroundColor 94 94 94 72 72 72
;;SetBackgroundColor 0 0 255 0 0 64 TopToBottom
ClearScreen
;;TextBox @xy(Center,4)
;;  Thanks for purchasing [ProductName].
;;  How shall we do the installation?
;;EndTextBox
;;GetMenuChoice @xy(Center,10) UseHeader "[ProductName] Setup"
GetMenuChoice UseHeader "[ProductName] Setup" Highlight [DefaultMenuChoice]
  Setup [ProductName] on your hard drive
    ;;[ExpressSetupDescription]
;;  Replace an existing file from the Install Disks
    ;;Get a replacement copy of a file
  Exit [ProductName] setup and return to Windows
    ;;Exit this installer and return
    ;;to the operating system
EndGetMenuChoice

ClearScreen

InCase choice is
  =1:  Do QueNecessaryFiles
  =2:  Do ExitInstallation
EndInCase

If QueSize = 0
  GoTo Continue
EndIf

If [InsufficientSystem] = YesCharacter
  Dialog [YesOrNo1] WhiteOnRed ;; Insufficient system notice
    Analysis of your system has determined that it is
    not compatible with [ProductName].  For a complete
    summary, press YesCharacter.

    Do you wish to continue anyway?
  EndDialog
  If [YesOrNo1] = NoCharacter
    GoTo Again
  Else
    Do ShowSystemSummary
  EndIf
EndIf

If [Installed] = YesCharacter
else

	
	[OriginalInstall] := FullPathTo MPIANO.EXE Search AllFixed
	[Number5] := LengthOf [OriginalInstall]

	[YesOrNo1] := NoCharacter
	if [Number5] > 0 
		[Number5] := PositionOf MPIANO.EXE in [OriginalInstall]
		DecrementNumber [Number5]
		DecrementNumber [Number5]

		[Temp] := SubstringOf [OriginalInstall] from 1 to [Number5]
		[OriginalInstall] := [Temp]
		Dialog [YesOrNo1]
			Install has detected a previous installation
			of the software. On the following directory:
			[OriginalInstall]
			Install suggests that you install
			this version on the same drive and directory.
			Do you wish to install to the same drive and directory?
		EndDialog
	Endif

	if [YesOrNo1] = NoCharacter 
		DetermineInstallationDrive QueSize RequireFixed
		[InstallationDirectory] := InstallationDrive:\[DefaultInstallationDirectory]
		DetermineInstallationDirectory QueSize RequireFixed
	else
		[InstallationDirectory] := [OriginalInstall]
	endif

        CreateDirectoryIfNecessary [InstallationDirectory]\[PicturesDirectory]\[Pics16Color]
	CreateDirectoryIfNecessary [InstallationDirectory]\[PicturesDirectory]\[Pics256Color]
        CreateDirectoryIfNecessary [InstallationDirectory]\[SongPackCode]\[PicturesDirectory]\[Pics16Color]
	CreateDirectoryIfNecessary [InstallationDirectory]\[SongPackCode]\[PicturesDirectory]\[Pics256Color]
	CreateDirectoryIfNecessary [InstallationDirectory]\[SongPackCode]\[MidiFileDirectory]

EndIf
	if FileExists [InstallationDirectory]\MPIANO.INI
	else
		QueFileGroup 70
	endif		

Do HandleOldSongSampler
Do CleanupOldVersion
Do CleanupV102

SetReplacementInquiry On
GetQuedFiles [ExtractionOptions]
[Installed] := YesCharacter
[DefaultMenuChoice] := 2

Do makeProgramGroup
Do InstallSongPackIni
If QueSize <> 0  ;; Some files were selected but not installed if <> 0
  [Installed] := NoCharacter
  UnqueAllFiles  ;; Remove uninstalled files from que
  Dialog ;; Message when unable to get all necessary files
    Unable to successfully complete this option.
  EndDialog
EndIf

if [Installed] = YesCharacter
    Dialog PressAKey
	[ProductName] has been
	successfully installed.
    EndDialog
Endif

:Continue
GoTo Again



Procedure QueNecessaryFiles


	

if FileIsInLibrary USE256

;; Ask for 256 Color Support

	Dialog [YesOrNo1]
		[ProductNameAndVersion] can optionally support 256 color graphics.
		Do you wish to install this option?
	EndDialog


Endif

;; All files except VBX and DLLs

;;    QueFileGroup 40 to [WindowsSystemDirectory]
;;    QueFileGroup 50 to [WindowsSystemDirectory]
;;    QueFileGroup 40 
;;    QueFileGroup 50 

	QueFileGroup 51 to [WindowsSystemDirectory] 
	QueFileGroup 52 to [InstallationDirectory] 
	QueFileGroup 41 to [WindowsSystemDirectory] 
	QueFileGroup 42 to [InstallationDirectory] 


;;	if FileExists [InstallationDirectory]\MPIANO.INI
;;	else
;;	    QueFileGroup 70
 ;;       endif

    QueFileGroup 20
    QueFileGroup 21
    QueFileGroup 22
    QueFileGroup 30
    QueFileGroup 60    
    
;; Graphic Files

;; 16 Color
    QueFileGroup 65 To [InstallationDirectory]\[PicturesDirectory]\[Pics16Color]
;; 256 Color
if [YesOrNo1] = YesCharacter 
    QueFileGroup 66 To [InstallationDirectory]\[PicturesDirectory]\[Pics256Color]
Endif    

    QueFileGroup 80   
    
;; MIDI Files    
    QueFileGroup 90 To [InstallationDirectory]\[MidiFileDirectory]
    
    
    QueFileGroup 99 To [InstallationDirectory]

;; SONG TEASER
	
;;	song teaser course files
	QueFileGroup 200 To [InstallationDirectory]\[SongPackCode]
;;	song teaser midi files
	QueFileGroup 210 To [InstallationDirectory]\[SongPackCode]\[MidiFileDirectory]
;; 	song teaser Gif files
	QueFileGroup 265 To [InstallationDirectory]\[SongPackCode]\[PicturesDirectory]\[Pics16Color]
	QueFileGroup 266 To [InstallationDirectory]\[SongPackCode]\[PicturesDirectory]\[Pics256Color]


	QueFileGroup 300 To [InstallationDirectory]

EndProcedure


Procedure ShowHelpInfo
Dialog PressAKey [SpecialPopupColors]  ;; How to reach technical support
For assistance, refer to
the [ProductName] users guide.

You can get a summary of your computer system
by pressing YesCharacter.  This information will be
important should you call Customer Service.
EndDialog
If [YesOrNo1] = YesCharacter
  Do ShowSystemSummary
EndIf
EndProcedure

Procedure ShowSystemSummary  ;; System summary - change with care.
  If [InstallationDirectory] <> BlankString
    [InstallationDriveSummary] := InstallationDrive (FreeSpaceOnDrive InstallationDrive bytes free)
  else
    [InstallationDriveSummary] := (Not Selected)
  EndIf
  Dialog PressAKey [SpecialPopupColors]
    .cHERE IS A SUMMARY OF YOUR SYSTEM
    .c[String8]  ;; notes whether any incompatibilities were found

    Operating System Version:  [OSVersionSummary]
    CPU Type:  [CPUTypeSummary]
    Display Adapter:  [DisplayAdapterSummary]
    Math Coprocessor:  [MathCoprocessorStatus]
    Main Memory Present:  [SystemMemorySummary]
    Extended Memory Present:  ExtendedMemoryPresentK
    Installation Drive:  [InstallationDriveSummary]
    Network:  [NetworkActive]
    [String9]  ;; information about network suitability
  EndDialog
EndProcedure

Procedure PrepareSystemReport
  [InsufficientSystem] := NoCharacter
  If OSVersion < [MinimumOSVersion]
    [OSVersionSummary] := OSVersion (need at least [MinimumOSVersion])
    [InsufficientSystem] := YesCharacter
  else
    [OSVersionSummary] := OSVersion
  EndIf
  If MainMemory < [MinimumSystemMemoryRequiredPresent]
    [SystemMemorySummary] := MainMemoryK (need at least [MinimumSystemMemoryRequiredPresent]K)
    [InsufficientSystem] := YesCharacter
  else
    [SystemMemorySummary] := MainMemoryK
  EndIf
  If 808X
    If [Allow808X] = YesCharacter
      [CPUTypeSummary] := 808x
    else
      [CPUTypeSummary] := 808x (not compatible with [ProductName])
      [InsufficientSystem] := YesCharacter
    EndIf
  EndIf
  If 80286
    [CPUTypeSummary] := 80286
  EndIf
  If 80386
    [CPUTypeSummary] := 80386
  EndIf
  If 80486
    [CPUTypeSummary] := 80486
  EndIf
  If [CPUTypeSummary] = BlankString
    [CPUTypeSummary] := 808x
  EndIf
  If MicroChannel
    [CPUTypeSummary] := [CPUTypeSummary] (in MicroChannel Architecture)
  else
    [CPUTypeSummary] := [CPUTypeSummary] (ISA or EISA Architecture)
  EndIf
  If CGA
    If [AllowCGA] = YesCharacter
      [DisplayAdapterSummary] := CGA
    else
      [DisplayAdapterSummary] := CGA (not compatible with [ProductName])
      [InsufficientSystem] := YesCharacter
    EndIf
  EndIf
  If MDA
    If [AllowMDA] = YesCharacter
      [DisplayAdapterSummary] := MDA
    else
      [DisplayAdapterSummary] := MDA (not compatible with [ProductName])
      [InsufficientSystem] := YesCharacter
    EndIf
  EndIf
  If EGA
    [DisplayAdapterSummary] := EGA
  EndIf
  If VGA
    [DisplayAdapterSummary] := VGA
  EndIf
  If HGC
    [DisplayAdapterSummary] := HGC
  EndIf
  If HGCPlus
    [DisplayAdapterSummary] := HGC Plus
  EndIf
  If Network
    [NetworkActive] := Network Active
  else
    [NetworkActive] := No Network Active
  EndIf
  If NovellLoaded
    [NetworkActive] := Novell [NetworkActive]
  EndIf
  If MathCoprocessorPresent
    [MathCoprocessorStatus] := Present
  else
    If [MathCoprocessorRecommended] = YesCharacter
      [MathCoprocessorStatus] := Not Present But Recommended
      If [CompatibilityNoticeGiven] = YesCharacter
      else
	Dialog  ;; Notice if math coprocessor recommended
	  [ProductName] needs a math coprocessor
	  for best performance.  Your system does not
	  contain one.
	EndDialog
      EndIf
    else
      [MathCoprocessorStatus] := Not Present
    EndIf
  EndIf

  If [InsufficientSystem] = YesCharacter
    [String8] := (Please note the listed incompatibilities)
  EndIf
  If [NetworkInstallation] contains DisallowNetwork
    [String9] := "   (You cannot install this version on a network drive)"
  EndIf
  [CompatibilityNoticeGiven] := YesCharacter
EndProcedure



Procedure ExitInstallation
ClearScreen
If [Installed] = YesCharacter
  [Number1] := [MinimumBuffersSetting] + [MinimumFilesSetting]
  If [Number1] <> 0
    ModifyConfigSys
      SetBuffersToAtLeast [MinimumBuffersSetting]
      SetFilesToAtLeast [MinimumFilesSetting]
    EndModifyConfigSys
  EndIf

  NoSysFileConfirmation  ;; since already inquired once

  If [InstallationDirectory] <> BlankString
    If [AddInstallDirectoryToPath] = YesCharacter
      ModifyAutoexecBat
	AddPathComponent [InstallationDirectory] at End  ;; or "at Beginning"
      EndModifyAutoexecBat
    EndIf
  EndIf

  If BootFilesModified
  else
    Dialog
	No changes were necessary to AUTOEXEC.BAT or CONFIG.SYS.
    EndDialog
    Dialog
	No changes were necessary to WIN.INI or SYSTEM.INI.
    EndDialog

  EndIf

EndIf
If [ProgramToRun] <> BlankString
  Dialog [YesOrNo1]  ;; Explains purpose of program to be run, if any
    [ProgramToRun] does <insert purpose here>.
    Do you wish to run it now?
  EndDialog
  If [YesOrNo1] = YesCharacter
    Run [ProgramToRun] SwapOut
    If OSErrorCode <> 0
      Dialog  ;; Message if OS unable to Run program
	Unable to run [ProgramToRun].
	Error code was OSErrorCode.
      EndDialog
    else
      If OSExitCode <> 0
	Dialog ;; Message if program ran but returned non-zero code
	  [ProgramToRun] executed but was not successful.
	  Return code OSExitCode.
	EndDialog
      EndIf
    EndIf
  EndIf
EndIf

If [Installed] = YesCharacter
If [ReadmeFileName] <> BlankString
  ChangeDirectoryTo [InstallationDirectory]
  Dialog [YesOrNo1] ;; Ask whether to browse readme file, if any
    [ReadmeFileName] contains important information.
    Do you wish to read it now?
  EndDialog
  If [YesOrNo1] = YesCharacter
    If FileExists [ReadmeFileName]
      BrowseFile [ReadmeFileName]
    else
      Popup Sorry, readme file [ReadMeFileName] is missing.
    EndIf
  EndIf
EndIf
EndIf

Dialog ;; Final Farewell
  Thanks for using [ProductName]!
EndDialog

Do CleanupOurStuff


SoLong
EndProcedure
              
Procedure CleanupOurStuff

	CallDLL [DLL5] EnableScreenSaver
	UnloadDLL [DLL5]
	
;; Delete Install Support Files
	DeleteFiles from ShadowDirectory Quietly
		*.bmp
		midichek.dll
		ver.dll
	EndDeleteFiles	

EndProcedure              


Procedure SetupInstalit
  SetDefaultBitmap Off
  ;;SetCoordinatesTo 80x25
  SetCoordinatesTo pixel
  ;;SetBackgroundColor 94 94 94 72 72 72

  SetScreenAttrTo [ScreenColors]
  SetBackgroundCharTo [BackgroundCharacter]
  Do PrepareSystemReport
  If [UseShadows] = YesCharacter
    SetShadows On
  else
    SetShadows Off
  EndIf
  If [InquireAboutSystemFileLocation] = NoCharacter
    NoSysFileConfirmation
  EndIf
  SetMainBorderTo     [MainBorder]
  SetPopupBorderTo    [PopupBorder]
  SetModifyModeTo     [ModifyMode]
  SetShadowAttrTo     DarkGrayOnBlack
  SetPopupAttrTo      [PopupColors]
  SetAttentionAttrTo  [AttentionColors]
  SetTopLineTo        [TopLine]

  QueFileGroup 10 to ShadowDirectory

  GetQuedFiles Quietly

  LoadBitMap 1 ShadowDirectory\setup.bmp
  ShowBitMap 1 ;;@xy(0,0)
  ShowWindow Maximize


  LoadDLL [DLL5] ShadowDirectory\MIDICHEK.DLL


    CallDLL [DLL5] DisableScreenSaver


if DLLError > 0

    [InDevices] := DLLError
    Dialog PressAnyKey
	There was a problem accessing the
	MIDICHEK.DLL
	[InDevices]
	Click OK to continue.
    EndDialog
endif


EndProcedure



Procedure makeProgramGroup

	[String1] := [ProgramGroup]
                    
;; Define and use a standard procedure for this

	ProgramManagerDDE
		CreateGroup( [String1])  
		ReplaceItem( [ProductName] )
		AddItem( [InstallationDirectory]\[ProgramExeName], [ProductName])
		ReplaceItem( [ReadMeFileName] )
		AddItem( [InstallationDirectory]\[ReadMeFileName], [ReadMeFileName])
		ReplaceItem( [ProductName2] )
		AddItem( [InstallationDirectory]\[ProgramExeName] /SONG, [ProductName2], [InstallationDirectory]\songs.ico )
		ReplaceItem( [DiagProgram] )
		AddItem( [InstallationDirectory]\[DiagProgramExe], [DiagProgram] )
	EndProgramManagerDDE                    	
	
	
	    
EndProcedure
             

Procedure CheckMidiDrivers

;;if FileExists [InstallFromDirectory]\MIDICHEK.DLL 
;;        Dialog
;;                MIDICHEK exists
;;        EndDialog
;;Endif


if DLLError = 0

    [OurWindowHandle] := [MainWindowHandle]
    CallDLL [DLL5] GetMidiDevices [InDevices] [OutDevices]
;;    CallDLL [DLL5] GetNumberOfColors [OurWindowHandle] [NumberOfColors]
;;
;;	Dialog PressAnyKey
;;		Number of Colors
;;		[NumberOfColors]
;;	EndDialog

;;    Dialog PressAnyKey
;;        InDevices
;;        [InDevices]
;;    EndDialog
;;    Dialog PressAnyKey
;;        OutDevices
;;        [OutDevices]
;;    EndDialog

    If [InDevices] = 0 .AND. [OutDevices] = 0
	Dialog [YesOrNo1]
	    [ProductName] has detected no MIDI Input
	    or Output drivers installed in Windows.
	    In order for [ProductName] to run properly
	    at least one MIDI Input and Output driver
	    must be installed. Please refer to the
	    Users Guide of your sound card for instructions
	    on how to install these drivers.

	    Do you wish to continue with the install?
	EndDialog
	    if [YesOrNo1] = NoCharacter 
			Do QuickExit	    
	    Endif
    else
	if [InDevices] = 0
	    Dialog [YesOrNo1]
	    [ProductName] has detected no MIDI Input
	    drivers installed in Windows.
	    In order for [ProductName] to run properly
	    at least one MIDI Input driver
	    must be installed. Please refer to the
	    Users Guide of your sound card for instructions
	    on how to install the driver.

	    Do you wish to continue with the install?
	    EndDialog
	    if [YesOrNo1] = NoCharacter 
			Do QuickExit	    
	    Endif
	Endif
	if [OutDevices] = 0
	    Dialog [YesOrNo1]
	    [ProductName] has detected no MIDI
	    Output drivers installed in Windows.
	    In order for [ProductName] to run properly
	    at least one MIDI Output driver
	    must be installed. Please refer to the
	    Users Guide of your sound card for instructions
	    on how to install the driver.

	    Do you wish to continue with the install?
	    EndDialog
	    if [YesOrNo1] = NoCharacter 
	      	Do QuickExit
	    Endif
	Endif

    Endif





Endif

EndProcedure

Procedure QuickExit
            
	Dialog PressAnyKey
		[ProductName] was not installed. 
		Press any key to exit setup.	
	EndDialog            
                                    
	Do CleanupOurStuff
	SoLong                                    
EndProcedure


Procedure DDENonFatalErrorTrap

;; Do Nothing

EndProcedure

Procedure InstallSongPackIni

	[Array5][1] := InstalledSongPacks
	[Array5][2] := [SongPackKey]				;; This must be unique for each song pack
	[Array5][3] := [SongPackCode],[SongPackTitle]
;;	[Array5][4] := [FullPathToIni]
	[Array5][4] := [InstallationDirectory]\MPIANO.INI
	WritePrivateProfileString Using [Array5]

EndProcedure


Procedure HandleOldSongSampler

	if FileExists [InstallationDirectory]\z1odejoy.pws 


;; 	There must be an old song sampler

;; Lesson, Exercise and song files
		CreateDirectoryIfNecessary [InstallationDirectory]\1sampler
		CopyFiles From [InstallationDirectory] To [InstallationDirectory]\1Sampler Quietly
			z-songs.pwl
			z-songs.pwx
			z1odejoy.pws
			z1reagrd.pws
		EndCopyFiles

;; MIDI files
		CreateDirectoryIfNecessary [InstallationDirectory]\1sampler\MIDI
		CopyFiles From [InstallationDirectory]\MIDI To [InstallationDirectory]\1Sampler\MIDI Quietly
			broad*.mid
			zbrod*.mid
			zodea*.mid
			odjoy*.mid
			intro*.mid
		EndCopyFiles

;; Graphic files
		CreateDirectoryIfNecessary [InstallationDirectory]\1sampler\picts\pics16

		CopyFiles From [InstallationDirectory]\PICTS\PICS16 To [InstallationDirectory]\1Sampler\Picts\Pics16 Quietly
			sifc1.gif
			sipc2.gif
		EndCopyFiles
			

		CreateDirectoryIfNecessary [InstallationDirectory]\1sampler\picts\pics256

;; Now cleanup

		DeleteFiles from [InstallationDirectory]
			z-songs.pwl
			z-songs.pwx
			z1odejoy.pws
			z1reagrd.pws
		EndDeleteFiles
		DeleteFiles from [InstallationDirectory]\MIDI
			broad*.mid
			zbrod*.mid
			zodea*.mid
			odjoy*.mid
		EndDeleteFiles

		DeleteFiles From [InstallationDirectory]\PICTS\PICS16
			sifc1.gif
			sipc2.gif
		EndDeleteFiles

	Endif


EndProcedure

Procedure CleanupOldVersion

	if FileExists [WindowsSystemDirectory]\MWPMIDI.DLL
		DeleteFiles From [WindowsSystemDirectory]
			MWPMIDI.DLL
		EndDeleteFiles
	Endif
	if FileExists [WindowsSystemDirectory]\MWPMUSIC.DLL
		DeleteFiles From [WindowsSystemDirectory]
			MWPMUSIC.DLL
		EndDeleteFiles
	Endif
	if FileExists [WindowsSystemDirectory]\MWPART.DLL
		DeleteFiles From [WindowsSystemDirectory]
			MWPART.DLL
		EndDeleteFiles
	Endif

EndProcedure

Procedure CleanupV102
	DeleteFiles from [InstallationDirectory]
		im*.dll
		im*.del
		im*.dil
		im*.vbx
		vbrun300.dll
		msafinx.dll
		grid.vbx
		threed.vbx
		intro*.wav
	EndDeleteFiles
EndProcedure

