home *** CD-ROM | disk | FTP | other *** search
- ; VMM Installer script by Torsten Ebeling
-
- (set @app-name "VMM")
-
- (welcome " Welcome to the VMM installation\n\n"
- " Virtual Memory for Amigas with a 68030 or 68040\n\n"
- " Copyright 1993/94 by Martin Apel\n\n"
- "Novice installs everything except the developer files.\n"
- "Advanced installs everything without confirmation.\n"
- "Expert installs everything with confirmation of all actions.\n")
-
- (if (= 0 @user-level)
- (set install_level %1101)
- (set install_level (askoptions (prompt "What do you want to install ?")
- (help @askoptions-help)
- (choices "VMM" "Library (includes VMM)" "Documents" "Icons")))
- )
-
- (set def_help "\n\nIf you need more help, please refer to \"VMM.guide\"\n\n")
- (set my_level @user-level)
-
- (if (BITAND %0011 install_level)
- (
- ; Set user mode to NOVICE
- (user 2)
-
- ;get destination directory for "VMM"
- (set vmmdest
- (askdir (prompt "Select the directory where you want to put the VMM executable.")
- (help "This should be a directory where you can easily access VMM "
- "via Workbench or CLI/Shell." def_help
- @askdir-help)
- (default "work:")
- (disk)
- )
- )
-
- (set @default-dest vmmdest)
- (set vmmtacked (tackon vmmdest "VMM"))
-
- ; ask, if we want to overwrite the old VMM if it exists
- (if (= 1 (exists vmmtacked))
- (
- (set old_version (getversion "l:VMM-Handler"))
- (set old_ver (/ old_version 65536))
- (set old_rev (- old_version (* old_ver 65536)))
-
- (set new_version (getversion "l/VMM-Handler_4K"))
- (set new_ver (/ new_version 65536))
- (set new_rev (- new_version (* new_ver 65536)))
-
- (if (= 0 (askbool (prompt "\nYou have already installed VMM "
- old_ver "." old_rev
- ".\nDo you wish to overwrite it with VMM "
- new_ver "." new_rev " ?\n")
- (help def_help @askbool-help)
- (default 1)
- (choices "Yes" "No")))
- (exit "VMM not installed.")
- )
- )
- )
-
- ; Set user mode to EXPERT
- (user my_level)
-
- ; detect the pagesize (4K or 8K)
- (set pagesize (run "ShowPageSize"))
-
- (if (BITAND %01 pagesize)
- (set sizestr "4K")
- else
- (if (BITAND %10 pagesize)
- (set sizestr "8K")
- )
- )
-
- (set pagesize (askchoice (prompt "\nPlease select the pagesize:\n\n"
- " ShowpageSize detected a pagesize of "
- sizestr ".\n")
- (help def_help @askchoice-help)
- (choices "4K pagesize" "8K pagesize")
- (default (- pagesize 1)))
- )
-
- ; copy the new VMM file to the destination directory
- (copyfiles (prompt ("\nCopying VMM to %s." vmmdest))
- (help def_help @copyfiles-help)
- (optional "oknodelete")
- (optional "askuser")
- (source "")
- (choices "VMM" "VMMStat")
- (dest vmmdest)
- (confirm)
- )
-
- ; copy the .info files
- (if (BITAND %1000 install_level)
- (copyfiles (prompt ("\nCopying VMMStat to %s." vmmdest))
- (help def_help @copyfiles-help)
- (source "")
- (choices "VMM.info" "VMMStat.info")
- (dest vmmdest)
- (confirm)
- )
- )
-
- ; copy the new VMM-Handler file to l: and rename it as "VMM-Handler"
- (set handler_name (cat "l/VMM-Handler_" sizestr))
- (copyfiles (prompt "\nCopying VMM-Handler to l:.")
- (help def_help @copyfiles-help)
- (optional "oknodelete")
- (optional "askuser")
- (source handler_name)
- (dest "l:")
- (newname "VMM-Handler")
- (confirm)
- )
-
- ; ask, if we want to overwrite the old preferences file
- (if (= 1 (exists "envarc:VMM.prefs"))
- (if (= 0 (askbool (prompt "\nYou have already installed a preferences file.\nDo you wish to overwrite it ?\n\n")
- (help def_help @askbool-help)
- (default 0)
- (choices "Yes" "No")))
- ; then
- (set overwrite 0)
- ; else
- (set overwrite 1)
- )
- )
-
- (if (= 1 overwrite)
- (
- ; copy the new preferences file to env: and envarc:
- (copyfiles (prompt ("\nCopying VMM.prefs to env:\n"))
- (help def_help @copyfiles-help)
- (optional "oknodelete")
- (optional "askuser")
- (source "env/VMM.prefs")
- (dest "env:")
- (confirm)
- )
- (copyfiles (prompt ("\nCopying VMM.prefs to envarc:\n"))
- (help def_help @copyfiles-help)
- (optional "oknodelete")
- (optional "askuser")
- (source "env/VMM.prefs")
- (dest "envarc:")
- (confirm)
- )
- )
- )
- )
- )
-
- (if (BITAND %0010 install_level)
- (
- (copylib (prompt ("\nCopying VMM.library to libs:."))
- (help def_help @copyfiles-help)
- (optional "oknodelete")
- (optional "askuser")
- (source "libs/VMM.library")
- (dest "libs:")
- (confirm)
- )
-
- (if (exists ("fd:") (noreq))
- ; then
- (set fd_dir "fd:")
- ; else
- (set fd_dir
- (askdir (prompt "Select the directory where you want to put the fd file.")
- (help def_help @askdir-help)
- (default "WORK:")
- (disk)
- )
- )
- )
-
- (copyfiles (prompt ("\nCopying VMM_lib.fd to " fd_dir "."))
- (help def_help @copyfiles-help)
- (optional "oknodelete")
- (optional "askuser")
- (source "fd/VMM_lib.fd")
- (dest fd_dir)
- (confirm)
- )
-
- (if (exists ("lib:") (noreq))
- ; then
- (set lib_dir "lib:")
- ; else
- (set lib_dir
- (askdir (prompt "Select the directory where you want to put the lib file.")
- (help def_help @askdir-help)
- (default "WORK:")
- (disk)
- )
- )
- )
-
- (copyfiles (prompt ("\nCopying VMM_lib.lib to " lib_dir "."))
- (help def_help @copyfiles-help)
- (optional "oknodelete")
- (optional "askuser")
- (source "lib/VMM_lib.lib")
- (dest lib_dir)
- (confirm)
- )
- )
- )
-
- (if (BITAND %0100 install_level)
- (
- ;get destination directory for "VMM.guide"
- (user 2)
- (set vmmdocs
- (askdir (prompt "Select the directory where you want to put\nthe documents and guides.")
- (help "This should be the directory where you normally put your guides.\n\n"
- def_help @askdir-help)
- (default "WORK:")
- (disk)
- )
- )
- (user my_level)
-
- (copyfiles (prompt ("\nCopying VMM.guide to " vmmdocs "."))
- (help def_help @copyfiles-help)
- (optional "oknodelete")
- (optional "askuser")
- (source "doc")
- (choices "VMM.guide" "VMM_lib.doc")
- (dest vmmdocs)
- (confirm)
- )
-
- (if (BITAND %1000 install_level)
- (copyfiles (prompt ("\nCopying VMM.guide to %s." vmmdocs))
- (help def_help @copyfiles-help)
- (source "doc")
- (choices "VMM.guide.info" "VMM_lib.doc.info")
- (dest vmmdocs)
- (confirm)
- )
- )
-
- )
- )
-