#!wish -f
#
# Example client of the install.tcl infrastructure.
#
# The commands below set up default values for certain
# system-dependent variables in the exmh program.
# A dialog box is created that allows you to edit these
# values, so you probably won't edit this file directly,
# unless you are a developer that is adapting it to your tool.
#
# Invoke with:
# wish4.1 ./webtk.install
#
if {$tk_version < 4.1} {
    error "WebTk requires Tk 4.1 or later"
} else {
    if [catch {file join bin install.tcl} path] {
	error "WebTk requires the non-beta version of Tcl 7.5/Tk 4.1"
    }
    source $path
}
set vers 1.0
set patch beta5
set date 12/4/96

# Define app name and install save file
install_init WebTk .webtkinstall

install_version	WebTk(version) "$vers$patch $date" {WebTk Version number}

# The following are settings inside exmh that depend on the local environment
install_var	maintainer  Brent.Welch@eng.sun.com {Target of error mailings}
install_var	WebTk(server) {}		{HTTPD proxy server}
install_var	WebTk(port) {} 	{Proxy port}


# The following are installation directories, which you may have to adjust,
# and install file patterns (glob/sed), which should not be site dependent.
install_dir	WebTk(library)	/usr/local/lib/webtk$vers {Script library directory}
install_glob WebTk(library)	lib/*.tcl lib/tclIndex lib/defaults.app 
install_dir  WebTk(bin)		/usr/local/bin		{Install bin directory}
install_testdir WebTk(library)	./lib
install_glob WebTk(bin)		bin/webtk bin/magemap
install_sed  .MASTER		bin/webtk bin/imagemap
install_dir  WebTk(html)	/usr/local/lib/webtk$vers/html	{Install html directory}
install_glob WebTk(html)	html/*.html html/template html/form
install_testdir WebTk(html)	./html
install_dir  WebTk(images)	/usr/local/lib/webtk$vers/images {Install images directory}
install_testdir WebTk(images)	./images
install_glob WebTk(images)	images/*.gif images/*.xbm images/*.map
install_dir  WebTk(cache)	~/.webtk_cache {Image cache directory}

# lib/*.mask lib/*.bitmap 

# Define test command
install_test exec ./bin/webtk &

# User information

install_help "
Installation for WebTk, an HTML Editor and Browser.

Each entry you make is used to patch webtk.MASTER in order to
make the webtk script.  So, make sure the file system
pathnames are correct for your system.  The fields are described below.

* Wish absolute pathname.  webtk is a script.  It needs to be run by the
	Tcl/Tk shell, \"wish\" with version Tk 4.1 or higher.
	Enter the complete, absolute pathname.
*  Version number.  You don't need to change this.
* Error mailing target.  Change it if you want to see errors at your site.
	Otherwise I'll get them, which is OK.
* HTTPD proxy server.  Leave this blank if you don't use roxies.
* Proxy port.  Port for your proxy server.

HINT: the Find/Replace button is used to to global substitutions
on your installation settings.

* Script Library.  The runtime location of the webtk .tcl files.
    The installer copies files there, and webtk expects to find them
    there at runtime. The \"Script Library\" should be private to webtk
    (unshared with other apps).
* Install bin directory.  The place to install the main webtk script.
* Install html directory.  The place to install the html pages.
* Install images directory.  The place to install the images for html pages.
	NOTE:  the pages expect the html and images directory to be peers:
	e.g. ./html and ./images.  The <img> tags have \"../images/\" in them.

Note: if you use AFS read-only volues for WebTk, you'll have to install
into the read-write volume and then edit the webtk script by hand to 
change the WebTk(library), WebTk(images), and WebTk(html) settings to
refer to the read-only volume.

After you set things up, then:
1. Patch - apply site-dependent patches to webtk.
2. TclIndex - compute the auto-load library index.
3. Test - run the patched script.
4. Verify - see what the Install will do.
5. Install - install webtk.

The Test button runs webtk and automatically switches the script library
run-time value to \"./lib\" for the duration of the test.    

When you press \"Patch\" the configuration is saved in the
file named .webtkinstall.  If you save this to an alternate
name (e.g., .webtkinstall.sun4) you can use the Conf button to choose
among ../*/.webtkinstall* files.
"

# Go for it
install_dialog "WebTk Installer"

