(set @default-dest "FAME:")
(set @app-name "5D-ZippySearch")

(set FAMEPath
  (askdir
    (prompt "Where is your FAME directory located?")
    (help "You have to specify where your FAME is located!")
    (default @default-dest)
  )
)

(set InstallZippy
  (askbool
    (prompt "5D-ZippySearch will be installed into \n\n"
            (FAMEPath))
    (help "5D-ZippySearch will be installed into '"
          (tackon (FAMEPath) "Doors/5D/5D-ZippySearch")
          "'.  If that directory does not exist, it will be created."
          "  To proceed press ok, else press abort installation.")
    (default 1)
  )
)

(if (= InstallZippy 1)
(
  (if (not (exists (tackon (FAMEPath) "Doors")))
   (makedir (tackon (FAMEPath) "Doors") (infos))
  )

  (if (not (exists (tackon (FAMEPath) "Doors/5D")))
   (makedir (tackon (FAMEPath) "Doors/5D") (infos))
  )

  (if (not (exists (tackon (FAMEPath) "Doors/5D/5D-ZippySearch")))
   (makedir (tackon (FAMEPath) "Doors/5D/5D-ZippySearch") (infos))
  )

  (copyfiles
    (source "Doors/5D/5D-ZippySearch/5D-ZippySearch")
    (dest (tackon (FAMEPath) "Doors/5D/5D-ZippySearch"))
    (all)
    (infos)
  )

  (set Continue
    (askbool
      (prompt "Do you want to have 5D-ZippySearch.guide installed into '"
              (tackon (FAMEPath) "Doors/5D/5D-ZippySearch")
              "'?")
      (help "5D-ZippySearch.guide will be installed into '"
            (tackon (FAMEPath) "Doors/5D/5D-ZippySearch")
            "'. To proceed press ok, else press abort installation.")
      (default 1)
    )
  )

  (if (= Continue 1)
  (
    (copyfiles
      (source "Doors/5D/5D-ZippySearch/5D-ZippySearch.guide")
      (dest (tackon (FAMEPath) "Doors/5D/5D-ZippySearch"))
      (all)
      (infos)
    )
  )
  )

  (set Continue
    (askbool
      (prompt "Do you want to have the 'Z' command installed into '"
              (tackon (FAMEPath) "Settings/Doors/BBSCMD")
              "'?"
      )
      (help "The 'Z' command will be installed into '"
            (tackon (FAMEPath) "Settings/Doors/BBSCMD")
            "'. If that directory does not exist, it will be created. "
            "To proceed press ok, else press abort installation.")
      (default 1)
    )
  )

  (if (= Continue 1)
  (
     (if (not (exists (tackon (FAMEPath) "Settings")))
     (makedir (tackon (FAMEPath) "Settings"))
    )

    (if (not (exists (tackon (FAMEPath) "Settings/Doors")))
     (makedir (tackon (FAMEPath) "Settings/Doors"))
    )

    (if (not (exists (tackon (FAMEPath) "Settings/Doors/BBSCMD")))
     (makedir (tackon (FAMEPath) "Settings/Doors/BBSCMD"))
    )

    (copyfiles
      (source "Settings/Doors/BBSCMD/Z")
      (dest (tackon (FAMEPath) "Settings/Doors/BBSCMD"))
      (all)
      (infos)
    )
  )
  )
)
)

