
;
; Installer Updater Script for LaMeRKiLLeR 2.03
; $VER: 1.2 (26.8.97)
;

(set @app-name "LaMeRKiLLeR")
(set @user-level 2)
(set cpu (database "cpu"))

(set @default-dest "SYS:")
(procedure WAITX (set X 1) ( (while (< X 90) (set X (+ X 1)))))
(procedure WAITL (set X 1) ( (while (< X 2350) (set X (+ X 1)))))

(working "\n\n\n\n\n\n\n\n\n\n\n\n\n|LaMeR KiLLeR 2.03|") (WAITX)
(working "\n\n\n\n\n\n\n\n\n\n\n\n|LaMeR KiLLeR 2.03|") (WAITX)
(working "\n\n\n\n\n\n\n\n\n\n\n|LaMeR KiLLeR 2.03|") (WAITX)
(working "\n\n\n\n\n\n\n\n\n\n|LaMeR KiLLeR 2.03|") (WAITX)
(working "\n\n\n\n\n\n\n\n\n|LaMeR KiLLeR 2.03|") (WAITX)
(working "\n\n\n\n\n\n\n\n|LaMeR KiLLeR 2.03|") (WAITX)
(working "\n\n\n\n\n\n\n|LaMeR KiLLeR 2.03|") (WAITX)
(working "\n\n\n\n\n\n|LaMeR KiLLeR 2.03|") (WAITX)
(working "\n\n\n\n\n|LaMeR KiLLeR 2.03|") (WAITX)
(working "\n\n\n\n|LaMeR KiLLeR 2.03|") (WAITX)
(working "\n\n\n|LaMeR KiLLeR 2.03|") (WAITX)
(working "\n\n|LaMeR KiLLeR 2.03|") (WAITX)
(working "\n|LaMeR KiLLeR 2.03|") (WAITX)
(working "|LaMeR KiLLeR 2.03|") (WAITX)
(working "|LaMeR KiLLeR 2.03|") (WAITL)
(working "-|LaMeR KiLLeR 2.03|-") (WAITX)
(working "\\-|LaMeR KiLLeR 2.03|-/") (WAITX)
(working "/\\-|LaMeR KiLLeR 2.03|-/\\") (WAITX)
(working "-/\\-|LaMeR KiLLeR 2.03|-/\\") (WAITX)
(working "-/\\- |LaMeR KiLLeR 2.03| -/\\") (WAITX)
(working "-/\\-  |LaMeR KiLLeR 2.03|  -/\\") (WAITX)
(working "-/\\-   |LaMeR KiLLeR 2.03|   -/\\") (WAITX)
(working "-/\\-    |LaMeR KiLLeR 2.03|    -/\\") (WAITX)
(working "-/\\-     |LaMeR KiLLeR 2.03|     -/\\") (WAITX)
(working "-/\\-      |LaMeR KiLLeR 2.03|      -/\\") (WAITX)
(working "-/\\-       |LaMeR KiLLeR 2.03|       -/\\") (WAITX)
(working "-/\\-        |LaMeR KiLLeR 2.03|        -/\\") (WAITX)
(working "-/\\-         |LaMeR KiLLeR 2.03|         -/\\") (WAITX)
(working "-/\\-          |LaMeR KiLLeR 2.03|          -/\\") (WAITX)
(working "-/\\-           |LaMeR KiLLeR 2.03|           -/\\") (WAITX)
(working "-/\\-            |LaMeR KiLLeR 2.03|            -/\\") (WAITX)
(working "-/\\-             |LaMeR KiLLeR 2.03|             -/\\") (WAITX)
(working "-/\\-              |LaMeR KiLLeR 2.03|              -/\\") (WAITX)
(working "-/\\-               |LaMeR KiLLeR 2.03|               -/\\") (WAITX)
(working "-/\\-                |LaMeR KiLLeR 2.03|                -/\\") (WAITX)
(working "-/\\-                 |LaMeR KiLLeR 2.03|                 -/\\") (WAITX)
(working "-/\\-                  |LaMeR KiLLeR 2.03|                  -/\\") (WAITX)
(working "-/\\-                   |LaMeR KiLLeR 2.03|                   -/\\") (WAITX)
(working "-/\\-                    |LaMeR KiLLeR 2.03|                    -/\\") (WAITX)
(working "-/\\-                     |LaMeR KiLLeR 2.03|                     -/\\") (WAITX)

        (set
               @prog-source (pathonly @icon)
        )

        (message "Welcome to the updater script of:\n\n|LaMeR KiLLeR 2.03|\n(26-08-97)\n\nby Zapek\n\nThe Ultimate AmIRC FrontDoor\n\nYou need LaMeRKiLLeR 2.0 before installing this patch to upgrade it to 2.03.")

        (complete 0)

        (set @destdir (askdir  (prompt "Please select the AmIRC drawer.\n")
                 (help "Select the drawer where AmIRC is. LaMeRKiLLeR will be patched automatically.")
                 (default "SYS:")))

        (set @amircdir (tackon @destdir "rexx"))

        (set @lkdir (tackon @destdir "rexx/LaMeRKiLLeR"))

        (if (not (exists @lkdir))
        (exit "You don't have LaMeRKiLLeR 2.0 installed. Sorry..." (quiet) ))

        (set @muidir (tackon @prog-source "MUIRexx"))

        (set @muitar (tackon @prog-source "SYS:Rexxc"))

        (copylib (prompt "LaMeRKiLLeR needs MUIRexx 3.0a to build the GUI.") (source @muidir) (dest @muitar) (confirm) (help "MUIRexx is an interface between MUI and ARexx ports.\nIt is supplied with the current archive. If not, then you may have a wrong archive."))

        (working "Updating LaMeRKiLLeR...")

        (complete 30)

        (set result (run (cat "spatch -oLaMeRKiLLeR -pLaMeRKiLLeR.pch " (tackon @lkdir "LaMeRKiLLeR"))))
        (if (<> result 0)
            (abort "Error updating LaMeRKiLLeR"))

        (working "Updating LKGUI...")

        (complete 60)

        (set result (run (cat "spatch -oLKGUI -pLKGUI.pch " (tackon @lkdir "LKGUI"))))
        (if (<> result 0)
            (abort "Error updating LKGUI"))

        (copyfiles (source "LKGUI") (dest @lkdir ))

        (copyfiles (source "LaMeRKiLLeR") (dest @lkdir))

        (complete 90)

        (delete "LaMeRKiLLeR")

        (delete "LKGUI")

        (working "Copying HELP file")

        (copyfiles (source "LaMeRKiLLeR.guide") (dest @lkdir))

        (working "Copying Startup files")

        (copyfiles (source "Startup.AmIRX") (dest @amircdir))

        (copyfiles (source "Shutdown.AmIRX") (dest @amircdir))

        (complete 100)

        (message "Installation complete!\n\nLaMeRKiLLeR 2.03 is now installed.")
