home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga Shareware Floppies / ma64.dms / ma64.adf / AmiPhone / Install_AmiPhone < prev    next >
Text File  |  1996-07-07  |  9KB  |  199 lines

  1. ; Installation script for AmiPhone
  2. ; by Jeremy Friesner
  3.  
  4. (transcript "On installing AmiPhone...")
  5.  
  6. (if (exists "AmiTCP:" (noreq))
  7.  (
  8.     ; make sure "rx" is available
  9.     (if (not (exists "sys:rexxc/rx"))
  10.         (abort "This installer script needs to use the ARexx utility rx.\n\nPlease make sure the rx utility is installed in sys:rexxc and try to install again."))
  11.  
  12.     ; make sure we have the library that EditTextFile.rexx needs
  13.     (if (not (exists "libs:rexxsupport.library"))
  14.         (abort "This installer script needs rexxsupport.library in LIBS: to run.\n\nPlease install this library and then run this Installer script again."))
  15.  
  16.     ; try and make sure ARexx is running 
  17.     (run "rexxmast" (safe))
  18.  
  19.     ; if AmiPhoned is already in /serv, probably they've already installed before
  20.     (set DefaultUpdate (exists "amitcp:serv/AmiPhoned" (noreq)))
  21.  
  22.     ; don't want to make a distinction between 1 and 2
  23.     (if (> DefaultUpdate 0)    (set DefaultUpdate 1))
  24.     
  25.     (set PhoneUpdate
  26.           (askchoice
  27.              (prompt "Select which kind of install you want:")
  28.              (choices "First Time Install" "Update")
  29.              (default DefaultUpdate)
  30.              (help "If you've never installed AmiPhone on your system before, select First Time Install.  If you already have an earlier version, select Update.")
  31.        ))
  32.  
  33.     ; see if we can't guess what digitizer they use, based on files in their system drawer    
  34.     (set nGuessDefault 8)    ; default default is Generic
  35.     (if (exists "devs:ahi.device") (set nGuessDefault 7))
  36.     (if (exists "libs:toccata.library") (set nGuessDefault 3))
  37.     (if (exists "libs:delfina.library") (set nGuessDefault 6))
  38.     
  39.     ; ask the user what kind of digitizer they use
  40.     (set Digitizer
  41.           (askchoice
  42.                (prompt "Select which type of audio digitizer you will be using with AmiPhone:")
  43.                (choices "GVP DSS8" "PerfectSound" "A.M.A.S." "Toccata (Zorro II)" "Aura (PCMCIA)" "Sound Magic" "Delfina (Zorro II)" "AHI (Audio Library)" "Generic Parallel Port digitizer")
  44.                (default nGuessDefault)
  45.                (help "To send speech with AmiPhone, you need an audio digitizer connected to your parallel port.  If your digitizer model is not listed, please choose the Generic option.")
  46.           )
  47.     )
  48.     (select Digitizer
  49.         (set Digitizer "DSS8")
  50.         (set Digitizer "PERFECTSOUND")
  51.         (set Digitizer "AMAS")
  52.         (set Digitizer "TOCCATA")
  53.         (set Digitizer "AURA")
  54.         (set Digitizer "SOUNDMAGIC")
  55.         (set Digitizer "DELFINA")
  56.         (set Digitizer "AHI")
  57.         (set Digitizer "GENERIC")
  58.     )
  59.     (tooltype
  60.         (dest "AmiPhone")
  61.         (settooltype "SAMPLER" Digitizer)
  62.     )
  63.  
  64.     ; do they want to set up AmiPhone to receive voice-mail?
  65.     (if (= 1 (askbool 
  66.         (prompt "\n\nDo you wish to set up AmiPhone to receive voice mail?")
  67.         (help "AmiPhone is capable of receiving and storing voice messages while you are away from your computer.  This takes some disk space though, so if you're tight on space, you might want to leave it disabled.")
  68.         (default 0)
  69.         (choices "Yes" "No")))
  70.     ; answered yes
  71.     (
  72.         (set MessageDir 
  73.             (askdir
  74.                         (prompt "What directory would you like AmiPhone to keep the voice message files in?  (NOTE: You should not keep any other files in this directory!)")
  75.                             (help @askdir-help)
  76.                             (default "work:")))
  77.                 (set MaxDirSize
  78.                     (asknumber
  79.                         (prompt "\n\nWhat should be the maximum possible size (in kilobytes) of this directory be?  (Enter -1 for unlimited size)")
  80.                         (help "By setting this value, you can guarantee that AmiPhoned will not let anyone fill up your hard drive.  AmiPhoned counts the bytes in the voice mail directory on startup, and will reject messages if the directory size has reached the size you specify here.")
  81.                 (default 500)
  82.                 (range -1 1000000)))
  83.         
  84.         ; if a max size was set for the dir, use that as the max max file size as well
  85.         (if (> MaxDirSize -1)
  86.             (set MaxFileSize MaxDirSize)
  87.             (set MaxFileSize 1000000))
  88.         
  89.         (set MaxFileSize
  90.             (asknumber
  91.                 (prompt "\n\nWhat should the maximum possible size (in kilobytes) of each message be?  (Enter -1 to impose no special limit on individual message size)")
  92.                         (help "By setting this value, you can guarantee that no one message will fill up your entire allotment of message space.")
  93.                 (default -1)
  94.                 (range -1 MaxFileSize)))
  95.                 (set AwayVar
  96.                     (askstring
  97.                         (prompt "\n\nAmiPhone uses the presence of an ENV: var to determine whether or not you're away.  If the ENV: var is present, it takes a message, otherwise it puts up a requester for you.  What ENV: var would you like AmiPhone to look for?")
  98.                         (help "The ENV: var can be set manually by you, by a script, or perhaps by your screen blanker.")
  99.                 (default "BLANKED")))
  100.         
  101.         ; set the tooltypes!    
  102.         (set BlankString "")
  103.  
  104.         (tooltype
  105.             (dest "AmiPhone")
  106.             (settooltype "VOICEMAILDIR" MessageDir))
  107.         (tooltype
  108.             (dest "AmiPhone")
  109.             (settooltype "AWAYVAR" AwayVar))
  110.  
  111.         (if (> MaxDirSize -1)
  112.         ((tooltype
  113.             (dest "AmiPhone")
  114.             (settooltype "MAXVOICEMAILSIZE" (cat BlankString MaxDirSize))))
  115.         ;else
  116.         ((tooltype (dest "AmiPhone") (settooltype "MAXVOICEMAILSIZE"))))
  117.         
  118.         (if (> MaxFileSize -1)    
  119.         ((tooltype
  120.             (dest "AmiPhone")
  121.             (settooltype "MAXMESSAGESIZE" (cat BlankString MaxFileSize))))
  122.         ;else
  123.         ((tooltype (dest "AmiPhone") (settooltype "MAXMESSAGESIZE"))))
  124.         
  125.     )
  126.     ; answered no
  127.     (
  128.         ; clean out any related tooltypes 
  129.         (tooltype (dest "AmiPhone") (settooltype "VOICEMAILDIR"))
  130.         (tooltype (dest "AmiPhone") (settooltype "MAXVOICEMAILSIZE"))
  131.         (tooltype (dest "AmiPhone") (settooltype "MAXMESSAGESIZE"))
  132.         (tooltype (dest "AmiPhone") (settooltype "AWAYVAR"))
  133.     ))
  134.     
  135.     (set PhoneDir
  136.         (askdir
  137.                     (prompt "What directory would you like to put the AmiPhone executable in?  (no directory will be created)")
  138.                         (help @askdir-help)
  139.                         (default "AmiTCP:bin")
  140.                 )
  141.         )
  142.  
  143.     ; if PhoneDir isn't the usual, set the AMIPHONE env: var to let AmiPhoned know
  144.     (if (not (PatMatch "Amitcp:bin" PhoneDir))
  145.        (
  146.         (run (cat "echo " (tackon PhoneDir "AmiPhone") " >env:AMIPHONE"))
  147.         (run (cat "echo " (tackon PhoneDir "AmiPhone") " >envarc:AMIPHONE"))
  148.        )
  149.     )
  150.     
  151.     ; Copy AmiPhone and AmiPhoned to the bin and serv directories 
  152.     (copyfiles
  153.         (prompt (cat "Copying AmiPhone executable to " PhoneDir))
  154.         (help @copyfiles-help)
  155.         (source "")
  156.         (infos)
  157.         (pattern "AmiPhone")
  158.         (dest PhoneDir)
  159.     )
  160.     
  161.     (copyfiles
  162.         (prompt "Copying AmiPhoned daemon to amitcp:serv")
  163.         (help @copyfiles-help)
  164.         (source "")
  165.         (infos)
  166.         (pattern "AmiPhoned")
  167.         (dest "amitcp:serv")
  168.     )
  169.  
  170.     ; If we're doing a first-time install, update the user's AmiTCP config files
  171.     (if (= 0 PhoneUpdate)    
  172.       (
  173.         (delete "t:edit_text_succeeded")
  174.         (set ARexxRunString (cat "sys:rexxc/rx EditTextFile.rexx amitcp:db/services AmiPhone AmiPhone^^^^^^^^2956/tcp"))
  175.         (run
  176.             (ARexxRunString)
  177.             (prompt "If you plan to be running AmiPhone in conjunction with AmiTCP, the line:\n\nAmiPhone        2956/tcp\n\nneeds to be present in your amitcp:db/services file.  Do you wish me to update the file?  (Note:  AmiPhone will not receive connections if this line is not precisely as shown above!)")
  178.             (help "The inclusion of this line into amitcp:db/services is done by an ARexx script which is smart enough to correctly edit previous installations.  Also it will make a backup (to amitcp:db/services.bak) before writing.")
  179.             (confirm)
  180.         )
  181.         (if (not (exists "t:edit_text_succeeded"))
  182.            (message "For some reason, the config file editing script (EditText.rexx) could not complete successfully.  You'll need to edit your amitcp:db/services file yourself.  Look in the 'Installation' section of the AmiPhone docs for instructions."))
  183.                     
  184.         (delete "t:edit_text_succeeded")
  185.         (set ARexxRunString (cat "sys:rexxc/rx EditTextFile.rexx amitcp:db/inetd.conf AmiPhone AmiPhone^^^^stream^^^^^^tcp^nowait^root^^^^amitcp:serv/AmiPhoned"))
  186.         (run
  187.             (ARexxRunString)
  188.             (prompt "\nAlso, the line:\n\nAmiPhone    stream      tcp nowait root    amitcp:serv/AmiPhoned\n\nneeds to be present in your amitcp:db/inetd.conf file.  Do you wish me to update that file?\n(Note:  AmiPhone will not receive connections if this line is not precisely as shown above!)")
  189.             (help "The inclusion of this line into amitcp:db/inetd.conf is done by an ARexx script which is smart enough to correctly edit previous installations.  Also it will make a backup (to amitcp:db/inetd.conf.bak) before writing.")
  190.             (confirm)
  191.         )
  192.         (if (not (exists "t:edit_text_succeeded"))
  193.            (message "For some reason, the config file editing script (EditText.rexx) could not complete successfully.  You'll need to edit your amitcp:db/inetd.conf file yourself.  Look in the 'Installation' section of the AmiPhone docs for instructions."))
  194.       )
  195.     )
  196.     (message "\n\nAmiPhone is now installed.\nRe-start AmiTCP and try it out!")
  197.  )
  198.  (abort "\n\nAmiTCP does not appear to be set up on your system.  (Specifically, the assign AmiTCP: has not been made)  Because of this, I am unable to install AmiPhone.  Please install AmiTCP and then try again.")
  199. )