Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
98 user(s) are online (85 user(s) are browsing Forums)

Members: 0
Guests: 98

more...

Support us!

Headlines

 
  Register To Post  

Version AISS [SOLVED]
Illusionist
Illusionist


See User information
I have some question about checking for the version of AISS the Amiga way. The problem is that AISS is not realy a program, more an environment.

Is it ok to create an ASCII file with just the version number?

Where do I have to place this file?

Which other ways are possible or better?

Please no C++ stuff


Edited by Mason on 2007/7/18 22:37:39
Martin "Mason" Merz
www.masonicons.de

I've seen things you people wouldn't believe . . .
Go to top
Re: Version AISS
Not too shy to talk
Not too shy to talk


See User information
@Mason

I thing you could use the setenv/getenv Shellcommands for that.

Something like:
SETENV AISS SAVE 3.11
will create a ASCII file named AISS in Sys:Prefs/Env-Archive, containing the string 3.11

Try GETENV AISS to read it.

Go to top
Re: Version AISS
Illusionist
Illusionist


See User information
@ZeroG

Didn' know that it's that easy!
I will try it at home.
Thanks!

Martin "Mason" Merz
www.masonicons.de

I've seen things you people wouldn't believe . . .
Go to top
Re: Version AISS
Just can't stay away
Just can't stay away


See User information
@Mason

Also stick to a standard format for the versions so that programs can easily check for if it's a >= version. I suggest using the standard version.revision format where revision is >= 1 (i.e. "3.2" for version 3, 2nd revision).

This should be quite easy for a program to parse to obtain the version and revision and then check that it's new enough. Just split them up by replacing the '.' with '\0' and then use StringToLong() or atol() to convert the strings to numbers.

Go to top
Re: Version AISS [SOLVED]
Just popping in
Just popping in


See User information
@Mason

Nono! That's not the way to do it!

You have AISS in a script, right?

Add the following line first:
$VERAISS 3.2

Now you can do a
VERSION Sys:WBStartup/AISS
and get your version.

And this is the Amiga way to do it.

But then again, this only applies for the script. So, to technically update anything would require an update to the script.

ANd, here's a little script to test the version of SYS:WBStartup/AISS. Copy it and test with execute. Of course, add the line above to your script.

version SYS:WBStartup/AISS version 5 

version SYS
:WBStartup/AISS version 5 NIL:
IF 
WARN THEN 
 
echo "over version 5" 
ELSE 
 echo 
"under or equals 5"
ENDIF

version SYS:WBStartup/AISS version 2 >NIL:
IF 
WARN THEN 
 
echo "over version 2" 
ELSE 
 echo 
"under or equals 2"
ENDIF

version SYS:WBStartup/AISS version 3 revision 2 NIL:
IF 
WARN THEN 
 
echo "over version 3.2" 
ELSE 
 echo 
"under or equals to 3.2"
ENDIF


This can even test revisions! Love Amiga scripting!

Go to top
Re: Version AISS [SOLVED]
Not too shy to talk
Not too shy to talk


See User information
@jaokim

But this way it is very hard for a program that want to use AISS to check which version is installed.

Go to top
Re: Version AISS [SOLVED]
Quite a regular
Quite a regular


See User information
@Mason

I use simple ENV variable stored in ENVARC: and ENV:

Quote:

; $VER: AmiKit_UpdateScript 1.3.7
; Updates AmiKit v1.3.6 to version 1.3.7

IF EXISTS SYS:Prefs/Env-Archive/AmiKitVersion
CopyR >NIL: SYS:Prefs/Env-Archive/AmiKitVersion ENV: FOOVR

IF $AmiKitVersion GE "137"

ECHO >SYS:Expansion/RecentAction.log "You tried to install v1.3.7 update into already updated AmiKit :)"
C:Delete >NIL: SYS:Expansion/AmiKit_Update137.lzx FORCE QUIET
SKIP EXIT

ENDIF

IF $AmiKitVersion EQ "136"

...bla bla installation bla bla...

ELSE

ECHO >SYS:Expansion/RecentAction.log "Cannot update from v1.3.6 to v1.3.7 because v1.3.6 was not detected! Please install v1.3.6 update first."
C:Delete >NIL: SYS:Expansion/AmiKit_Update137.lzx FORCE QUIET

ENDIF

ELSE

ECHO >SYS:Expansion/RecentAction.log "AmiKit version number not found..."
C:Delete >NIL: SYS:Expansion/AmiKit_Update137.lzx FORCE QUIET

ENDIF

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 2 ( 0 members and 2 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project