Partner sites: Aminet - Amiga downloadsIntuitionBase - Amiga guidesAmigaNN - Amiga newsAmiFund - Sponsor projects

[Y]UtilityBase
Your guide to Amiga development
Sign up at our provider 
and get $50 off!
Not logged in
  HomeProjectsForumArticlesResourcesLinksChatAbout 
Search
Login
Username:
Password:
Register now!
Forgot your password?
Aminet - Development
ruby-1.8.7.i386-aros.tar.bz2 (dev/lang)
TilesScrollDemo.lha (dev/amos)
Blitz_SGC.lha (dev/basic)
MCC_TextEditor-15.34.lha (dev/mui)
FlexCat-2.7.lha (dev/misc)
ecx222_upd.lha (dev/e)
fd2sfd_68k.lha (dev/misc)
Blitz_lucy.lha (dev/basic)
AWNP_2-54.lha (dev/misc)
sfd2inc.lha (dev/basic)
More...
Newest users
chris (Chris Young)
root9885
dmjones (Kristian Poul Herkild)
graffias79 (Jamie)
yogi35

Pending:
ZebraZeem, Mad_Dog, hhjoker, voxel, JosDuchIt, MarcB, MarBo, Sollaris, sara, species
More...
Who's Online
Online members:

kas1e 25 min(s) ago
Georg 56 min(s) ago

11 guests are online.

You are an Anonymous user. You can register for free by clicking here.
News sites
Amiga-News.de
Amiga.org
AmigaNN
Amigans.net
Amigaweb.net
AmigaWorld.net
AROS-Exec
MorphOS-News.de
MorphZone
polarBoing
Tutorials
Change Graphics cards in AmigaOS 4.
Installing the latest OS4 SDK in Cubic IDE
Writing Installer scripts for AmiUpdate
Cross Compiling for OS4 or OS3 using MS Visual Studio 2005
Installing an AmigaOS 4 cross compiler
More...
Sources
How to open and use the exec debug interface
How to install a hardware interrupt
Install SObjs with Installer
How to make clean picture datatypes
Most of the old ClassACT examples converted to OS4
More...
Documentations
How to write portable code for Amiga (english)
Comment écrire du code portable pour Amiga (français)
Development How to with OS3.9 SDK
The PartyPack Hack
The Amiga PDA Programming Guidelines
More...
DreamHost

Support
UtilityBase

[Valid RSS]

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")
)
)
)
)


Rate this item
12345678910



:: Your comment
Bold Style  Italic Style  Underlined Style  Image Link  Insert URL  Email Link  Quote  C/C++ Source  Disable *What`s that?


Before posting non-english message, check your browser`s encoding!
» Name » Password

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: RSS
Contact address: mail@utilitybase com