; **** Installscript written by Markus Moenig            ****

; **** Special version for MainActor Broadcast           ****
; **** by MainConcept, GbR Moenig/Zabel, © 1994, 1995    ****

; **** This script requires the Installer from Commodore ****
; **** which is available for free.                      ****

; **** Version 1.0 of this script                        ****

(set ProductName		"MABroadcast Patch")	; product Name
(set VersionNum			"1.04")		; product version number
(set OldVersionNum	"1.03")		; product version number

(set MABName                    "MABroadcast")
(set DefaultMAB                 @default-dest)

(set OSVersion			(/ (getversion) 65536))
(set WBVersion			(/ (getversion "version.library" (resident)) 65536))
(set MABNum			 		(getversion "MABroadcast:MABroadcast"))
(set MABVer			 		(/ MABNum 65536))
(set MABRev					(- MABNum (* MABVer 65536)))

(set @default-dest "MABroadcast:")

(transcript "Installing %s Commodity..." ProductName)

(set WrongVersion
  ("%s%s%s"
	 "You dont have MainActor Broadcast v"
	 OldVersionNum
	 "\ninstalled !"
  )
)

; Here follow localized strings for the german and english texts
; used in the script. Adding a new language should be easy by copying
; the block and translating it.

(complete 10)

( if (AND (= MABVer 1) (= MABRev 03) )
		(
      (copyfiles
        (prompt "Copying Modules")
        (source "patch/modules/")
        (dest "MABROADCAST:")
        (all)
      )

			(working "Patching MABroadcast")
		  (run ("patcher MABroadcast:MABroadcast MABroadcast:MABroadcast patch/MABroadcast"))

			(working "Patching MVBroadcast")
		  (run ("patcher MABroadcast:MVBroadcast MABroadcast:MVBroadcast patch/MVBroadcast"))

			(exit)
		)
    (
    	(abort WrongVersion)
		)
)

(complete 95)
