; $VER: InstallAdd-on v1.0 by MaLC0MN (15-06-1997)
; Installer script for the MatWB Add-on package by MaLC0MN

(complete 0)

(message "\nWelcome to the \"MatWB Add-on package\" by MaLC0MN.\n\n"
         "This package features 59 additional window patterns,\n"
         "6 additional \"MatWB\" backdrops, 7 alert sounds with\n"
         "a program to choose one randomly each bootup,\n"
         "some cool device icons and a bonus \"Rainboot2\"\n"
         "config file with a \"MatWB\" style boot picture.\n\n"
         "Click \"Proceed\" now to install this cool stuff!"
)

(if (NOT (exists "MATWB:" (noreq))) ((message "\nHey euhm, you don't seem to have the \"MATWB:\" assign!\n"
                                              "You've been tampering with it? Why, man... It's so\n"
                                              "convenient to have an assign. All the stuff is together\n"
                                              "in one place. If you want to de-install it, just remove\n"
                                              "the assign, remove that one dir, adjust some prefs and\n"
                                              "away you go! Anyway, if you still wanna proceed then\n"
                                              "make the appropriate choice!"
                                     )
                                     (set #backdrops
                                          (askdir (prompt "\nWell then, where do you wish to install\n"
                                                          "the additional \"MatWB\" backdrops?"
                                                  )
                                                  (help @askdir-help)
                                                  (default "MATWB:")
                                                  (newpath)
                                                  (disk)
                                          )
                                     )
                                     (if (<= (getdiskspace #backdrops) 461988) (exit "\nUnfortunately, you don't have enough space left\n"
                                                                                     "in your chosen destination dir!\n\n"
                                                                                     "Free some and try again!"
                                                                                     (quiet)
                                                                               )
                                     )
                                     (set #patterns
                                          (askdir (prompt "\nAnd euhm, where do you wish to install\n"
                                                          "the additional \"MatWB\" window patterns?"
                                                  )
                                                  (help @askdir-help)
                                                  (default "MATWB:")
                                                  (newpath)
                                                  (disk)
                                          )
                                     )
                                     (if (<= (getdiskspace #patterns) 497298) (exit "\nUnfortunately, you don't have enough space left\n"
                                                                                    "in your chosen destination dir!\n\n"
                                                                                    "Free some and try again!"
                                                                                    (quiet)
                                                                              )
                                     )
                                     (set #sounds
                                          (askdir (prompt "\nAnd last the, euhm, alert sounds?")
                                                  (help @askdir-help)
                                                  (default "MATWB:")
                                                  (newpath)
                                                  (disk)
                                          )
                                     )
                                     (if (<= (getdiskspace #sounds) 252338) (exit "\nUnfortunately, you don't have enough space left\n"
                                                                                  "in your chosen destination dir!\n\n"
                                                                                  "Free some and try again!"
                                                                                  (quiet)
                                                                            )
                                     )
                                    )
                                    ((message "\nAh, I see that you have properly installed \"MatWB 3.0\"\n"
                                              "The additional backdrops, patterns and alert sounds\n"
                                              "will be added to your \"MATWB:\" assign."
                                     )
                                     (if (<= (getdiskspace "MATWB:") 1214090) (exit "\nUnfortunately, you don't have enough space left\n"
                                                                                    "to add all of this this cool stuff!\n\n"
                                                                                    "Try to free some space and come again.\n\n"
                                                                                    "I'm terribly sorry..."
                                                                                    (quiet)
                                                                              )
                                     )
                                     (set #backdrops "MATWB:Patterns/WBPatterns")
                                     (set #patterns "MATWB:Patterns/WindowPatterns")
                                     (set #sounds "MATWB:Sounds")
                                    )
)

(complete 10)

(working "\nAdding additional \"MatWB\" backdrops...")
(copyfiles (help @copyfiles-help)
           (source "Patterns/WBPatterns/")
           (dest #backdrops)
           (pattern "MLC-#?")
           (files)
           (nogauge)
)

(complete 25)

(working "\nAdding additional \"MatWB\" window patterns...")
(copyfiles (help @copyfiles-help)
           (source "Patterns/WindowPatterns/")
           (dest #patterns)
           (pattern "MLC-#?")
           (files)
           (nogauge)
)

(complete 40)

(working "\nAdding new \"MatWB\" alert sounds...")
(copyfiles (help @copyfiles-help)
           (source "Sounds/")
           (dest #sounds)
           (pattern "MLC-#?")
           (files)
           (nogauge)
)

(complete 55)

(set #darksound
     (askdir (prompt "\nSelect your WBStartUp drawer please.")
             (help @askdir-help)
             (default "SYS:WBStartUp")
             (newpath)
             (disk)
     )
)

(working "\nAdding \"DarkSound v2.5\" to your WBStartUp drawer...")
(copyfiles (help @copyfiles-help)
           (source "Utilities/DarkSound")
           (dest #darksound)
           (files)
           (infos)
           (noposition)
           (nogauge)
)

(complete 70)

(working "\nAdjusting tooltypes of \"DarkSound v2.5\" to your pathnames...")
(set #darksound (tackon #darksound "DarkSound"))
(set #sounds (tackon #sounds "MLC-Lakodalom00.8svx"))
(tooltype (help "No help here!")
          (dest #darksound)
          (settooltype "Start_Name" #sounds)
          (settooltype "Alert_Name" #sounds)
)

(complete 100)

(exit "\nAll done!\n\n"
      "All this cool stuf has been added!\n"
      "Now exit this script and reboot your machine!\n\n"
      "Enjoy!"
      (quiet)
)
