; $VER: Install CONNEXION V1.2 (January 1997)
; This script is used to install CONNEXION from ANARCHY SOFTWARE

;The name of the application being installed...
(set @app-name "Connexion v1.2")
;The text for the 'Abort' button is changed...
(set @abort-button "Run away!")
;The name for the drawer to be created in the user-specified destination
;which will hold all the files needed to run the application...
(set @drawer-name "Connexion")
;Default user level...(0=Novice 1=Average 2=Expert)
(set @user-level 2)
;Set space (in bytes) required for installation of program (0 if unknown)...
(set @space-required 167000)

(complete 0)

;Show an introductory message to the user...
(message
    "\nThank you for obtaining an item of software from\n\n"
    "ANARCHY SOFTWARE - AMIGA DIVISION\n\n"
    "This script will hopefully make installing your new "
    "piece of software really easy.  Enjoy!\n\n"
)

;Let the user choose the path for the directory...
(set @default-dest
    (askdir
        (prompt (cat "Please select the path to install to.\n"
                     "NOTE: A new drawer called \""
                     @drawer-name
                     "\"\n"
                     "will be created in the path you specify.")
        )
    (help (cat "\nIf you do not choose a path to install "
               @app-name
               " to...\n\n"
               "<PYTHON>\n <KNIGHTS OF NI>\n\n"
               "  You will not pass through this wood...\n"
               "  ...aaaliiive. (Ni!)\n\n"
               " </KNIGHTS OF NI>\n</PYTHON>\n")
    )
    (default "SYS:")
    )
)

(set @space-available (getdiskspace @default-dest))

;Make sure there's enough space on the specified path for installation...
(if (>= @space-available @space-required)
    ;There is enough space, so make the directory in the path specified...
    (makedir
        (tackon @default-dest @drawer-name)
        (infos)
    )
    ;There isn't enough space... abort the installation!
    (abort (cat "You don't have enough free space in the "
                "destination you specified for me to install "
                @app-name
                ".\n  You need "
                @space-required
                " bytes of space, and you only have "
                @space-available
                " bytes available!\n\n"
                "Free up some space, and try again!")
    )
)

(complete 10)

;Copy all the files to the destination drawer...
(copyfiles
    (prompt (cat "Copying files to " @default-dest))
    (help @copyfiles-help)
    (source "")
    (dest (tackon @default-dest @drawer-name))
    (all)
)

;Display a thank-you message to the user...
(message
    "\nThere.  That wasn't too painful was it?\n\n"
    "If you don't already know, ANARCHY SOFTWARE - AMIGA DIVISION "
    "has a site on the web, where more pieces of software "
    "and information on upcoming releases can be found.  "
    "Check it out, at...\n\n"
    "Http://www.nebula.demon.co.uk/anarchy/\n\n"
    "Anyhow, I hope you enjoy "
    @app-name
    ".\n\nThanks again,\n"
    "Dave (Anarchy Software Amiga division)"
)

(complete 100)
(set @default-dest (tackon @default-dest @drawer-name))
(exit)
