UtilityBase
Your guide to Amiga development |
|
|
|
|
|
|
| |
| |
| |
|
|
|
Online members:
abalaban 27 min(s) ago tboeckel 35 min(s) ago
26 guests are online.
You are an Anonymous user. You can register for free by clicking here. |
|
|
| |
| |
| |
| |
| |
| |
UtilityBase needs your
help!
Install SObjs with Installer by Chris Young Link: Install SObjs with Installer (php)
This script allows shared objects to be easily installed using Installer. Most shared objects do not contain AmigaOS version strings, the procedure will check date stamps and prompt if appropriate (showing the original and new file sizes for comparison), if this is the case.
The procedure can be added to any Installer script. Shared objects must be stored in an SObjs sub-directory from the source installation, and will be copied to SObjs: assign. Copying is then as easy as:
(p_copysobj "libgcc.so")
(procedure p_copysobj #sobj
; copy shared objects easily with version/date checking
; http://www.unsatisfactorysoftware.co.uk
;
; Source SObjs must be in SObjs directory, and will be copied to SObjs: assign
; Usage:
; (p_copysobj "libgcc.so")
(set #sobj-version (getversion (tackon "SObjs/" #sobj)))
(if (= #sobj-version 0)
 (
  (transcript "Date compare copy " #sobj)
  (if (exists (tackon "SObjs:" #sobj))
   (
    (set #file-newer (earlier (tackon "SObjs:" #sobj) (tackon "SObjs/" #sobj)))
    (if (= #file-newer 0)
     (
      (set #newer-text "has an older datestamp")
     )
     ;else
     (
      (set #newer-text "has a newer datestamp")
     )
    )
    (set #old-size (getsize (tackon "SObjs:" #sobj)))
    (set #new-size (getsize (tackon "SObjs/" #sobj)))
    (if (AND (= #old-size #new-size) (= #file-newer 0))
     (
      (set #copy 0)
     )
     ;else
     (
      (if (OR (= @user-level 2) (AND (= @user-level 1) (<> #file-newer 0)))
; Expert users are always prompted
; Average users are prompted if the file trying to be copied is newer
; Novice users are never prompted
; This is roughly equivalent to (copylib (confirm))
; No prompting occurs if the destination does not exist (silent copy)
; or the files are the same size and the one being copied isn't newer (don't copy)
       (
        (set #copy
         (askbool
          (prompt "Copying " #sobj "...\n\n"
           "Version to install: " #new-size " bytes\n"
           "Version currently installed: " #old-size " bytes\n\n"
           "The file to copy " #newer-text)
          (help @askbool-help)
          (default #file-newer)
          (choices "Proceed with copy" "Skip this part")
         )
        )
       )
       ;else
       (
        (set #copy #file-newer)
       )
      )
     )
    )
   )
   ; else if dest file does not exist
   (
    (set #copy 1)
   )
  )
  (if (<> #copy 0)
   (
    (copyfiles
     (prompt "Copying " #sobj "...")
     (help @copyfiles-help)
     (source (tackon "SObjs/" #sobj))
     (dest "SObjs:")
     (optional "nofail" "force")
    )
   )
  )
 )
 ; else if version info is available
 (
  (copylib
   (prompt "Copying " #sobj "...")
   (help @copylib-help)
   (source (tackon "SObjs/" #sobj))
   (dest "SObjs:")
   (optional "nofail" "force")
   (confirm "expert")
  )
 )
)
)
|
|
|
|
|
|
UtilityBase is a site focused on development for Amiga systems,
spanning over all different Amiga clones, that be AmigaOS 3.x, 4.x,
MorphOS, AROS or AmigaDE/Anywhere. News syndication:  Contact address: mail@utilitybase com
|
|
|