; $VER: Install_awebpng_awebplugin
; Description: Installer script for the "awebpng" plugin for AWeb-II 3.0+

(set #welcome
   (cat "This installation procedure will install the \"awebpng\" plugin module for AWeb_APL version 3.4 or higher.\n"
        "\n"
        "This plugin enables you to view PNG images in AWeb without the use of datatypes. The plugin has the following features:\n"
        "Optional progressive display\n"
        "Transparency\n"
        "Support for image scaling\n"
        "Support for CyberGraphics\n"
   )
)

(set #no-aweb3
   (cat "The \"AWeb_APL:\" assign was not found.\n\n"
        "This plugin can only be used with AWeb_APL."
   )
)

(set #show-docs
   (cat "All necessary files have been copied. "
      "To use the plugin, you have to do some additional setup. "
      "This is described in the documentation. "
      "From the documentation, you can run the setup script that performs the additional setup automatically. "
      "\n"
      "Do you want to view the documentation now?\n"
   )
)

; ---------------------------------------------------------------------------

(complete 0)

(message #welcome)

(if (not (exists "AWeb_APL:"))
   (abort #no-aweb3)
)

(complete 10)

(if (not (exists "AWeb_APL:awebplugin"))
   (makedir "AWeb_APL:awebplugin"
      (infos)
   )
)

(set srcdir (pathonly @icon))

(copyfiles
   (source (tackon srcdir "awebpng.awebplugin"))
   (dest "AWeb_APL:awebplugin")
   (infos)
)

(complete 50)

(if (not (exists "AWeb_APL:awebplugin/Docs"))
   (makedir "AWeb_APL:awebplugin/Docs"
      (infos)
   )
)

(copyfiles
   (source srcdir)
   (choices "awebpng.html" "awebpng.awebrx")
   (dest "AWeb_APL:awebplugin/Docs")
   (infos)
)

(complete 90)

(if
   (askbool
      (prompt #show-docs)
      (help #show-docs)
      (default 1)
   )
   (
      (run "run AWeb_APL:AWeb file:///AWeb_APL:awebplugin/Docs/awebpng.html")
   )
)

(set @default-dest (expandpath "AWeb_APL:awebplugin"))

(complete 100)
