home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 20 / AACD20.BIN / AACD / Programming / AmiReadMeGen / InstallProgram < prev   
Encoding:
Text File  |  2000-10-18  |  5.3 KB  |  193 lines

  1. ; -------------------------------------------------------
  2. ; Installer script for AmiReadMeGen V1.0
  3. ; -------------------------------------------------------
  4.  
  5. (set #welcome "This is the installer for AmiReadMeGen!")
  6.  
  7. (set #wrongversion
  8. (cat "You have an old version of the program 'Installer' "
  9.      "on your Amiga!\n\n"
  10.      "The installation procedure needs at least Installer 42.9."
  11.      "\n\nPlease check your System & obtain a newer version!"
  12. ))
  13.  
  14. (set #general-help 
  15. (cat "The install script will copy all %s files &"
  16.      "directories to the destination that you specify."
  17. ))
  18.  
  19. (set #destdir-prompt "Select a Volume & Path where AmiReadMeGen will be added:")
  20.  
  21. (set #destdir-help   
  22. (cat "Select the volume that you wish to place AmiReadMeGen in."
  23.      "Then select a directory (if any) that will serve as a "
  24.      "parent for AmiReadMeGen.  Example:  Select DH0: as the volume,"
  25.      "then select a directory (such as Programs) & the installer"
  26.      "will make a directory called DH0:Programs/AmiReadMeGen, where"
  27.      "the AmiReadMeGen program will be placed."
  28.      "NOTE:"
  29.      "If this is changed in the future, remember to edit the Icon"
  30.      "ToolTypes to reflect the actual location of the program."
  31. ))
  32.  
  33. (set #Cdir-prompt "Select a Path where commands are located (example C:):")
  34.  
  35. (set #Cdir-help   
  36. (cat "Select the volume & Path that you wish to place AmiReadMeGen"
  37.      "support program(s) in.  I recommend the 'C:' directory."
  38. ))
  39.  
  40. (set #no-diskspace "To install AmiReadMeGen into '%s', you need at least %ld bytes of free harddrive space!")
  41.  
  42. ;------------------------------------------------------------------------
  43. ; Cleanup any temporary mess we created
  44. (procedure CLEANUP
  45.     ; Nothing to cleanup
  46.     (delete (tackon @default-dest ".tempinstall") (all) (optional "force"))
  47. )   ; CLEANUP
  48.  
  49.  
  50. ;------------------------------------------------------------------------
  51. ; Obtain an installation path
  52. (procedure GETPATH #gp_default #gp_remdir #gp_msg #gp_help
  53.  
  54.     (set #gp_res "")
  55.     (while (= "" #gp_res)
  56.         (set #gp_res #gp_default)
  57.         (if (not (exists #gp_res (noreq)))
  58.           (
  59.             ; Surfer 1.1 Hack:
  60.             (if (= #gp_res "Work:")
  61.               (
  62.                 (set #gp_res "")
  63.                 (set #gp_default @default-dest)
  64.               )
  65.             ) ; if
  66.  
  67.           )
  68.         ) ; if
  69.  
  70.         (if (OR (= "" #gp_res) (= @user-level 2))
  71.           (
  72.             ; We had a problem. So we need to ask the user!
  73.             (set #gp_res
  74.                 (expandpath
  75.                     (askdir
  76.                         (prompt #gp_msg)
  77.                         (help #gp_help)
  78.                         (default #gp_default)
  79.                     )
  80.                 )
  81.             )
  82.           )
  83.         ) ; if
  84.  
  85.         ; If the directory does not exist, retry!
  86.         (if (<> "" #gp_res)
  87.           (
  88.             (if (not (exists #gp_res (noreq)))
  89.                 (set #gp_res "")
  90.             ) ; if
  91.           )
  92.         ) ; if
  93.     ) ; while
  94.  
  95.     ; return the result!
  96.     (set #gp_res #gp_res)
  97.  
  98. ) ; GETPATH
  99.  
  100. ;------------------------------------------------------------------------
  101. ; We can't handle this script without Installer 42.9 or better!
  102. (if (< @installer-version 2752521)
  103.   (
  104.     ; Big problem!
  105.     (message #wrongversion)
  106.     (exit (quiet))
  107.   )
  108. )
  109.  
  110. ; find out how the user wants to install things
  111. (welcome #welcome)
  112.  
  113. (complete 0)
  114.  
  115. ; First find the Destination base:
  116.  
  117. (set #ARMGDirBase (GETPATH "Work:" TRUE #destdir-prompt #destdir-help))
  118.  
  119. ; We have to create a drawer "AmiReadMeGen" there!
  120. ; if (expr) (true) (false)
  121.  
  122. (set #DiskLibDir (tackon #ARMGDirBase "AmiReadMeGen"))
  123.     
  124. (copyfiles (prompt "Copying Drawer (Icon file)...")
  125.            (help    @copyfiles-help)
  126.            (source  "ENV:sys/def_Drawer.info")
  127.            (dest    #ARMGDirBase)
  128.            (newname "AmiReadMeGen.info")
  129. )
  130.  
  131. ; Where are we going to place DiskDirTree:
  132. (set #CmdDir (GETPATH "C:" TRUE #Cdir-prompt #Cdir-help))
  133.  
  134. (set @default-dest #DiskLibDir)
  135.  
  136. ; If this is a new installation, we check the diskspace!
  137.  
  138.     (if (not (exists @default-dest))
  139.       (
  140.         ; For a new setup, we should leave some space!
  141.         (if (< (getdiskspace #ARMGDirBase) 700000)
  142.             (abort (#no-diskspace #ARMGDirBase 700000))
  143.         )
  144.  
  145.         (makedir @default-dest)
  146.  
  147.         (complete 9)
  148.  
  149.         (copyfiles (prompt  "Copying DeckBrowser (Support Program)...")
  150.                    (help    @copyfiles-help)
  151.                    (source  "DeckBrowser")
  152.                    (dest    #CmdDir)
  153.         )
  154.  
  155.         (complete 25)
  156.  
  157.         (copyfiles (prompt  "Copying Main files...")
  158.                    (help    @copyfiles-help)
  159.                    (source  "AmiReadMeGen.bsh")
  160.                    (dest    #DiskLibDir)
  161.         )
  162.  
  163.         (copyfiles (prompt  "Copying Help file...")
  164.                    (help    @copyfiles-help)
  165.                    (source  "AmiReadMeGen.guide")
  166.                    (dest    #DiskLibDir)
  167.                    (infos)
  168.         )
  169.         
  170.         (complete 83)
  171.  
  172.         (copyfiles (prompt  "Copying Main program...")
  173.                    (help    @copyfiles-help)
  174.                    (source  "AmiReadMeGen")
  175.                    (dest    #DiskLibDir)
  176.                    (infos)
  177.         )
  178.  
  179.         (complete 98)
  180.       )
  181.     )
  182.  
  183.  
  184. ;------------------------------------------------------------------------
  185. ; That's it!
  186.  
  187. (complete 100)
  188.  
  189. (CLEANUP)
  190. (exit)
  191.  
  192. (abort "Well, I tried!")
  193.