; *****************************
; *                           *
; *      MUIVideo-Install     *
; *   $VER: 2.05  (05.10.97)  *
; *       © 1997 by mice      *
; *        - AMCLUST -        *
; *                           *
; *****************************


(complete 0)

; Texte deutsch

(if (= @language "deutsch")
(
(set #falsekick
(cat "\nMUIVideo und MUITapes benoetigen zwingend OS3.0 oder höher."
))

(set #info
(cat "\nDieses Script installiert MUIVideo und alle "
     "dazugehörigen Dateien auf Ihre Festplatte. "
     "Bei der Installation wird ein Verzeichnis mit Namen "
     "\"MUIVideo\" angelegt in das alle wichtigen "
     "Programmteile kopiert werden."   
))

(set #info2
(cat "\nIm folgenden wird ihnen eine Textdatei angezeigt, "
     "die Sie über die gravierendsten Änderungen und "
     "Neuerungen dieser Version von \"MUIVideo\" informiert. "
     "Bitte lesen Sie den Text aufmerksam durch !\n\n"
     "Weitere Informationen entnehmen Sie bitte dem Guidefile."
))

(set #changes "\nCHANGES MUIVideo 2.00\n\n")

(set #check
(cat "\nEs wird nun geprüft, ob sich eine alte "
     "MUIVideo-Installation auf dem Zielpfad befindet. "
     "Diese wird nicht gelöscht sondern gegebenenfalls "
     "in \"MUIVideo_old\" umbenannt."
))

(set #oldmv "\nEs wurde eine MUIVideo-Installation gefunden !\n\n")

(set #oldmvbak
(cat "\nVon der alten Installation wird nun eine Sicherheitskopie "
     "mit Namen \"MUIVideo_old\" angelegt."
))

(set #muivhelp
(cat "\nMUIVideo ist eine Datenbank zur Filmverwaltung, deren "
     "Oberfläche mit Hilfe von MUI erzeugt wurde."
))

(set #datamess
(cat "\nIm folgenden werden alle von MUIVideo benötigten "
     "Datenfiles kopiert."
))

(set #prefsmess "\nNun werden die Default-Prefs zu MUIVideo installiert.")

(set #arexxmess
(cat "\nBitte wählen Sie nun aus, welche der bisher "
     "verfügbaren ARexx-Scripte für MUIVideo installiert "
     "werden sollen."
))

(set #readme "\nÄnderungen zur letzten Version...")

(set #mtmess
(cat "\nSoll das Zusatzprogramm MUITapes installiert werden ?"
     "\n\nMUITapes ist ein Zusatzmodul zu dem Programm MUIVideo. "
     "MUITapes ergänzt MUIVideo nun um eine Cassettenverwaltung. Der "
     "Datenaustausch erfolgt dabei über die ARexx-Ports der beiden "
     "Programme."
))

(set #getdest
(cat "Bitte nun den Zielpfad für MUIVideo wählen. "
     "Ein Verzeichnis \"MUIVideo\" wird angelegt."
))

(set #localmess
(cat "\nSollen die Local-Files zu MUIVideo kopiert werden ?"
     "\n\nDie Local-Files können benutzt werden, um weitere "
     "Sprachenkataloge für MUIVideo zu erzeugen."
))

(set #true "Ja")
(set #false "Nein")
(set #createdir "\nVerzeichnisse werden angelegt...")
(set #copymain  "\nKopieren von MUIVideo...")
(set #infotxt "Dokumentation/LIES_MICH!")
(set #regtxt "Dokumentation/Registrierung")
(set #guidename "Dokumentation/MUIVideo.guide")
(set #askguide  "\nSoll das Guide zu MUIVideo installiert werden ?")
(set #copyguide "Kopiere MUIVideo.guide")
(set #copydata  "Kopiere MUIVideo-Daten")
(set #copyprefs "Kopiere MUIVideo-Prefs")
(set #copyrexx  "Kopiere MUIVideo-Arexx")
(set #copytapes "Kopiere MUITapes")
)

; Text english

(
(set #falsekick
(cat "\nMUIVideo and MUITapes requires OS3.0 or higher."
))

(set #info
(cat "\n\nThis script installs MUIVideo and all "
     "needed files to your harddisk. "
     "During the installation a directory called "
     "\"MUIVideo\" will be created in which all "
     "files are copied."
))

(set #info2
(cat "\n\nNow a textfile will be shown, "
     "in which the most important changes and "
     "news of this version of \"MUIVideo\" are documented. "
     "Please read this text properly ! "
     "For more information please consult the guidefile."
))

(set #changes "\nCHANGES MUIVideo 2.00\n\n")

(set #check
(cat "\nTesting old MUIVideo-installation "
     "and copying of the mainprogram."
))

(set #oldmv   "\nAn old MUIVideo-installation has been found !\n\n")

(set #oldmvbak
(cat "\n\nNow a backup of the old installation will be made"
     "called \"MUIVideo_old\". "
))

(set #muivhelp
(cat "\nMUIVideo is a film database, its user "
     "interface was designed using MUI."
))

(set #datamess
(cat "\nNow all datafiles used by MUIVideo "
     "are copied."
))

(set #prefsmess "\nNow the default prefs of MUIVideo will be installed.")

(set #arexxmess
(cat "\nAll available ARexx-scripts for "
     "MUIVideo will be installed."
))

(set #readme "\nChanges to Version 1.5")

(set #mtmess
(cat "\nShall the tool MUITapes be installed ?"
     "\n\nMUITapes is an additional tool for MUIVideo. "
     "MUITapes adds a tape database to MUIVideo. The "
     "data exchange will be done via the ARexx-ports of both "
     "programs."
))

(set #getdest
(cat "Please select the destination directory for MUIVideo. "
     "A new directory \"MUIVideo\" will be created."
))

(set #localmess "\nCopying the local-files of MUIVideo")
(set #true "Yes")
(set #false "No")
(set #createdir "Creating directorys...")
(set #copymain  "Copy MUIVideo...")
(set #infotxt "Documentation/READ_ME!")
(set #regtxt "Documentation/Registration")
(set #guidename "Documentation/MUIVideo.guide")
(set #askguide  "\nShall I install the MUIVideo.guide ?")
(set #copyguide "Copy MUIVideo.guide...")
(set #copydata  "Copy MUIVideo-data...")
(set #copyprefs "Copy MUIVideo-prefs...")
(set #copyrexx  "Copy MUIVideo-Arexx...")
(set #copytapes "Copy MUITapes...")
(set #copycats  "\nInstalling catalog-files...")
)
)

; Test-Kick

(if (< (/ (getversion) 65536) 39)
    (abort #falsekick)
)

; Infotexte anzeigen und Zielverzeichnis waehlen

(message #info)

(set mvdest
    (askdir (prompt #getdest)
        (help @askdir-help)
        (default "Work:")
    )
)

(message #info2)
(run "run >nil: SYS:Utilities/MultiView" #infotxt (prompt #readme))
(set mvdest (tackon mvdest "MUIVideo"))
(set @default-dest mvdest)

; Auf bereits installiertes MUIVideo checken

(message #check)

(if (exists mvdest)
    (
        (set oldmv (cat mvdest "_old"))
        (message #oldmv "'" @default-dest "'." #oldmvbak)
        (rename mvdest oldmv)
        (rename (cat mvdest ".info") (cat oldmv ".info"))
    )
)

; Verzeichnisse anlegen

(makedir mvdest (infos) (prompt #createdir))
(makedir (tackon mvdest "ARexx"))
(makedir (tackon mvdest "Data"))
(makedir (tackon mvdest "Prefs"))
(makedir (tackon mvdest "Catalogs"))
(complete 10)

; Hauptprogramm, Regform und readme kopieren

(message #copymain)

(copyfiles
    (prompt #copymain)
    (source "MUIVideo")
    (dest mvdest)
    (infos)
)

(copyfiles
    (source #infotxt)
    (dest mvdest)
    (infos)
)

(copyfiles
    (source #regtxt)
    (dest mvdest)
    (infos)
)

; Locals kopieren

(if (= @language "deutsch")
    (
        (set vote
            (askbool
                (prompt #localmess)
                (choices #true #false)
                (help #localhelp)
            )
        )
        (if (= 1 vote)
            (copyfiles
                (prompt #copycdfiles)
                (source "catalogs")
                (dest (tackon mvdest "catalogs"))
                (help @copyfiles-help)
                (pattern "#?.cd")
                (files)
                (confirm)
            )
        )
    )
)

(if (= @language "english")
    (copyfiles
        (prompt #copycats)
        (source (tackon "catalogs" "english"))
        (ALL)
        (dest (tackon mvdest "catalogs/english"))
        (infos)
        (help @copyfiles-help)
        (confirm)
    )
)

(complete 30)

; Guidefile kopieren

(set vote
    (askbool
        (prompt #askguide)
        (choices #true #false)
        (help #guidehelp)
    )
)
(if (= 1 vote)
    (copyfiles
        (prompt #copyguide)
        (source #guidename)
        (dest mvdest)
        (all)
        (infos)
        (help @copyfiles-help)
    )
)

(complete 40)

; Datenfiles installieren

(message #datamess)

(copyfiles
    (prompt #copydata)
    (source "Data")
    (all)
    (dest (tackon mvdest "Data"))
    (help @copyfiles-help)
    (infos)
)

(complete 60)

(message #prefsmess)

(if (= @language "deutsch")
    (copyfiles
        (prompt #copyprefs)
        (source "Prefs/Deutsch")
        (all)
        (dest (tackon mvdest "Prefs"))
        (help @copyfiles-help)
        (infos)
    )
)

(if (= @language "english")
    (copyfiles
        (prompt #copyprefs)
        (source "Prefs/English")
        (all)
        (dest (tackon mvdest "Prefs"))
        (help @copyfiles-help)
        (infos)
    )
)

(complete 70)

(message #arexxmess)

(copyfiles
    (prompt #copyrexx)
    (source "ARexx")
    (all)
    (dest (tackon mvdest "ARexx"))
    (help @copyfiles-help)
    (infos)
    (confirm)
)

(complete 80)

; MUITapes installieren ?

(set vote
    (askbool
        (prompt #mtmess)
        (choices #true #false)
        (help #guidehelp)
    )
)
(if (= 1 vote)
    (
        (copyfiles
            (prompt #copytapes)
            (source "MUITapes")
            (all)
            (infos)
            (confirm)
            (dest (tackon mvdest "MUITapes"))
            (help @copyfiles-help)
        )
    )
)

(complete 100)

