home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 82 / af082a.adf / FloppyInstall < prev    next >
Text File  |  1995-12-18  |  9KB  |  347 lines

  1. ;;
  2. ;;  $Final Writer Lite Cover Disk Floppy Installation Script British (UK) Version $
  3. ;;  $Date: 1995/12/18 13:12:23 $
  4. ;;  $Revision: 1.1 $
  5. ;;
  6.  
  7. (set is_update 0)
  8. (set @user-level 1)    ; force to use average mode
  9. (complete 0)
  10.  
  11. ; Installation Disk Names
  12. ;
  13. (set #install_disk_1 "Disk 1")
  14.  
  15. (set #program_disk_1 "FWProgram")
  16. (set #program_disk_2 "FWSystem")
  17.  
  18. (set #ram_disk "ram:")
  19.  
  20. (set #fw_drawer_name "FinalWriter_Lite_B")
  21.  
  22. ; LHex file
  23. ;
  24. (set #lhex_program
  25. (cat    #install_disk_1
  26.         ":lhex"
  27. ))
  28.  
  29. ; Format program
  30. ;
  31. (set #format_program
  32. (cat    #install_disk_1
  33.         ":Format"
  34. ))
  35.  
  36. ; -------------------------------------------------------------------
  37. ; TEXT TRANSLATION SHOULD BEGIN HERE - Translate everything in quotes.
  38. ;
  39.  
  40. (set #ask_disk_prompt
  41. (cat    "\n\nPlease insert \"%s\" in any drive."
  42. ))
  43.  
  44. (set #ask_disk1_help
  45. (cat    "\"%s\" contains the Final Writer program, libraries, system fonts, and data files to be installed.\n\n"
  46.         @askdisk-help
  47. ))
  48.  
  49. (set #ask_disk_prompt_extra
  50. (cat    "\n(This is the disk that was most recently formatted.)"
  51. ))
  52.  
  53. (set #install_program            "Installing Final Writer program from \"%s\".")
  54. (set #install_program_icon        "Installing Final Writer program and icon from \"%s\".")
  55. (set #install_datafiles            "Installing Data Files from \"%s\".")
  56. (set #install_libs                "Installing Libraries from \"%s\".")
  57. (set #install_sysfonts            "Installing System Fonts from \"%s\".")
  58. (set #install_sampledocs        "Installing Sample Documents from \"%s\".")
  59.  
  60. (set #install_program_err        "Error installing Final Writer Program.")
  61. (set #install_datafiles_err    "Error installing Data Files.")
  62. (set #install_libs_err            "Error installing Libraries.")
  63. (set #install_sysfonts_err        "Error installing System Fonts.")
  64. (set #install_ssmpledocs_err    "Error installing Sample Documents.")
  65.  
  66. (set #kickstart_err
  67. (cat    "You must have Workbench 2.04 or greater to install Final Writer! "
  68.         "(Workbench version 37.67 and Kickstart 37.175 or greater.)"
  69. ))
  70.  
  71. (set #welcome_message
  72. (cat    "Welcome to the FinalWriter_Lite Floppy Disk Installation Utility. "
  73.         "You will need to have two (2) empty floppy disks available for the "
  74.         "installation. The installation procedure will format and install "
  75.         "the correct files to each floppy disk. Please note that all "
  76.         "previous data on each disk to be formatted will be lost. As a "
  77.         "precaution you should make sure that your installation disks "
  78.         "(Disk 1) are write protected.\n\n"
  79.         "The two disks created will be named "
  80.         #program_disk_1
  81.         ", and "
  82.         #program_disk_2
  83.         "."
  84. ))
  85.  
  86. (set #insert_empty_message
  87. (cat    "Please insert an empty disk into drive df0:.\n\n"
  88.         "This disk will be formatted as \"%s\" and the correct files will be installed.\n\n"
  89.         "WARNING: All data currently on the disk will be lost! Click on \"Proceed\" "
  90.         "when you are sure that you have an empty disk in drive df0:."
  91. ))
  92.  
  93. (set #format_message
  94. (cat    "Disk \"%s\" is being formatted.\n"
  95.         "Please wait."
  96. ))
  97.  
  98. (set #format_err
  99. (cat    "Error formatting disk \"%s\"."
  100. ))
  101.  
  102. ;
  103. ; TEXT TRANSLATION SHOULD END HERE - nothing below needs translation.
  104. ; -------------------------------------------------------------------
  105.  
  106.  
  107. ;==========================================
  108. ; Procedure to get and format an empty disk
  109. ;
  110. ; Inputs:
  111. ;    format_disk_name    - the name of the disk to format.
  112. ;
  113. ;==========================================
  114. (procedure GetAndFormatDisk
  115.     (set @execute-dir "")
  116.     (set empty_disk 0)
  117.     (set last_disk 2)
  118.  
  119.     (while (= empty_disk 0)
  120.         (
  121.             ; Ask for empty disk.
  122.             ;
  123.             (message (#insert_empty_message format_disk_name))
  124.  
  125.             ; Check if the inserted disk is empty.
  126.             ; We will consider it empty if the disk is not one
  127.             ; of our installation disks or one of the floppy
  128.             ; disks that the installation has created.
  129.             ;
  130.             (set which_disk 0)
  131.             (set no_go 0)
  132.             (set device_name (getassign "df0" "d"))
  133.             (while (AND (<= which_disk last_disk) (= no_go 0))
  134.                 (
  135.                     (set which_disk_name
  136.                         (select which_disk
  137.                             #install_disk_1
  138.                             #program_disk_1
  139.                             #program_disk_2
  140.                         )
  141.                     )
  142.  
  143.                     (if (= device_name (cat which_disk_name ":"))
  144.                         (set no_go 1)
  145.                     )
  146.  
  147.                     (set which_disk (+ which_disk 1))
  148.                 )
  149.             )
  150.  
  151.             (if (AND (= no_go 0) (> which_disk last_disk))
  152.                 (set empty_disk 1)
  153.             )
  154.         )
  155.     )
  156.  
  157.     (working (#format_message format_disk_name))
  158.     (set error
  159.         (run
  160.             ("%s DRIVE DF0: NAME %s FFS NOICONS" Formatter format_disk_name)
  161.         )
  162.     )
  163.  
  164.     (if error
  165.         (abort (#format_err format_disk_name))
  166.     )
  167. )
  168.  
  169. ;==========================================
  170. ; Procedure to get archive file and install
  171. ; its files to a program disk.
  172. ;
  173. ; Inputs:
  174. ;    install_disk_name        -    the name of the installation disk the file is on.
  175. ;    install_disk_help        -    help string for ask disk.
  176. ;    lha_file                    -    the name of the archive file
  177. ;    program_disk_name        -    name of the program disk to install to
  178. ;    new_drawer_name        -    name of drawer to create on program disk.
  179. ;                                    empty string "" if no drawer needed.
  180. ;    working_msg                -    message to display when installing
  181. ;    error_msg                -    message in case of error.
  182. ;
  183. ;==========================================
  184. (procedure InstallArchive
  185.     ;
  186.     ; Ask for the installation disk.
  187.     (askdisk
  188.         (prompt    (#ask_disk_prompt install_disk_name))
  189.         (help        (install_disk_help install_disk_name))
  190.         (dest        install_disk_name)
  191.     )
  192.  
  193.     ; Copy the lha file to ram:
  194.     (copyfiles
  195.         (source    (cat install_disk_name ":" lha_file))
  196.         (dest        #ram_disk)
  197.     )
  198.  
  199.     ; Ask for the program disk.
  200.     (askdisk
  201.         (prompt    (cat (#ask_disk_prompt program_disk_name) #ask_disk_prompt_extra))
  202.         (help        @askdisk-help)
  203.         (dest        program_disk_name)
  204.     )
  205.  
  206.     ; Make the drawer.
  207.     (if new_drawer_name
  208.         (makedir (cat program_disk_name ":" new_drawer_name) (infos))
  209.     )
  210.  
  211.     ; Unarchive the lha files.
  212.     (set @execute-dir (cat program_disk_name ":" new_drawer_name))
  213.     (working (working_msg install_disk_name))
  214.     (set error
  215.         (run
  216.             ("\"%s\" -f x \"%s\" >NIL:" DeArcher (cat #ram_disk lha_file))
  217.         )
  218.     )
  219.     (delete (cat #ram_disk lha_file))
  220.  
  221.     (if error
  222.         (abort error_msg)
  223.     )
  224. )
  225.  
  226.  
  227. ; Make sure we are running under V37 or higher...
  228. (if (< (/ (getversion) 65536) 37)
  229.     (
  230.     (abort    #kickstart_err)
  231.     )
  232. )
  233.  
  234. (message #welcome_message)
  235.  
  236. ; Copy the extraction and format utility
  237. ; to ram: and remember where they are.
  238. (copyfiles
  239.     (source    #lhex_program)
  240.     (dest        #ram_disk)
  241. )
  242. (set DeArcher (tackon #ram_disk "lhex"))
  243.  
  244. (copyfiles
  245.     (source    #format_program)
  246.     (dest        #ram_disk)
  247. )
  248. (set Formatter (tackon #ram_disk "Format"))
  249.  
  250.  
  251. ; ==========================================
  252. ; Get and Format FWProgram: (program disk 1)
  253. ; ==========================================
  254. (set format_disk_name #program_disk_1)
  255. (GetAndFormatDisk)
  256.  
  257. ; --------------------------
  258. ; Install the program.
  259. ;
  260. (set install_disk_name #install_disk_1)
  261. (set install_disk_help #ask_disk1_help)
  262. (set lha_file "FinalWriter.lha")
  263. (set program_disk_name #program_disk_1)
  264. (set new_drawer_name "")
  265. (set working_msg #install_program_icon)
  266. (set error_msg #install_program_err)
  267. (InstallArchive)
  268.  
  269. (complete 20)
  270.  
  271.  
  272. ; =========================================
  273. ; Get and Format FWSystem: (program disk 2)
  274. ; =========================================
  275. (set format_disk_name #program_disk_2)
  276. (GetAndFormatDisk)
  277.  
  278. ; --------------------
  279. ; First install FWFiles...
  280. ;
  281. (set install_disk_name #install_disk_1)
  282. (set install_disk_help #ask_disk1_help)
  283. (set lha_file "FWFiles.lha")
  284. (set program_disk_name #program_disk_2)
  285. (set new_drawer_name "FWFiles")
  286. (set working_msg #install_datafiles)
  287. (set error_msg #install_datafiles_err)
  288. (InstallArchive)
  289.  
  290. (complete 40)
  291.  
  292. ; ---------------------
  293. ; Now Install FWLibs...
  294. ;
  295. (set install_disk_name #install_disk_1)
  296. (set install_disk_help #ask_disk1_help)
  297. (set lha_file "FWLibs.lha")
  298. (set program_disk_name #program_disk_2)
  299. (set new_drawer_name "FWLibs")
  300. (set working_msg #install_libs)
  301. (set error_msg #install_libs_err)
  302. (InstallArchive)
  303.  
  304. (complete 60)
  305.  
  306. ; ---------------------
  307. ; Now Install FWFonts...
  308. ;
  309. (set install_disk_name #install_disk_1)
  310. (set install_disk_help #ask_disk1_help)
  311. (set lha_file "FWFonts.lha")
  312. (set program_disk_name #program_disk_2)
  313. (set new_drawer_name "FWFonts")
  314. (set working_msg #install_sysfonts)
  315. (set error_msg #install_sysfonts_err)
  316. (InstallArchive)
  317.  
  318. (complete 80)
  319.  
  320. ; ---------------------
  321. ; Now Install FWDocs...
  322. ;
  323. (set install_disk_name #install_disk_1)
  324. (set install_disk_help #ask_disk1_help)
  325. (set lha_file "FWDocs.lha")
  326. (set program_disk_name #program_disk_2)
  327. (set new_drawer_name "FWDocs")
  328. (set working_msg #install_sampledocs)
  329. (set error_msg #install_sampledocs_err)
  330. (InstallArchive)
  331.  
  332. ; ---------------------
  333. ; Create empty ClipArt and TextClip drawers.
  334. ;
  335. (makedir (cat #program_disk_2 ":FWClipArt") (infos))
  336. (makedir (cat #program_disk_2 ":FWTextClips") (infos))
  337.  
  338. (delete DeArcher)
  339. (delete Formatter)
  340. (run ("C:Avail FLUSH"))
  341.  
  342. (complete 100)
  343.  
  344. (set @default-dest "")
  345. (exit)
  346.  
  347.