; Installer Script for TinyMeter V3.0

(set @default-dest (""))

(set @cpu (database "cpu"))

(set @source-file "TinyMeter")

(if (= @cpu "68020")
    (set @source-file "TinyMeter.020")
)

(if (= @cpu "68030")
    (set @source-file "TinyMeter.020")
)

(if (= @cpu "68040")
    (set @source-file "TinyMeter.020")
)

(if (= @cpu "68060")
    (set @source-file "TinyMeter.020")
)

(set @destdir
        (askdir
                (prompt "Where should I copy the TinyMeter main program ?")
                (help "Where's the problem?")
                (default "SYS:WBStartup/")
        )
)

(set @prefsdir
        (askdir
                (prompt "Where should I copy the TinyMeterPrefs program?")
                (help "Where's the problem?")
                (default "SYS:Prefs/")
        )
)

(set @CopyExample
        (askbool
                (prompt "Do you want to install the example MagicWB-settings file?\n\nNOTE: You will have to install the additional fonts and the background pictures. Make sure you install the background pattern in SYS:Prefs/Patterns/ !!!")
                (help "Where's the problem?")
        )
)

(set @CopyFonts
        (askbool
                (prompt "Do you want to install the additional Fonts?")
                (help "Where's the problem?")
        )
)

(if @CopyFonts
    (set @fontdir
            (askdir
                    (prompt "Where should the fonts be installed?")
                    (help "Where's the problem?")
                    (default "FONTS:")
            )
    )
)

(if @CopyFonts
    (set @dofixfont
            (askbool
                    (prompt "Should I do FixFonts for you?")
                    (help "Where's the problem?")
            )
    )
)

(set @CopyPatt
        (askbool
                (prompt "Do you want to install the additional Background patterns?")
                (help "Where's the problem?")
        )
)

(if @CopyPatt
    (set @pattdir
            (askdir
                    (prompt "Where should the background patterns be installed?")
                    (help "Where's the problem?")
                    (default "SYS:Prefs/")
            )
    )
)

(copyfiles
        (prompt "Installing the files." )
        (help "Where's the problem?" )
        (source @source-file )
        (infos)
        (newname "TinyMeter")
        (dest @destdir)
)

(tooltype
        (help "Where's the problem?" )
        (dest (@destdir "TinyMeter"))
        (noposition)
)

(copyfiles
        (prompt "Installing TinyMeter.")
        (help "Where's the problem?")
        (source "Prefs/TinyMeterPrefs")
        (infos)
        (dest @prefsdir)
)

(if @CopyExample
    (copyfiles
            (prompt "Installing example settings-file in ENV:")
            (help "Where's the problem?")
            (source "Env/")
            (all)
            (dest "ENV:")
    )
)

(if @CopyExample
    (copyfiles
            (prompt "Installing example settings-file in ENVARC:")
            (help "Where's the problem?")
            (source "Env/")
            (all)
            (dest "ENVARC:")
    )
)

(if @CopyFonts
    (copyfiles
            (prompt "Installing additional fonts.")
            (help "Where's the problem?")
            (source "ArtWork/Fonts/")
            (all)
            (dest @fontdir)
    )
)

(if @CopyFonts
    (if @dofixfont
            (run "SYS:System/FixFonts"
                    (prompt "Doing FixFonts... May take a while...")
                    (help "Where's the problem?")
            )
    )
)

(if @CopyPatt
    (copyfiles
            (prompt "Installing additional background patterns.")
            (help "Where's the problem?")
            (source "ArtWork/Patterns/")
            (all)
            (dest @pattdir)
    )
)

(tooltype
        (help "Where's the problem?" )
        (dest (@prefsdir "TinyMeterPrefs"))
        (noposition)
)

(copylib
        (prompt "Installing screennotify.library")
        (help "Where's the problem?")
        (source "Libs/screennotify.library")
        (dest "LIBS:")
        (confirm)
)

(copylib
        (prompt "Installing bgui.library")
        (help "Where's the problem?")
        (source "Libs/bgui.library")
        (dest "LIBS:")
        (confirm)
)

(exit
        "Have phun with this nice piece of soft!!!\n\nNow you should start TinyMeter, setup the position and size and press S to save these settings.\n\nAfter that, start TinyMeterPrefs to setup TinyMeter to your personal taste.\n\nIf there are any problems, don't hesitate to contact the author!"
)
