(welcome "      Welcome to the Xenolink Demo Install Utility\n")
(complete 0)

(set @default-dest "")

(if (= (exists ("Xenolink")) 0)
   (makedir ("Xenolink"))
)

(if (= (getassign "t") "") (makeassign "t" "ram:"))

; Unpack main archive

(complete 5)

(message ("\n\n\n\n\nXenolink's programs and data are stored in\n")
         ("compressed format.  Click on 'Proceed' and they\n")
         ("will now be decompressed."))

(makedir "t:Xenolink_Install_TempDir")

(copyfiles (source "Misc/Lha") (dest "t:Xenolink_Install_TempDir"))

(working ("Decompressing Xenolink files..."))

(run ("t:Xenolink_Install_TempDir/Lha -a -m -x -q -r x Misc/Main2.Lha"))

(complete 35)

(run ("t:Xenolink_Install_TempDir/Lha -a -m -x -q -r x Misc/Main1.Lha"))

; Get the screenmode

(complete 90)

(set ScreenMode
   (askchoice
      (prompt "Which ScreenMode would you like to use?")
;      (help @askchoice-help)
      (help "Select NTSC if you are not sure. The node.config allows you to "
            "change the default setting for higher or lower resolutions")
      (choices "PAL  - 640 x 264" "NTSC - 640 x 208")
      (default 0)
   )
)
(if (= ScreenMode 0)
   (
      (run ("rename Xenolink/Configuration/Node.Config.PAL Xenolink/Configuration/Node.Config"))
      (run ("delete Xenolink/Configuration/Node.Config.NTSC"))
   )
)
(if (= ScreenMode 1)
   (
      (run ("rename Xenolink/Configuration/Node.Config.NTSC Xenolink/Configuration/Node.Config"))
      (run ("delete Xenolink/Configuration/Node.Config.PAL"))
   )
)

; Initialise

(complete 95)
(message ("The Installer program will now initialise Xenolink's demo configuration"))


(makeassign "XENOLINK" ("Xenolink"))
(makeassign "XCONFIG" "Xenolink/Configuration")
(makeassign "MSG" "Xenolink/Msgs")
(makeassign "DOWNLOADING" "Xenolink/Downloading")
(run ("Xenolink:Utilities/TextConfig"))
(run ("Assign LIBS: Xenolink:Libs ADD"))
(run ("Xenolink:Utilities/TextConfig"))
(run ("SetDate Xenolink:Text/#?"))
(execute ("Misc/MakeBBSScript >NIL: Xenolink/"))
(delete "t:Xenolink_Install_TempDir/Lha")
(delete "t:Xenolink_Install_TempDir")
(delete "Misc/Lha")
(delete "Misc/MakeBBSScript")
(delete "Misc/Main1.lha")
(delete "Misc/Main2.lha")

(complete 100)

(message ("Two new Icons called StartBBS & StopBBS have been\n")
         ("created in the Xenolink_Demo drawer.  You will need\n")
         ("to close the Xenolink_Demo drawer window and re-open\n")
         ("it in order to access them.  Double-click on\n")
         ("'StartBBS' to begin the demo.\n\n")
         ("** IMPORTANT - LOGIN INSTRUCTIONS **\n\n")
         ("To log onto the Xenolink BBS Demo, click on the\n")
         ("'Login' Button in the lower left hand corner of the\n")
         ("main screen.\n\n")
         ("Log on at the 'Name' prompt as 'SYSOP' with a\n")
         ("password of 'XENOLINK', then enjoy!\n"))

