home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 16 / AmigaOS_LeserCD16_02.bin / CD_System / Warp3D / Install_Warp3D < prev    next >
Text File  |  2001-10-30  |  12KB  |  497 lines

  1. ; $VER: Installation script for Warp3D 1.0 ( 5. Dezember 1998)
  2. ; © Thomas & Hans-Jörg Frieden
  3. ; Created with GoldED 5.0
  4. ; Adapted for V2 beta, 04-Feb-99
  5. ; check if we are running under correct OS
  6.  
  7. (set #version (/ @installer-version 65536))
  8.  
  9. (if (< (/ (getversion) 65536) 39)
  10.     (
  11.         (abort "Incorrect OS version (software requires OS 39 or better )!")
  12.     )
  13. )
  14.  
  15. ; error handling
  16.  
  17. ;
  18. ; Procedure to copy a single library
  19. (procedure P_copy_single arg1 arg2 arg3
  20.         (copylib
  21.                 (confirm)
  22.                 (prompt arg3)
  23.                 (help @copylib-help)
  24.                 (source arg1)
  25.                 (dest arg2)
  26.                 (optional "oknodelete" "askuser")
  27.         )
  28. )
  29.  
  30. ;
  31. ; How can it be there's no way of specifying an environment variable?
  32. (procedure P_setenv arg1 arg2
  33.         (
  34.                 (if (exists (tackon "ENV:" arg1) (noreq))
  35.                         (delete (tackon "ENV:" arg1))
  36.                 )
  37.                 (if (exists (tackon "ENVARC:" arg1) (noreq))
  38.                         (delete (tackon "ENVARC:" arg1))
  39.                 )
  40.                 (textfile
  41.                         (dest (tackon "ENV:" arg1))
  42.                         (append arg2)
  43.                 )
  44.                 (textfile
  45.                         (dest (tackon "ENVARC:" arg1))
  46.                         (append arg2)
  47.                 )
  48.         )
  49. )
  50.  
  51. ;
  52. ; Procedure to invalidate old version
  53. (procedure P_invalidate
  54.     (if (exists "libs:Warp3D" (noreq))
  55.       ( if (< (getversion "libs:Warp3D.library") 262144)
  56.         (
  57.         (message (cat "The installer will now invalidate your old installation by moving "
  58.                       "old files to a directory old_warp3d.")
  59.         )
  60.         ; make backup directory
  61.         (makedir "libs:old_warp3d")
  62.         (makedir "libs:old_warp3d/Warp3D")
  63.  
  64.         ; copy old stuff
  65.         (copyfiles
  66.             (source "Libs:Warp3D")
  67.             (dest "Libs:old_warp3d/Warp3D")
  68.             (infos)
  69.             (all)
  70.             (optional "nofail" "force" "askuser")
  71.         )
  72.         (copyfiles
  73.             (source "Libs:Warp3D.library")
  74.             (dest "Libs:old_warp3d")
  75.             (infos)
  76.             (all)
  77.             (optional "nofail" "force" "askuser")
  78.         )
  79.         (copyfiles
  80.             (source "Libs:Warp3DPPC.library")
  81.             (dest "Libs:old_warp3d")
  82.             (infos)
  83.             (all)
  84.             (optional "nofail" "force" "askuser")
  85.         )
  86.  
  87.         ; delete old files
  88.         (delete "libs:Warp3D.library" (optional "force"))
  89.         (delete "libs:Warp3DPPC.library" (optional "force"))
  90.         (delete "libs:Warp3D/GFXdrivers/#?" (optional "force"))
  91.         (delete "libs:Warp3D/HWdrivers/#?" (optional "force"))
  92.         (delete "libs:Warp3D/GFXdrivers" (optional "force"))
  93.         (delete "libs:Warp3D/HWdrivers" (optional "force"))
  94.         (delete "libs:Warp3D/" (optional "force"))
  95.  
  96.         (message (cat "The old libraries can now be found in libs:old_warp3d.")
  97.         )
  98.       )
  99.     )
  100.     )
  101. )
  102.  
  103.  
  104. (if (>= #version 44)
  105.     (
  106.         (effect "center" "radial" $ffffff $ffffff)
  107.         (showmedia "w3d" "Installer_Media/Warp3D.jpg" "upper_left" "none" 0)
  108.         (showmedia "3dw" "Installer_Media/3DWorld.jpg" "upper_right" "none" 0)
  109.     )
  110. )
  111.  
  112.  
  113. (onerror
  114.     (if (> @ioerr 0)
  115.         (
  116.             (message
  117.                 ("An error has occurred during installation. Please check the log file to understand the error.")
  118.             )
  119.         )
  120.     )
  121.     (exit (quiet))
  122. )
  123.  
  124. (set #installmode
  125.     (askbool
  126.         (prompt (cat
  127.             "Welcome to Warp3D.\n"
  128.             "Choose the installation mode.\n\n"
  129.             "If you have an older version of Warp3D installed, "
  130.             "you may want to choose uninstall now to avoid confusion with older drivers."
  131.             )
  132.         )
  133.         (help "Select Install if you want to install Warp3D, and Uninstall if you want to remove it. Warp3D is a hardware independent driver system for 3d accelerators.")
  134.         (choices
  135.             "Install"
  136.             "Uninstall"
  137.         )
  138.         (default 1)
  139.     )
  140. )
  141.  
  142. (if (= #installmode 1)
  143.     ; normal installation
  144.     (
  145.         (welcome (cat
  146.             "Welcome to the Warp3D installation. This utility will install or "
  147.             "update Warp3D, the hardware-independent 3D driver system, on your "
  148.             "Amiga. ")
  149.         )
  150.         (P_invalidate)
  151.  
  152.         (message "The Installation program will now create a new directory \"Warp3D\" in your LIBS directory where the Warp3D libraries will be installed.")
  153.         (makedir "Libs:Warp3D/")
  154.         (makedir "Libs:Warp3D/GFXdrivers")
  155.         (makedir "Libs:Warp3D/HWdrivers")
  156.         ; --- Try to find out if WarpUp is installed.
  157.         (if (exists "libs:Warp.library" (noreq))
  158.             (set #ppc 1)
  159.             (set #pcc 0)
  160.         )
  161.         (if (= #ppc 1)
  162.             (set #result
  163.                 (askbool
  164.                     (prompt "You seem to have WarpUp installed. Warp3D comes with a special PPC version that is usable for WarpUp applications. Do you want to install the PPC libraries, too?")
  165.                     (help @askbool-help)
  166.                     (choices "Yes" "No")
  167.                     (default 1)
  168.                 )
  169.             )
  170.             (if (= #result 0)
  171.                 (set #ppc 0)
  172.             )
  173.         )
  174.         (copylib
  175.             (prompt "Copying the master library")
  176.             (help @copylib-help)
  177.             (source "libs/Warp3D.library")
  178.             (dest "libs:")
  179.         )
  180.         (if (= #ppc 1)
  181.             (copylib
  182.                 (prompt "Copying the PPC master library")
  183.                 (help @copylib-help)
  184.                 (source "libs/Warp3DPPC.library")
  185.                 (dest "libs:")
  186.             )
  187.         )
  188.  
  189.         ; ask for graphics driver
  190.         (set #gfx_sys
  191.             (askoptions
  192.                 (prompt "Which graphics systems do you want to use with Warp3D ?")
  193.                 (help @askoptions-help)
  194.                 (choices
  195.                     "CyberGraphX V3/V4"
  196.                     "Picasso96"
  197.                 )
  198.                 (default (+ 1 2))
  199.             )
  200.         )
  201.  
  202.         ; if P96 is selected, install it
  203.         (if (BITAND #gfx_sys 2)
  204.          (
  205.             (P_copy_single "libs/Warp3D/gfxdrivers/W3D_Picasso96.library"
  206.                            "libs:Warp3D/GFXdrivers"
  207.                            "Copy Picasso96 driver"
  208.             )
  209.             (if (= #ppc 1)
  210.                 (P_copy_single "libs/Warp3D/gfxdrivers/W3D_Picasso96_PPC.library"
  211.                                "libs:Warp3D/GFXdrivers"
  212.                                "Copy Picasso96 driver (PPC version)"
  213.                 )
  214.             )
  215.          )
  216.         )
  217.  
  218.         ; same for CGX, but ask for version first
  219.         (if (BITAND #gfx_sys 1)
  220.         (
  221.             (set #result
  222.                 (askchoice
  223.                     (prompt "What version of CyberGraphX do you have installed ?\n")
  224.                     (help @askchoice-help)
  225.                     (choices
  226.                         "CyberGraphX V3 (for CyberVision3D)"
  227.                         "CyberGraphX V3 (for CVPPC/BVPPC)"
  228.                         "CyberGraphX V4"
  229.                     )
  230.                     (default 2)
  231.                 )
  232.             )
  233.             ; assume the V4 driver will be installed, except when CVision3D is selected
  234.             (set #version 1)
  235.             (if (= #result 0)
  236.                 (set #version 0)
  237.             )
  238.  
  239.             (if (= #version 0)
  240.             (
  241.                 (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGFX.library"
  242.                                "libs:Warp3D/GFXdrivers"
  243.                                "Copy CyberGraphX V3 driver"
  244.                 )
  245.                 (if (= #ppc 1)
  246.                     (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGFX_PPC.library"
  247.                                    "libs:Warp3D/GFXdrivers"
  248.                                    "Copy CyberGraphX V3 driver (PPC version)"
  249.                     )
  250.                 )
  251.              )
  252.              (
  253.                 (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGfx4.library"
  254.                                "libs:Warp3D/GFXdrivers"
  255.                                "Copy CyberGraphX V4 driver"
  256.                 )
  257.                 (if (= #ppc 1)
  258.                     (P_copy_single "libs/Warp3D/gfxdrivers/W3D_CyberGfx4_PPC.library"
  259.                                    "libs:Warp3D/GFXdrivers"
  260.                                    "Copy CyberGraphX V4 driver (PPC version)"
  261.                     )
  262.                 )
  263.              )
  264.             )
  265.          )
  266.         )
  267.  
  268.         ; Try to find out the graphics card, assuming CVision3D
  269.         (set #graka 0)
  270.         (if (exists "devs:Monitors/CVision3D" (noreq))
  271.             (set #graka 0)
  272.         )
  273.         (if (exists "devs:Monitors/CVisionPPC" (noreq))
  274.             (set #graka 1)
  275.         )
  276.  
  277.         ; Ask for graphics card
  278.         (set #result
  279.             (askchoice
  280.                 (prompt "Please select the graphics device you want to use.")
  281.                 (help @askchoice-help)
  282.                 (choices
  283.                     "CyberVision64/3D"
  284.                     "CyberVisionPPC/BlizzardVisionPPC"
  285.                     "Avenger/Voodoo 3"
  286.                 )
  287.                 (default #graka)
  288.             )
  289.         )
  290.         (select #result
  291.             (
  292.                 (copylib
  293.                 (prompt "Copying the hardware driver library")
  294.                 (help @copylib-help)
  295.                 (source "libs/Warp3D/HWdrivers/W3D_Virge.library")
  296.                 (dest "libs:Warp3D/HWdrivers")
  297.                 )
  298.                 (if (= #ppc 1)
  299.                 (copylib
  300.                     (prompt "Copying the PPC hardware driver library")
  301.                     (help @copylib-help)
  302.                     (source "libs/Warp3D/HWdrivers/W3D_Virge_PPC.library")
  303.                     (dest "libs:Warp3D/HWdrivers")
  304.                 )
  305.                 )
  306.             )
  307.             (
  308.                 (copylib
  309.                 (prompt "Copying the hardware driver library")
  310.                 (help @copylib-help)
  311.                 (source "libs/Warp3D/HWdrivers/W3D_Permedia2.library")
  312.                 (dest "libs:Warp3D/HWdrivers")
  313.                 )
  314.                 (if (= #ppc 1)
  315.                 (copylib
  316.                     (prompt "Copying the PPC hardware driver library")
  317.                     (help @copylib-help)
  318.                     (source "libs/Warp3D/HWdrivers/W3D_Permedia2_PPC.library")
  319.                     (dest "libs:Warp3D/HWdrivers")
  320.                 )
  321.                 )
  322.             )
  323.             (
  324.                 (copylib
  325.                 (prompt "Copying the hardware driver library (Big Endian)")
  326.                 (help @copylib-help)
  327.                 (source "libs/Warp3D/HWdrivers/W3D_AvengerBE.library")
  328.                 (dest "libs:Warp3D/HWdrivers")
  329.                 )
  330.                 (copylib
  331.                 (prompt "Copying the hardware driver library (Little Endian)")
  332.                 (help @copylib-help)
  333.                 (source "libs/Warp3D/HWdrivers/W3D_AvengerLE.library")
  334.                 (dest "libs:Warp3D/HWdrivers")
  335.                 )
  336.  
  337.                 (if (= #ppc 1)
  338.                 (
  339.                     (copylib
  340.                     (prompt "Copying the PPC hardware driver library (Big Endian)")
  341.                     (help @copylib-help)
  342.                     (source "libs/Warp3D/HWdrivers/W3D_AvengerBE_PPC.library")
  343.                     (dest "libs:Warp3D/HWdrivers")
  344.                     )
  345.                     (copylib
  346.                     (prompt "Copying the PPC hardware driver library (Little Endian)")
  347.                     (help @copylib-help)
  348.                     (source "libs/Warp3D/HWdrivers/W3D_AvengerLE_PPC.library")
  349.                     (dest "libs:Warp3D/HWdrivers")
  350.                     )
  351.                 )
  352.                 )
  353.             )
  354.  
  355.         )
  356.         (if (= #result 1)
  357.             (
  358.             ; Take special steps for Permedia driver
  359.             (makedir "ENV:Warp3D")
  360.             (makedir "ENV:Warp3D/Permedia2")
  361.             (makedir "ENVARC:Warp3D")
  362.             (makedir "ENVARC:Warp3D/Permedia2")
  363.             (P_setenv "Warp3D/Permedia2/Dither" "on")
  364.             (set #result
  365.                 (askbool
  366.                     (prompt (cat "For the Permedia2 driver to work correctly, semaphore "
  367.                                  "locking is required. This is done by setting the environment "
  368.                                  "variable CyberGraphX/USESEMAPHORES to 1. See the documentation for more details. "
  369.                                  "Should the installer program do this now ?")
  370.                     )
  371.                     (help @askbool-help)
  372.                     (choices
  373.                         "Yes"
  374.                         "No"
  375.                     )
  376.                     (default 1)
  377.                 )
  378.             )
  379.             (if (= #result 1)
  380.                 (P_setenv "CyberGraphX/USESEMAPHORES" "1" )
  381.                 (message "Ok, but remember that you may run into troubles later!")
  382.             )
  383.  
  384.             )
  385.         )
  386.         (if (= #result 2)
  387.             (if (= #ppc 1)
  388.             (
  389.                 (run "Installer_Utils/FindGfxAddr"
  390.                 (prompt "Trying to determine PowerPC/gfxaddr")
  391.                 (help "This environment variable must be set for correct operation with WarpUp")
  392.                 (safe)
  393.                 )
  394.                 (set #addr
  395.                 (askstring
  396.                     (prompt "Installer has detected this address. This should be accurate, but you may want to change it")
  397.                     (help "Manually determinating this value is described in the file 'Problems'")
  398.                     (default (getenv "GFXADDR_TEMP"))
  399.                 )
  400.                 )
  401.                 (P_setenv "PowerPC/gfxaddr" #addr)
  402.             )
  403.             )
  404.         )
  405.  
  406.         ; Ask for demo installation
  407.         (set #result
  408.             (askbool
  409.                 (prompt "Do you want to install the demo?")
  410.                 (help @askbool-help)
  411.                 (choices
  412.                     "Yes"
  413.                     "No"
  414.                 )
  415.                 (default 1)
  416.             )
  417.         )
  418.         (if (= #result 1) (
  419.                 (set #demodest
  420.                     (askdir
  421.                         (prompt "Select a location to install the Demo. A Drawer \"W3DDemo\" will be created")
  422.                         (help @askdir-help)
  423.                         (newpath)
  424.                         (default "ram:")
  425.                     )
  426.                 )
  427.                 (if (NOT (exists #demodest))
  428.                     (makedir #demodest)
  429.                 )
  430.                 (copyfiles
  431.                     (source "demo/")
  432.                     (dest (tackon #demodest "W3DDemo"))
  433.                     (infos)
  434.                     (all)
  435.                     (optional "oknodelete" "force" "askuser")
  436.                 )
  437.             )
  438.         )
  439.         (set #result
  440.             (askbool
  441.                 (prompt "Do you want to Install the User's Guide?")
  442.                 (help @askbool-help)
  443.                 (choices
  444.                     "Yes"
  445.                     "No"
  446.                 )
  447.                 (default 1)
  448.             )
  449.         )
  450.         (if (= #result 1)
  451.             (
  452.                 (set #destdoc (askdir
  453.                         (prompt "Select the place to install the documentation. A drawer \"docs\" will be created.")
  454.                         (help @askdir-help)
  455.                         (newpath)
  456.                         (default "HELP:")
  457.                     )
  458.                 )
  459.                 (copyfiles
  460.                     (prompt "Copying documentation files")
  461.                     (help @copyfiles-help)
  462.                     (source "Docs")
  463.                     (infos)
  464.                     (all)
  465.                     (dest (tackon #destdoc "Docs"))
  466.                 )
  467.             )
  468.         )
  469.  
  470.         (exit "Warp3D has been installed on your system.\n"
  471.               "For more information on Warp3D, check out the 3d World website:\n"
  472.               "http://www.haage-partner.com/3dworld\n"
  473.               "You'll also find information on how to subscribe to the "
  474.               "3DWorld mailing list.\n\n"
  475.               "Have fun with Warp3D!")
  476.     )
  477.  
  478.     ; uninstall application
  479.  
  480.     (
  481.         ; --- insert your code below ---
  482.         (delete "libs:Warp3D.library" (optional "force"))
  483.         (delete "libs:Warp3DPPC.library" (optional "force"))
  484.         (delete "libs:Warp3D/GFXdrivers/#?" (optional "force"))
  485.         (delete "libs:Warp3D/HWdrivers/#?" (optional "force"))
  486.         (delete "libs:Warp3D/GFXdrivers" (optional "force"))
  487.         (delete "libs:Warp3D/HWdrivers" (optional "force"))
  488.         (delete "libs:Warp3D/" (optional "force"))
  489.         ; -- end of your code ---
  490.  
  491.         (message "Uninstallation completed. The demo and documentation must be deleted manually.")
  492.  
  493.         (exit (quiet))
  494.     )
  495. )
  496.  
  497.