English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. Scripting (https://eab.abime.net/forumdisplay.php?f=117)
-   -   AmigaDOS version check script (https://eab.abime.net/showthread.php?t=102550)

quantum8 03 June 2020 02:40

AmigaDOS version check script
 
I'm writing a script and have run into issues when running it on 3.1 and 3.9, but it works great on 3.1.4 as it depends on a rather long script generated from the results of the LIST command.


Without spending much more time on rewriting the thing I'm thinking of putting in an OS version check in the script but I'm having issues with that too.


It seems the method below can tell me if I'm trying with 3.1, but it can't distinguish between 3.9 (45.127) and 3.1.4 (45.194) due to the major release version being the same. Adding the minor version seems to cause it to fail completely. Are there better ways of performing this check?




VERSION >nil: workbench.library 45
IF WARN
echo "This script will only function on AmigaOS 3.1.4 or later."
QUIT 20
ENDIF


Minuous 03 June 2020 06:15

If the major versions are the same, call Version again but this time with the REVISION keyword, and it will use the minor version instead. Eg. something like this:

VERSION >nil: workbench.library 45
IF WARN
echo "This script will only function on AmigaOS 3.1.4 or later."
QUIT
ENDIF
VERSION >nil: workbench.library 46
IF WARN
VERSION >NIL: workbench.library REVISION 194
IF WARN
echo "This script will only function on AmigaOS 3.1.4 or later."
QUIT
ENDIF
ENDIF

thomas 03 June 2020 17:49

Quote:

Originally Posted by quantum8 (Post 1404595)
it can't distinguish between 3.9 (45.127) and 3.1.4 (45.194)


Which function do you need which is in workbench.library 45.194 which is not in 45.127? I can't think of any.

If you need a certain component of AmigaOS at a specific level, then you should check that component and not a completely unrelated one.

Most components of 3.1.4 are at version 46, workbench.library is one of the exceptions.

Minuous 03 June 2020 18:11

Yes, you should be checking the version of the List command instead of workbench.library, as Thomas points out.

quantum8 04 June 2020 01:12

I was so deep in it that I forgot the obvious! Thanks for the suggestions here, I'll use version of list as a decider.

As a side note, I copied the list command to 3.1 and the script still failed at the list command. I guess the CLI can't parse lines over a certain length on 3.1/3.9.

Opening the script in ED and moving to the line where the list command is and the status area pops up with "line too long" error. It appears to be a 200 character limit, not sure if that's OS or ED related though.

daxb 04 June 2020 14:28

ED doesn't like to long lines. Command line length is limited to something like ~250 chars.

Thomas Richter 08 August 2020 13:17

Quote:

Originally Posted by quantum8 (Post 1404948)
As a side note, I copied the list command to 3.1 and the script still failed at the list command. I guess the CLI can't parse lines over a certain length on 3.1/3.9.

In 3.1, there is a maximum line limit of 512 characters for the Shell. This limit fell with the v45 shell and hence at least one of the BBs of 3.9. For same reason, there is no such limit in 3.1.4 either, the Shell can process arbitrarily long lines (ok, limited by free memory of course).


Quote:

Originally Posted by quantum8 (Post 1404948)
Opening the script in ED and moving to the line where the list command is and the status area pops up with "line too long" error. It appears to be a 200 character limit, not sure if that's OS or ED related though.

That is an "Ed" limit. "Ed" is a fairly primitive design, with a fixed size buffer and fixed line length limit.

Tomislav 18 August 2020 13:38

KickStarts which workbench.library is NOT in ROM are A4000T, 3.X, "3.9" (custom user 3.1 ROM), 3.1.4 and I think future 3.2. That means that workbench.library can not be used to verify version of KickStart ROM. Maybe better to test exec.library version.

OSes 3.5 and 3.9 are for use with KickStart 3.1. Eventually can use custom "3.9" KickStart. For those OSes is better to test version.library which is in LIBS directory.


All times are GMT +2. The time now is 10:13.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.16047 seconds with 11 queries