home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d8xx / d891 / disksalv2.lha / DiskSalv2 / MakeBoot < prev    next >
Text File  |  2003-07-31  |  12KB  |  313 lines

  1. ;======================================================================
  2. ;
  3. ; DiskSalv boot disk generator -- $VER: MakeBoot 11.3 (19.7.93)
  4. ;
  5. ;======================================================================
  6. ;
  7. ; Some basic strings
  8.  
  9. (set #disksalv-install 
  10.      (cat "\nDiskSalv Boot Disk Generator\n"
  11.           "\nThis utility will format a floppy disk and install DiskSalv"
  12.           " and its support files based on your hard disk setup.  The"
  13.           " result is a bootable floppy with DiskSalv on it.  Proceed?"))
  14.  
  15. (set #disksalv-install-help
  16.      (cat "\nIn the case of a severe hard disk failure, DiskSalv isn't"
  17.           " going to be real useful on your hard disk.  This utility"
  18.           " builds a bootable floppy that may be used in such cases to"
  19.           " streamline such repair activity." ))
  20.  
  21. (set #which-disk
  22.      "In which floppy disk drive should DiskSalv be installed?")
  23.  
  24. (set #any-locale
  25.      (cat "\nInstall DiskSalv Localizations\n"
  26.           "\nYou may install the DiskSalv locale files for various"
  27.           " languages in the Locale directory.  Proceed?"))
  28.  
  29. (set #any-locale-help
  30.      (cat "\nDiskSalv can be operated in different languages."
  31.           "\n\nIf you choose to proceed, you will be asked to"
  32.           " select the translations you want available on your"
  33.       " system."))
  34.  
  35. (set #which-language "\nWhich catalogs should be installed?")
  36.  
  37. (set #which-language-help
  38.      (cat "\nDiskSalv can be operated in many different"
  39.           " languages. One file will be copied to your "
  40.           " hard drive for each language supported.\n\n"
  41.           "To reduce the amount of space consumed by the"
  42.           " language files, you can select only the"
  43.           " files of specific languages to be copied.\n\n"
  44.           "Check the boxes of the languages you wish to"
  45.       " have available on your system.\n\n"
  46.          @askoptions-help))
  47.  
  48. (set #subdir-catalog "locale/catalogs"
  49.      #outdisk-name   "DiskSalv Boot"
  50.      #dscatname      "DiskSalv.catalog"
  51.      #tmp-dir        "T:DiskSalv")
  52.  
  53. (set #get-dearchiver
  54.      (cat "\nPlease specify the file name of a de-archiver "
  55.           "program for \"LHA\"-type files."))
  56.  
  57. (set #ds-done
  58.      (cat "\nDiskSalv boot disk construction is complete.\n"
  59.           "\nPlease be aware that, while every effort has been made"
  60.           " to support your particular setup, it is possible that"
  61.           " some files you need for a simple bootup have not been"
  62.           " copied to the boot disk.  Please try this disk out now,"
  63.           " rather than waiting until you actually need it."))
  64.  
  65. ;======================================================================
  66. ;
  67. ; This function does the actual formatting of the given "outputdisk".
  68. ;
  69.  
  70. (procedure FORMATDISK
  71.     (if (askbool (prompt (cat "Please insert a floppy disk to be formatted "
  72.                               "in drive " outputdisk))
  73.                      (choices "Ok" "Cancel")
  74.                      (help "\nPlease select the floppy disk unit for the installation.\n")
  75.                      (default 1))
  76.         ((working "Formatting disk " outputdisk " as \"" #outdisk-name "\"")
  77.          (run (cat "SYS:System/Format <NIL: >\"CON:10/10/500/50/Formatting...\" DRIVE " 
  78.                    outputdisk " NAME \"" #outdisk-name "\" NOICONS"))
  79.          (run (cat "C:Install DRIVE " outputdisk)))
  80.         (exit "Operation cancelled")))
  81.  
  82. ;======================================================================
  83. ;
  84. ; This function makes all the important directories for the DiskSalv
  85. ; boot disk.
  86. ;
  87.  
  88. (procedure MAKESYS
  89.    (working "Creating System Directories")
  90.    (copyfiles (source  "C:")
  91.               (dest    (tackon outputdisk "C"))
  92.               (pattern (cat "(AddBuffers|AddDataTypes|Assign|BindDrivers|"
  93.                             "ConClip|Copy|Delete|Dir|Execute|IPrefs|List|"
  94.                             "LoadWB|MagTape|MakeDir|Mount|SetClock|"
  95.                             "SetPatch|Version|Wait)")))
  96.    (makedir (tackon outputdisk "Classes"))
  97.    (makedir (tackon outputdisk "Devs"))
  98.    (makedir (tackon outputdisk "Devs/DataTypes"))
  99.    (makedir (tackon outputdisk "Devs/Printers"))
  100.    (copyfiles (source  "Devs:DOSDrivers")
  101.               (dest    (tackon outputdisk "Devs/DOSDrivers"))
  102.               (pattern "#?"))
  103.    (copyfiles (source  "Devs:Keymaps")
  104.               (dest    (tackon outputdisk "Devs/Keymaps"))
  105.               (pattern "#?"))
  106.    (copyfiles (source  "Devs:Monitors")
  107.               (dest    (tackon outputdisk "Devs/Monitors"))
  108.               (pattern "((Dbl|%)(PAL|NTSC)|MultiScan|VGAOnly)")
  109.               (infos))
  110.    (copyfiles (source  "SYS:Expansion")
  111.               (dest    (tackon outputdisk "Expansion"))
  112.               (pattern "#?"))
  113.    (makedir (tackon outputdisk "Fonts"))
  114.    (copyfiles (source  "L:")
  115.               (dest    (tackon outputdisk "L"))
  116.               (pattern "#?FileSystem"))
  117.    (copyfiles (source  "Libs:")
  118.               (dest    (tackon outputdisk "Libs"))
  119.               (pattern "(68040|amigaguide|asl|iffparse|locale|version).library"))
  120.    (makedir (tackon outputdisk "Locale"))
  121.    (makedir (tackon outputdisk "Locale/Catalogs"))
  122.    (copyfiles (source  "Locale:Countries")
  123.               (dest    (tackon outputdisk "Locale/Countries"))
  124.               (pattern "#?"))
  125.    (copyfiles (source  "Locale:Languages")
  126.               (dest    (tackon outputdisk "Locale/Languages"))
  127.               (pattern "#?"))
  128.    (makedir (tackon outputdisk "Prefs"))
  129.    (makedir (tackon outputdisk "Prefs/Env-Archive"))
  130.    (copyfiles (source  "ENVARC:Sys")
  131.               (dest    (tackon outputdisk "Prefs/Env-Archive/Sys"))
  132.               (pattern "(pointer|locale|palette|wbconfig).(ilbm|prefs)"))
  133.    (copyfiles (source  "S:")
  134.               (dest    (tackon outputdisk "S"))
  135.               (pattern "Startup-Sequence"))
  136.    (makedir (tackon outputdisk "System"))
  137.    (makedir (tackon outputdisk "T"))
  138.    (makedir (tackon outputdisk "Tools"))
  139.    (makedir (tackon outputdisk "Utilities"))
  140.    (makedir (tackon outputdisk "WBStartup"))
  141. )
  142.  
  143. ;======================================================================
  144. ;
  145. ; This function asks about the language, and sets the global "lang" to
  146. ; the language bit mask returned by the request.
  147. ;
  148.  
  149. (procedure ASKLANGUAGE
  150.     (set lang (askoptions (prompt #which-language)
  151.                           (help #which-language-help)
  152.                           (choices "dansk"
  153.                                    "deutsch"
  154.                                    "english"
  155.                                    "français"
  156.                                    "italiano"
  157.                                    "norsk"
  158.                                    "suomi"
  159.                                    "svenska")
  160.                           (default 0))))
  161.     
  162. ;======================================================================
  163. ;
  164. ; This function finds a de-archiver in the user's system, resulting to
  165. ; a panic "ask-the-user" if none can be found.
  166. ;
  167.  
  168. (procedure FINDARCPROG
  169.    (set n 0)
  170.    (while (set test (select n "lharc"
  171.                               "lha"
  172.                               "lz"
  173.                               ""))
  174.       (if (not (run (cat "which " test)))
  175.           (set arcprog test))
  176.       (set n (+ n 1)))
  177.  
  178.    (if (= arcprog "")
  179.        (set arcprog (askfile (prompt #get-dearchiver)
  180.                              (help @askfile-help)
  181.                              (default "C:"))))
  182. )
  183.  
  184. ;======================================================================
  185. ;
  186. ; This function gets the locale file information.  We mark the occasion
  187. ; with bit 0 set for the availability of the subdirectory, bit 1 set 
  188. ; for the availability of the archive file. 
  189. ;
  190.  
  191. (procedure ANYLOCALE
  192.    (set localecode 0)
  193.    (if (exists locale-catalogs)
  194.        (set localecode 1))
  195.    (if (exists locale-archive)
  196.        (set localecode (+ localecode 2)))
  197.    localecode)
  198.  
  199. ;======================================================================
  200. ;
  201. ; This function transfers a locale file from the appropriate archive
  202. ; entry to the proper LOCALE:Catalogs subdirectory.
  203. ;
  204.  
  205. (procedure DOCATARCS
  206.    (if (= arcprog "") (FINDARCPROG))
  207.    (if (<> arcprog "")
  208.        ((working "\nDe-archiving selected catalogs\n")
  209.     (makedir #tmp-dir)
  210.         (set arcsfiles (cat #subdir-catalog "/(" arclst ")/#?"))
  211.         (set dearc-com (cat arcprog " >NIL: <NIL: e " locale-archive " "
  212.                             arcsfiles))
  213.         (set script (tackon #tmp-dir "de-archive-script"))
  214.         (textfile (dest script)
  215.                   (append (cat "cd " #tmp-dir "\n" dearc-com "\n")))
  216.         (execute script)
  217.         (copyfiles (source (tackon #tmp-dir #subdir-catalog))
  218.                    (dest   output-catalog)
  219.                    (pattern "#?"))
  220.         (run (cat "Delete >NIL: <NIL: " #tmp-dir " all")))))
  221.  
  222. ;======================================================================
  223. ;
  224. ; This function transfers the locale files from the appropriate 
  225. ; existing subdirectories (in "sublst")  to the corresponding
  226. ; LOCALE:Catalogs subdirectories.
  227. ;
  228.  
  229. (procedure DOCATSUBS
  230.    (copyfiles (source locale-catalogs)
  231.               (dest   output-catalog)
  232.               (pattern (cat "(" sublst ")"))))
  233.  
  234. ;======================================================================
  235. ;
  236. ; This function selects the language to be installed.
  237. ;
  238.  
  239. (procedure DOLOCALE
  240.    (set n      0
  241.         sublst ""
  242.         arclst "")
  243.    (while (set language (select n "dansk"
  244.                                   "deutsch"
  245.                                   "english"
  246.                                   "français"
  247.                                   "italiano"
  248.                                   "norsk"
  249.                                   "suomi"
  250.                                   "svenska"
  251.                                   ""))
  252.      (if (AND (IN lang n) (<> n 2))
  253.         (if (exists (tackon locale-catalogs (tackon language #dscatname)))
  254.             (if (= sublst "") (set sublst language) (set sublst (cat sublst "|" language)))
  255.             (if (= arclst "") (set arclst language) (set arclst (cat arclst "|" language)))))
  256.      (set n (+ n 1)))
  257.    (if (<> sublst "") (DOCATSUBS))
  258.    (if (<> arclst "") (DOCATARCS)))
  259.  
  260. ;======================================================================
  261. ;
  262. ; This procedure asks about installation of catalogs.
  263. ;
  264.  
  265.  
  266. (procedure ASKLOCALE
  267.     (if (ANYLOCALE)
  268.         (if (askbool (prompt #any-locale)
  269.                      (help #any-locale-help)
  270.                      (choices "Yes" "Skip This Part")
  271.                      (default 1))
  272.                   
  273.             ((set askmode 0)
  274.              (ASKLANGUAGE)
  275.              (DOLOCALE)))))
  276.  
  277. ;======================================================================
  278. ;
  279. ; The main program
  280.  
  281. (set inputdir          (pathonly @icon))
  282. (set locale-archive    (tackon inputdir "DSLocale.lha")
  283.      locale-catalogs   (tackon inputdir #subdir-catalog)
  284.      arcprog           ""
  285.      @default-dest     "DF0:")
  286.  
  287. ; First, lets put the DiskSalv stuff in place on a formatted disk.
  288.  
  289. (if (askbool (prompt #disksalv-install)
  290.          (help #disksalv-install-help)
  291.              (choices "Ok" "Cancel")
  292.              (default 1))
  293.    ((set outputdisk  
  294.           (askdir (prompt  #which-disk)
  295.           (help    @askdir-help)
  296.           (default @default-dest)))
  297.      (set @default-dest outputdisk)
  298.      (FORMATDISK)
  299.      (copyfiles (source inputdir)
  300.                 (dest outputdisk)
  301.                 (pattern "DiskSalv")
  302.                 (files)
  303.                 (infos))
  304.      (tooltype  (dest (tackon outputdisk "DiskSalv"))
  305.                 (noposition))
  306.      (MAKESYS)
  307.      (set output-catalog (tackon outputdisk #subdir-catalog))
  308.      (ASKLOCALE)
  309.      (message #ds-done))
  310.     (set @default-dest ""))
  311.  
  312.  
  313.