home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / AdPro2_5_0-5.DMS / AdPro2_5_0-5.adf / Install-Patch < prev    next >
Encoding:
Text File  |  1993-12-18  |  8.9 KB  |  332 lines

  1. ; $Id: Install-Patch,v 1.2 93/05/20 17:37:23 lee Exp $
  2. ;
  3. ; This is the 4.61 patch install script for DeluxePaint AGA 
  4. ; © 1993 Electronic Arts Inc. All Rights Reserved
  5. ;
  6. ; The order in which the user is requested to things is
  7. ; as follows:
  8. ;
  9. ; 1) Input the DPaintIV Install Disk 1
  10. ; 2) Input a Destination Disk (to clone DPaintIV Install Disk)
  11. ; 3) Input 4.61 Patch Disk for patch data
  12. ; 4) Input Destination Disk to receive patched data
  13. ;
  14. ; CHANGES BY ASDG:
  15. ; 93/12/18 - Changed icon settings and volume name to "ADPro_D5".
  16. ;
  17. (set @default-dest "Work:")
  18.  
  19. ; due to a problem with spatch command line parsing, the name of 
  20. ; the patch disk should not contain spaces.
  21. (set PATCH_NAME   "ADPro_D5")
  22. (set PATCH_VOLUME (cat PATCH_NAME ":"))
  23.  
  24. (set SOURCE_NAME "DPaintIV Install Disk 1")
  25. (set SOURCE_VOLUME (cat SOURCE_NAME ":"))
  26.  
  27. (set DEST_NAME "DPaint 4.61 Install Disk")
  28. (set DEST_VOLUME (cat DEST_NAME ":"))
  29.  
  30. (set ASSIGN   "DPaintIV")
  31. (set PROGNAME "DPaint")
  32. (set UNPACKER "lharc")
  33. (set RUNWIN "NIL:")
  34.  
  35.  
  36. (set PATCHER   (cat PATCH_VOLUME "spatch"))
  37. (set PATCHFILE (cat PATCH_VOLUME "DPaint.pch"))
  38.  
  39. (set LHARC_EXTRACT_HELP
  40.   (cat
  41.     "The Installer will use LHARC to extract the DPaint program. "
  42.         "from its archive on the original install disk."
  43.   )
  44. )
  45.  
  46. (set LHARC_ADD_HELP
  47.   (cat
  48.     "The Installer will use LHARC to add the patched version DPaint "
  49.         "to its archive on your new install disk."
  50.   )
  51. )
  52.  
  53. (set PATCH_HELP
  54.   (cat 
  55.        "The Installer will use the SPATCH utility from SAS/C to make "
  56.        "changes to a copy of your original DPaint program."
  57.   )
  58. )
  59.  
  60. (set RENAME_HELP
  61.    (cat "The Installer will rename the floppy disk you provided "
  62.         "from \""DEST_NAME"\" to \"" SOURCE_NAME "\" so it can replace "
  63.         "your original disk in the DPaint installation process."
  64.    )
  65. )
  66.  
  67. (set INIT_HELP
  68.     (cat
  69.           "The DPaint 4.61 patch requires your original 4.5 install "
  70.                 "disk and an installed version of DPaint 4.5.  The patch "
  71.                 "will copy the original program file to ram, modify it, "
  72.                 "and copy the modified version to the directory where you "
  73.                 "have installed DPaint 4.5.\n\n"
  74.  
  75.                 "Your original DPaint 4.5 install disk will NOT "
  76.                 "be changed in any way.\n\n"
  77.  
  78.                 "Please make sure your original DPaint 4.5 Install Disk "
  79.                 "is WRITE-PROTECTED and that you have your registration "
  80.                 "number handy."
  81.     )
  82. )
  83.  
  84. (set DIR_HELP
  85.      (cat  "The patch looks for the installed version of DPaint and "
  86.            "replaces the original program file with the patched "
  87.            "version.\n\n"
  88.  
  89.            "Please specify the volume and directory where you "
  90.            "currently have DPaint 4.5 installed."
  91.      )
  92. )
  93.  
  94. (set BACKUP_HELP
  95.      (cat "If you select \"Yes,\" the installer will copy the currently "
  96.           "installed version of \"DPaint\" to a "Backup" directory. "
  97.           "If you select \"No,\" the installer will simply replace or "
  98.           "overwrite the installed version with the patched version."
  99.      )
  100. )
  101.  
  102. (procedure ask_sourcedisk
  103.     (askdisk
  104.         (prompt ("Please insert the disk labeled \"%s\"." SrcDiskE))
  105.         (help @askdisk-help)
  106.         (dest SrcDiskE)
  107.     )
  108.  
  109.     (set SrcDiskE (cat SrcDiskE ":"))
  110. )
  111.  
  112. ; Destination disk confirmation.
  113. ;  DstDiskE: The disk to insert
  114. (procedure ask_destdisk
  115.     (askdisk
  116.         (prompt ("Please insert the disk labeled \"%s\"." DstDiskE))
  117.         (help @askdisk-help)
  118.         (dest DstDiskE)
  119.     )
  120.  
  121.     (set DstDiskE (cat DstDiskE ":"))
  122. )
  123.  
  124. (set osversion (/ (getversion) 65536))
  125. (if (< osversion 37)
  126.     (abort    "DeluxePaint requires AmigaDOS 2.04 or later to run.")
  127. )
  128.  
  129. ; Make sure the user has the appropriate disks ready
  130. (
  131.     (if    (askbool
  132.             (prompt "You will need your original \"DPaintIV Install "
  133.                                 "Disk 1\" and an installed version of DPaint 4.5. Your "
  134.                                 "original \"DPaintIV Install Disk 1\" will NOT be "
  135.                                 "modified in any way but your installed version "
  136.                                 "WILL be updated to version 4.61.\n\n"
  137.                
  138.                                 "If you haven't already installed DPaint 4.5 "
  139.                                 "please do so before running this patch.\n\n"
  140.  
  141.                                 "Please have your registration number handy; "
  142.                                 "you will be asked to register your copy "
  143.                                 "of DPaint 4.61"
  144.             )
  145.             (help INIT_HELP)
  146.             (choices "Proceed" "Cancel")
  147.             (default 1)
  148.         )
  149.  
  150.                 (set dummy 1)
  151.         (abort "User aborted installation.")
  152.     )
  153. )
  154.  
  155. ; copy the necessary patch files to ram
  156. (
  157.         (set SrcDiskE PATCH_NAME)
  158.         (ask_sourcedisk)
  159.  
  160.     (copyfiles
  161.         (prompt "")
  162.         (help "")
  163.         (source (tackon SrcDiskE UNPACKER))
  164.         (dest "ram:")
  165.     )
  166.  
  167.         (set UNPACKER  (tackon "ram:" UNPACKER))
  168. )
  169.  
  170.  
  171. ; copy the original program file
  172. (
  173.        (set SrcDiskE SOURCE_NAME)
  174.        (ask_sourcedisk)
  175.         
  176.        ; make sure file isn't already there due to some previous attemp   
  177.        (delete "ram:DPaint")
  178.  
  179.        (working ("Extracting DPaint 4.5 program file"))
  180.        (set archive (tackon SrcDiskE "dpaint.lzh"))
  181.        (set result 
  182.             (run ("%s x \"%s\" ram: dpaint* > %s" UNPACKER archive RUNWIN)
  183.                  (help LHARC_EXTRACT_HELP)
  184.                  (prompt ("Extract original DPaint 4.5 program file?"))
  185.                  (confirm)
  186.             )
  187.        )
  188.        (if result (abort "Error while extracting program"))
  189. )
  190.  
  191.  
  192. (
  193.    (set SrcDiskE PATCH_NAME)
  194.    (ask_sourcedisk)
  195.  
  196.    (working ("Patching DPaint program file"))
  197.  
  198.    ;  make sure file isn't already there due to some previous attempt
  199.    (delete "ram:patched")
  200.  
  201.    (set result 
  202.       (run 
  203.          ("\"%s\" -p%s -oram:patched ram:dpaint > %s" PATCHER PATCHFILE RUNWIN)
  204.          (help PATCH_HELP)
  205.          (prompt ("Patch DPaint 4.5 program file?"))
  206.          (confirm)
  207.       )
  208.    )
  209.  
  210.    (delete "ram:dpaint")
  211.    (if result (abort "Error while patching program"))
  212.    (rename "ram:patched" "ram:dpaint")
  213. )
  214.  
  215. ; see if this is really an update
  216.  
  217. (set dpaint_dest (getassign ASSIGN "a"))
  218.  
  219. ; if update, be sure they want program in same place
  220.  
  221. (if dpaint_dest
  222.     (if (not
  223.             (askbool
  224.                 (prompt "Your current copy of DPaintIV appears to be located in the drawer named \""
  225.                          dpaint_dest
  226.                          "\". Do you want the update installed in that drawer?"
  227.                 )
  228.                 (help   DIR_HELP)
  229.                 (default 1)
  230.             )
  231.         )
  232.  
  233.         (set dpaint_dest        ; if user wants in different place
  234.                      (askdir
  235.                           (prompt "In which disk or drawer should the "
  236.                                   "4.61 patch be installed?"
  237.                           )
  238.                           (help (cat DIR_HELP "\n\n" @askdir-help))
  239.                           (default @default-dest)
  240.                       )
  241.         )
  242.     )
  243.  
  244. ; Update not found, so get a location for program
  245.  
  246.     (set dpaint_dest
  247.         (askdir
  248.             (prompt "Please select the directory where you "
  249.                     "have DPaint 4.5 installed. "
  250.             )
  251.             (help (cat DIR_HELP "\n\n" @askdir-help))
  252.             (default @default-dest)
  253.         )
  254.     )
  255. )
  256.  
  257. ; OK, we know where we'll be installing, so let's make it permanent
  258. (set @default-dest dpaint_dest)
  259.  
  260. (set ProgramFile (tackon dpaint_dest "DPaint"))
  261.  
  262. (if (exists ProgramFile)
  263.     (
  264.        (if (askbool 
  265.                (prompt "Make backup of currently installed program file?")
  266.                (help BACKUP_HELP)
  267.                (default 1)
  268.             )
  269.  
  270.             ; Note: we copy the file to a backup directory instead of 
  271.             ; to a backup file name so the icons won't overlap
  272.             (copyfiles 
  273.                  (source ProgramFile)
  274.                  (dest (tackon dpaint_dest "Backup"))
  275.                  (help BACKUP_HELP)
  276.                  (infos)
  277.             )
  278.        )
  279.     )
  280. )
  281.  
  282. (if (exists (tackon ProgramFile ".info"))
  283.     ; use the existing .info file
  284.     (
  285.       (delete "ram:DPaint.info")
  286.       (copyfiles
  287.         (prompt "")
  288.         (help "")
  289.         (source "ram:DPaint")
  290.         (dest dpaint_dest)
  291.         (confirm)
  292.       )
  293.     )
  294.  
  295.     ; copy the .info file from ram:
  296.     (copyfiles
  297.         (prompt "")
  298.         (help "")
  299.         (source "ram:DPaint")
  300.         (dest dpaint_dest)
  301.         (confirm)
  302.         (infos)
  303.     )
  304. )
  305.  
  306. (delete UNPACKER)
  307. (delete "ram:dpaint")
  308. (delete "ram:dpaint.info")
  309.  
  310. ; Ask if the user would like to register
  311. ; his/herself by running the main program
  312.  
  313. (if (askbool
  314.        (prompt "Would you like to run and personalize your "
  315.                "copy of DPaint 4.61?")
  316.        (help
  317.                 "DPaint 4.61 must be personalized when using for "
  318.                 "the first time. You may choose to run DPaint 4.61 "
  319.                 "later, at which time you will be asked to personalized your copy."
  320.        )
  321.        (default 1)
  322.     )
  323.  
  324.    (run
  325.        ("run >NIL: <NIL: \"%s\"" ProgramFile)
  326.        (help RUNHELP)
  327.        (prompt "Run DPaint 4.61")
  328.        (confirm)
  329.    )
  330. )
  331.  
  332. (exit)