home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / Raytracing / Raytracer / LW1.DMS / in.adf / InstallLightwave < prev    next >
Encoding:
Text File  |  1994-07-13  |  12.0 KB  |  269 lines

  1. ;*******************************************************;
  2. ;                                                       ; 
  3. ;                  LightWave Installer                  ;
  4. ;                                                       ;
  5. ;                     by Todd Hayes                     ;
  6. ;                   ©1994 NewTek, Inc.                  ;
  7. ;                                                       ;
  8. ;   $VER: Lightwave Unbundled Installer 1.0 (7-12-94)   ;
  9. ;                                                       ;
  10. ;*******************************************************;
  11.  
  12. ;************* Initialize **************
  13. (set @app-name "LightWave")
  14. (set @user-level 1)
  15. (set default_drive (if (exists "Work:" (noreq))
  16.                        "Work:"
  17.                        (cat (getdevice "c:") ":")))
  18. (set @default-dest default_drive)
  19.  
  20.  
  21. (set disk1 "LightwaveInstall")
  22. (set disk_n "LightwaveDisk")
  23. (set d_num 2)
  24. (set l_num 2)
  25. (set c_num 5)
  26.  
  27. (set lw_size 3500000)
  28. (set content_size 6600000)
  29. (set lib_size 7104)
  30. (set count 0)
  31.  
  32. (set install_lw 0)
  33. (set install_content 0)
  34.  
  35. (set util_dir "sys:utilities")
  36.  
  37. (onerror 
  38.    ((if (exists "ram:lz.decomp")
  39.        (delete "ram:lz.decomp"))))
  40.  
  41.  
  42. ;************** Help Text **************
  43.  
  44. (set help_install_type_choice (cat "The installer allows you to choose which "
  45.                                "components of Lightwave 3D will be installed "
  46.                                "on your system.  You may choose a Full "
  47.                                "Install which will install Lightwave 3D, "
  48.                                "Modeler, and all of the objects, scenes, "
  49.                                "images, surfaces, and fonts included with "
  50.                                "Lightwave 3D.  The option to install "
  51.                                "Lightwave/Modeler Only will install only "
  52.                                "the minimum of files necessary to run "
  53.                                "Lightwave and Modeler.  Choosing the "
  54.                                "Install Content Only option will install "
  55.                                "only the objects, scenes, images, surfaces "
  56.                                "and fonts that are include with Lightwave."))
  57. (set help_directory (cat "Lightwave 3D must reside in a drawer called "
  58.                          "'Toaster' to function properly.  This drawer will "
  59.                          "be created if it does not exist on the drive or "
  60.                          "in the drawer that you have chosen.  If you "
  61.                          "already have a drawer called 'Toaster' where you "
  62.                          "would like to install Lightwave 3D, simply locate "
  63.                          "that drawer in the directory selection window and "
  64.                          "click 'Proceed'.  Do not click on the 'Toaster' "
  65.                          "drawer, as this will cause another 'Toaster' "
  66.                          "drawer to be created in the existing 'Toaster' "
  67.                          "drawer."))
  68. (set help_insert_disk (cat "The Installer needs this disk to be inserted "
  69.                            "to continue the installation process."))
  70. (set help_startup_lines (cat "These lines need to be added to your "
  71.                              "'s:user-startup' file so that the necessary "
  72.                              "files can be located by Lightwave every time "
  73.                              "that your machine is booted."))
  74. (set help_use_toast (cat "You have chosen to install Lightwave 3D in an "
  75.                          "existing Toaster drawer.  This will cause a new "
  76.                          "drawer, also called 'Toaster', to be created in "
  77.                          "the existing 'Toaster' drawer.  If this was not "
  78.                          "what you intended to do, click 'No' and the "
  79.                          "installer will take you back to the directory "
  80.                          "requester to choose a different drawer.  The "
  81.                          "default drawer for this requester will be the "
  82.                          "parent drawer of your existing 'Toaster' drawer."))
  83. (set help_changes (cat "There were some changes to both Lightwave and Modeler "
  84.                        "since the manual went to press.  The file Changes.Txt "
  85.                        "documents these changes.  You may choose to view this "
  86.                        "file at this stage of the install.  If you choose to "
  87.                        "skip this part, you may miss valuable information.\n"
  88.                        "Please read this file.\n"))
  89.          
  90.  
  91. ;************** Main **************
  92.  
  93. (welcome)
  94.  
  95. (set install_type (askchoice (prompt (cat "\nPlease select the type of "
  96.                                       "Install that you would like to "
  97.                                       "perform."))
  98.                              (choices "Full Installation"
  99.                                       "Install LightWave/Modeler Only"
  100.                                       "Install Content Only")
  101.                              (help help_install_type_choice)))
  102.  
  103. (if install_type
  104.     (if (= install_type 1)
  105.         ((set install_lw 1)
  106.          (set install_vsize l_num)
  107.          (set install_size (+ lw_size lib_size)))
  108.         ((set install_content 1)
  109.          (set install_vsize c_num)
  110.          (set install_size content_size)))
  111.     ((set install_lw 1)
  112.      (set install_content 1)
  113.      (set install_vsize (+ l_num c_num))
  114.      (set install_size (+ content_size (+ lw_size lib_size)))))
  115. (complete 0)
  116.  
  117. (set install_dir (askdir (prompt "Please select the drive where you would "
  118.                                  "like to install Lightwave 3D. A new drawer "
  119.                                  "called 'Toaster' will be created there.")
  120.                          (default default_drive)
  121.                          (help help_directory)))
  122. (set directory_name (substr install_dir (- (strlen install_dir) 7) 7))
  123. (while (OR (= directory_name "Toaster")
  124.        (OR (= directory_name "toaster")
  125.            (= directory_name "TOASTER")))
  126.   ((set use_toast (askbool (prompt "The drawer you have chosen to install "
  127.                                    "Lightwave 3D in is a 'Toaster' drawer.  "
  128.                                    "This will cause a 'Toaster' drawer to "
  129.                                    "be created inside the existing 'Toaster' "
  130.                                    "drawer.  Are you sure that you wish to "
  131.                                    "install Lightwave 3D in this drawer?")
  132.                            (help help_use_toast)))
  133.    (if use_toast
  134.        (set directory_name " ")
  135.       ((set install_dir (substr install_dir 0 (- (strlen install_dir) 7)))
  136.        (if (NOT (= (substr install_dir (- (strlen install_dir) 1) 1) ":"))
  137.           (set install_dir (substr install_dir 0 (- (strlen install_dir) 1))))
  138.        (set install_dir (askdir (prompt "Please select the drive where you "
  139.                                 "would like to install Lightwave 3D. A new "
  140.                                 "drawer called 'Toaster' will be created "
  141.                                 "there.")
  142.                             (default install_dir)
  143.                             (help help_directory)))
  144.        (set directory_name (substr install_dir (- (strlen install_dir) 7) 7))))
  145. ))
  146. (while (> install_size (getdiskspace install_dir))
  147.       ((if (NOT @user-level)
  148.            (abort (cat "\nNot enough space on drive to install.\n"
  149.                      "Please free up "
  150.                      (- install_size (getdiskspace install_dir))
  151.                      " bytes before restarting the Installation.")))
  152.        (message (cat "\nNot enough space on drive to install.\n"
  153.                      "Please free up "
  154.                      (- install_size (getdiskspace install_dir))
  155.                      " bytes before clicking proceed to continue."))))
  156. (copyfiles (source (cat disk1 ":c"))
  157.            (choices "lz.decomp")
  158.            (dest "ram:"))
  159. (if (NOT (exists (cat util_dir "/more")))
  160.    ((if (NOT (exists util_dir))
  161.         (makedir util_dir))
  162.     (copyfiles (source (cat disk1 ":c"))
  163.                (choices "more")
  164.                (dest util_dir))))
  165. (set toaster_dir (tackon install_dir "Toaster"))
  166. (set @default-dest toaster_dir)
  167. (if install_lw
  168.     ((foreach (cat disk1 ":libs")
  169.               ("#?")
  170.               (copylib (source (cat disk1 ":libs/" @each-name))
  171.                        (dest "libs:")))
  172.      (if (NOT (exists toaster_dir))
  173.          ((makedir toaster_dir )
  174.           (copyfiles (source (cat disk1 ":c/Toaster.info"))
  175.                      (dest install_dir))))
  176.      (set d3_dir (cat toaster_dir "/3D"))
  177.      (if (NOT (exists d3_dir))
  178.          (makedir d3_dir))
  179.      (set sur_dir (cat toaster_dir "/3D/Surfaces"))
  180.      (if (NOT (exists sur_dir))
  181.          (makedir sur_dir))
  182.      (set scenes_dir (cat toaster_dir "/3D/Scenes"))
  183.      (if (NOT (exists scenes_dir))
  184.          (makedir scenes_dir))
  185.      (set pre_dir (cat toaster_dir "/3D/Previews"))
  186.      (if (NOT (exists pre_dir))
  187.          (makedir pre_dir))
  188.      (set obj_dir (cat toaster_dir "/3D/Objects"))
  189.      (if (NOT (exists obj_dir))
  190.          (makedir obj_dir))
  191.      (set images_dir (cat toaster_dir "/3D/Images"))
  192.      (if (NOT (exists images_dir))
  193.          (makedir images_dir))
  194.      (set mot_dir (cat toaster_dir "/3D/Motions"))
  195.      (if (NOT (exists mot_dir))
  196.          (makedir mot_dir))
  197.      (set env_dir (cat toaster_dir "/3D/Envelopes"))
  198.      (if (NOT (exists env_dir))
  199.          (makedir env_dir))
  200.      (set lw_config (cat d3_dir "/LW-config"))
  201.      (if (AND (exists lw_config) (NOT (exists (cat lw_config ".old"))))
  202.          (rename lw_config (cat lw_config ".old")))
  203.      (set mod_config (cat d3_dir "/MOD-config"))
  204.      (if (AND (exists mod_config) (NOT (exists (cat mod_config ".old"))))
  205.          (rename mod_config (cat mod_config ".old")))
  206.      (set @execute-dir toaster_dir)
  207.      (working "\n\nDecompressing Files...")
  208.      (run ("ram:lz.decomp -m x %s:lw1" disk1))
  209.      (if install_content
  210.          (run ("ram:lz.decomp -m x %s:lw1a" disk1))) 
  211.      (set count (+ count 1))
  212.      (complete (/ (* count 100) install_vsize))
  213.      (askdisk (prompt "Please insert LightwaveDisk2 in any drive...")
  214.               (dest (cat disk_n d_num))
  215.               (help help_insert_disk))
  216.      (working "\n\nDecompressing Files...")
  217.      (run ("ram:lz.decomp -m x %s%ld:lw%ld" disk_n d_num d_num))
  218.      (set count (+ count 1))
  219.      (complete (/ (* count 100) install_vsize))
  220.      (set start-lines (cat "assign Toaster: " toaster_dir))
  221.      (set start-lines (cat start-lines ("\nassign 3D: %s/3d\n" toaster_dir))) 
  222.      (startup @app-name (prompt "\nThe following lines need to be added to "
  223.                                "your user-startup:\nassign Toaster: "
  224.                                toaster_dir "\n")
  225.                        (command start-lines) 
  226.                        (help help_startup_lines))
  227. ))
  228.  
  229. (if install_content
  230.     ((set d_num (+ l_num 1))
  231.      (if (NOT (exists toaster_dir))
  232.          ((makedir toaster_dir )
  233.           (copyfiles (source (cat disk1 ":c/Toaster.info"))
  234.                      (dest install_dir))))
  235.      (set d3_dir (cat toaster_dir "/3D"))
  236.      (if (NOT (exists d3_dir))
  237.          (makedir d3_dir))
  238.      (set mot_dir (cat toaster_dir "/3D/Motions"))
  239.      (if (NOT (exists mot_dir))
  240.          (makedir mot_dir))
  241.      (set env_dir (cat toaster_dir "/3D/Envelopes"))
  242.      (if (NOT (exists env_dir))
  243.          (makedir env_dir))
  244.      (set @execute-dir toaster_dir)
  245.      (if (NOT install_lw)
  246.         ((working "\n\nDecompressing Files...")
  247.          (run ("ram:lz.decomp -m x %s:lw1a" disk1))
  248.          (complete 5))) 
  249.      (while (<= d_num (+ l_num c_num ))
  250.         (askdisk 
  251.             (prompt ("Please insert LightwaveDisk%ld in any drive..." d_num))
  252.             (dest (cat disk_n d_num))
  253.             (help help_insert_disk))
  254.         (working "\n\nDecompressing Files...")
  255.         (run ("ram:lz.decomp -m x %s%ld:lw%ld" disk_n d_num d_num))
  256.         (set count (+ count 1))
  257.         (complete (/ (* count 100) install_vsize))
  258.         (set d_num (+ d_num 1)))))
  259. (run ("assign Toaster: %s" toaster_dir))
  260. (run ("assign 3D: %s" d3_dir))
  261.  
  262. (working "\n\nDisplaying Changes.txt text file...\n\n")
  263. (run "run sys:utilities/more toaster:changes.txt")
  264.  
  265. (if (exists "ram:lz.decomp")
  266.     (delete "ram:lz.decomp"))
  267.  
  268. (complete 100)
  269.