home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / new / comm / mail / thor / installthor < prev    next >
Text File  |  1994-03-24  |  14KB  |  583 lines

  1. ;*************************************************************************
  2. ;    Title:
  3. ;        Install-Thor
  4. ;*************************************************************************
  5. ;    Description:
  6. ;        Commodore Installer Script for the Thor software
  7. ;*************************************************************************
  8. ;    Author:
  9. ;        Øyvind Ellefsen
  10. ;*************************************************************************
  11. ;    Still to do:
  12. ;
  13. ;*************************************************************************
  14. ;    History:
  15. ;        4/8-93   - First tries. Ver 00
  16. ;        4/8-93   - Working version. Copying files&stuff.
  17. ;        5/8-93   - Asking for install from disk 
  18. ;        7/8-93   - What's up? New beta.. Shit! 
  19. ;        5/9-93   - Ok. Final effort.. 
  20. ;        21/9-93  - Changes Changes... 
  21. ;        23/9-93  - Removed beta-strings. Polished help-texts. Release Ver.
  22. ;        7/10-93  - Added Reqtools.library install.
  23. ;        10/10-93 - Convert, ChoiceType, User-startup, CheckForThor
  24. ;        12/10-93 - Assign-handling
  25. ;       13/10-93 - Custom ReqTools.library install
  26. ;         14/10-93 - Device/Volume check
  27. ;        1/11-93  - Added some CfgArchivers stuff (some bugs too)
  28. ;        4/11-93  - Removed bugs
  29. ;        5/1-94   - Optimized a little. More BBSTypes.
  30. ;        9/1-94   - Added Hippo types, and convert option.
  31. ;        20/2-94  - Thor files is now packed with lha
  32. ;
  33. ;Changes made by Petter Nilsen:
  34. ;
  35. ;        3/3-94   - Will no longer ask for to convert of the database on a
  36. ;                  first time install.
  37. ;                - Will flush library before running "basemanager"
  38. ;                - Better check for if THOR is already installed.
  39. ;                  (checks for "THOR:libs/bbsread.library" and not 
  40. ;                  "THOR:THOR")
  41. ;                - Uses LhX for un-archiving
  42. ;                - Made all library-names lower case
  43. ;       4/3-94   - Added code to copy the keyfile (if available) to THOR:
  44. ;      24/3-94   - Changed to use LHEX due to a bug in LhX.
  45. ;*************************************************************************
  46. ;
  47. ;******************************************************
  48. ;***** SET UP OUR VARIABLES AND OTHER SUCH STUFF ******
  49. ;******************************************************
  50.  
  51. ; some useful variables
  52.     (set true 1)
  53.     (set false 0)
  54.     (set yes true)
  55.     (set no false)
  56.     (set is_a_file 1)
  57.     (set is_a_dir 2)
  58.     (set quote "\"")
  59.     (set newline "\n")
  60.     (set nothing "")
  61.     (set Convert Yes)
  62.  
  63. ; set up our delete options
  64.     (delopts "AskUser" "OkNoDelete" "Force")
  65.  
  66. ; some useful procedures
  67.     ; change userlevel to expert
  68.     (procedure expert_level
  69.         (
  70.             (user 2)
  71.         )
  72.     )
  73.  
  74. ; reset userlevel back to default
  75.     (procedure default_level
  76.         (
  77.             (user default-level)
  78.         )
  79.     )
  80.  
  81. ; store off userlevel
  82.     (procedure save_default_level
  83.         (
  84.             (set default-level @user-level)
  85.         )
  86.     )
  87.  
  88. ; some overused strings
  89. (set omp (cat "One moment please..." newline))
  90.  
  91.  
  92. ; introduce ourselfs to the viewers
  93. (welcome "Welcome to the Thor installer.  This installer uses "
  94.     "the Commodore Amiga Installer.  All of our future Thor releases "
  95.     "will be using this installer and we would like to get any feedback "
  96.     "that might help in improving the installation procedure." newline
  97. )
  98.  
  99.  
  100. ; first reset the user level so that the novice can see whats going on
  101.     (save_default_level)
  102.     (expert_level)
  103.  
  104. ;Make assign to install from
  105.     (makeassign "Thor_Install" "" (safe))
  106.  
  107.  
  108. ;******************
  109. ;** Check Memory **
  110. ;******************
  111.  
  112. (run "Avail flush")
  113.  
  114. (set Running (run "Thor_Install:CheckForLib"))
  115.  
  116. (while (= Running 20)
  117.       ((Message newline "Thor seem to be running, you MUST close it NOW."    
  118.         newline "If you don't, the installation will fail!")
  119.     (run "Avail flush")
  120.     (set Running (run "Thor_Install:CheckForLib")))
  121. )
  122.  
  123. ;************************
  124. ;** Start Installation **
  125. ;************************
  126.  
  127. (if (exists "Thor:libs/bbsread.library" (noreq))
  128. ; Then
  129. (    (set ThorUpdate Yes)
  130.     (set Thor_Dir (expandpath "Thor:"))
  131. )
  132. ; Else
  133. (    (set ThorUpdate No)
  134. )
  135. )
  136.  
  137. (if (exists "BBSData:global.config" (noreq))
  138. ; Then
  139. (    (set BBSDataUpdate Yes)
  140.     (set BBSData_Dir (expandpath "BBSData:"))
  141. )
  142. ; Else
  143. (    (set BBSDataUpdate No)
  144. )
  145. )
  146.  
  147. (if (= ThorUpdate Yes)
  148. ;then    
  149.     (if (askbool
  150.             (prompt "Thor seems to be installed on your system already." newline
  151.                 "The program resides in " quote Thor_Dir quote "." newline
  152.                 "Do you want to install Thor over it?")
  153.             (help
  154.                 "The installer has determined that you may already have a "
  155.                 "copy of Thor installed on your system. If this is wrong or "
  156.                 "you want the update installed elsewhere, select NO as an "
  157.                 "answer. Otherwise, select YES."
  158.             )
  159.             (default 1)
  160.         )
  161.     ; Then
  162.         ( 
  163.             (set is_update Yes) 
  164.         )
  165.     ; Else
  166.         ( 
  167.             (set is_update No) 
  168.             (set Thor_Dir 
  169.                 (askdir
  170.                     (prompt "Where would you like Thor installed?"
  171.                     newline "The installer will NOT create a directory")
  172.                     (help @askdir-help)
  173.                     (default "Work:")
  174.                     (newpath)
  175.                 )
  176.             )
  177.             (set Thor_Dir (expandpath Thor_Dir))
  178.             (set user_script (cat user_script (cat "Assign Thor: " quote Thor_dir quote newline)))
  179.         )
  180.     )
  181. ;Else
  182.     ((set Thor_Dir
  183.         (askdir
  184.             (prompt "Where would you like Thor installed?"
  185.             newline "The installer will NOT create a directory")
  186.             (help @askdir-help)
  187.             (default @default-dest)
  188.             (newpath)
  189.         )
  190.     )
  191.     (set Thor_Dir (expandpath Thor_Dir))
  192.     (set user_script (cat "Assign Thor: " quote Thor_dir quote newline))
  193.     )
  194. )
  195.  
  196. ; before we go on lets reset the user's level back to what it was
  197. (default_level)
  198.  
  199. ; verify that the Thor directory exists
  200. (if (<> (exists Thor_Dir) is_a_dir)
  201.     (
  202.         (makedir Thor_Dir
  203.             (prompt
  204.                 "The directory you have selected for Thor does not "
  205.                 "seem to exist.  Do you want us to create it for you?"
  206.             )
  207.             (help @makedir-help)
  208.             (infos)
  209.             (confirm)
  210.         )
  211.         (set Thor_Dir (expandpath Thor_Dir))
  212.         (set user_script (cat "Assign Thor: " quote Thor_dir quote newline))
  213.     )
  214. )
  215.  
  216. (makeassign "Thor" Thor_dir)
  217. (makedir "Thor:Data")
  218.  
  219. ;*************
  220. ;** BBSData **
  221. ;*************
  222.  
  223.  
  224. (default_level)
  225.  
  226.     (if (= BBSDataUpdate Yes)
  227.     ; Then
  228.         (if (askbool
  229.             (prompt "There seems to be a message database installed on your system already."
  230.                 "The database resides in " quote BBSData_Dir quote "." newline
  231.                 "Do you want to use this database further?"
  232.             )
  233.             (help
  234.                 "The installer has determined that you may already have a "
  235.                 "message database installed on your system. If this is wrong or "
  236.                 "you want the database installed elsewhere, select NO as an "
  237.                 "answer. Otherwise, select YES."
  238.             )
  239.             (default 1)
  240.     
  241.             )    
  242.         ; Then
  243.             (
  244.                 (set RunCfgArchivers No)
  245.                 (set ConvertCfg Yes)
  246.             )
  247.         ; Else 
  248.             (
  249.                 (set RunCfgArchivers Yes)
  250.                 (set BBSDataMove Yes)
  251.                 (set is_update No)
  252.                 (set BBSData_Dir 
  253.                     (askdir
  254.                     (prompt "Where would you like the message database installed?"
  255.                         newline "The installer will NOT create a directory")
  256.                     (help @askdir-help)
  257.                     (default "Thor:Data")
  258.                     (newpath)
  259.                     )
  260.                 )
  261.                 (set user_script (cat user_script (cat "Assign BBSData: " quote BBSData_dir quote newline)))
  262.             )
  263.         )
  264.     ; Else
  265.         (
  266.             (set ConvertCfg No)
  267.             (set RunCfgArchivers Yes)
  268.             (set BBSData_Dir (expandpath "Thor:Data"))
  269.             (set user_script (cat user_script (cat "Assign BBSData: " quote BBSData_dir quote newline)))
  270.         )
  271.     )    
  272.  
  273. ;***********************************
  274. ;***** GET FIRST DISK IN HERE ******
  275. ;***********************************
  276.  
  277. ; first copy over the stuff
  278. (working omp "Decompressing and copying Thor files.")
  279.  
  280. ;(run "Thor_Install:unpack.sh" )
  281. ;(run "Thor_Install:lhx -a x Thor_Install:thor.lha" )
  282. (run "Thor_Install:lhex -a -f -w=THOR: x Thor_Install:thor.lha" )
  283.  
  284. ;******************
  285. ;** User-Startup **
  286. ;******************
  287.  
  288. (save_default_level)
  289. (expert_level)
  290. (if (= is_update Yes)
  291. ;Then 
  292.     (set is_update Yes)
  293. ;else
  294.     (if (= BBSDataMove Yes)
  295.     ;Then
  296.         (
  297.         ; now figure out the addition to the user-startup
  298.  
  299.         ; modify S:User-Startup
  300.         (working omp "Updating S:User-Startup.")
  301.             (startup "Thor"
  302.             (prompt
  303.                 "These instructions need to be added to the \"S:User-Startup\" "
  304.                 "so that your system will be properly configured to use Thor "
  305.                 newline
  306.                 newline
  307.                 user_script
  308.             )
  309.                     (help @startup-help)
  310.                     (command user_script)
  311.             )
  312.         )
  313.     ;Else
  314.         (
  315.         ; now figure out the addition to the user-startup
  316.         ; modify S:User-Startup
  317.         (working omp "Updating S:User-Startup.")
  318.             (sta