Get MUI version
Get MUI version
Hi there
I'm wondering if it's possible to get the installed MUI version with RapaGUI. Because some features are only available from a specific MUI version onwards, I'd like to implement some fallback behaviour for lower MUI version.
Example:
Button.Icon needs MUI 4.0 or newer, so for lower MUI version I'd like to use text instead.
How would I best do this?
I'm wondering if it's possible to get the installed MUI version with RapaGUI. Because some features are only available from a specific MUI version onwards, I'd like to implement some fallback behaviour for lower MUI version.
Example:
Button.Icon needs MUI 4.0 or newer, so for lower MUI version I'd like to use text instead.
How would I best do this?
Re: Get MUI version
You could use the AmigaOS version command
Note that the version command will not return the MUI version as 3.8 or 5.0, but the build number something like 20.344 etc.
I dont have the complete version history for MUI, but here is a small list of MUI version numbers I found for OS3.
3.8 = 19.14
3.9 2014.R1 = 20.340
3.9 2015.R1 = 20.344
4.0 2015.R1 = 20.378
4.0 2015.R4 = 20.382
5.0 = 21.23
Code: Select all
Execute("version mui:mui > ram:mui.ver")
OpenFile(1, "ram:mui.ver")
muiver$ = ReadLine(1)
CloseFile(1)
muiver = Val(RightStr(muiver$, StrLen(muiver$)-4))
If muiver > 20.344 Then SystemRequest("Mui version", "Your MUI version is above version 3.9 2015.R1/nYour Mui version number is: "..muiver, "OK")
I dont have the complete version history for MUI, but here is a small list of MUI version numbers I found for OS3.
3.8 = 19.14
3.9 2014.R1 = 20.340
3.9 2015.R1 = 20.344
4.0 2015.R1 = 20.378
4.0 2015.R4 = 20.382
5.0 = 21.23
Re: Get MUI version
It would be better to check the version from muimaster.library, because the main MUI program isn't at the same location on every system and the library is what finally defines the actual MUI version you use.
I also modified the code otherwise how I'd do it, although it doesn't affect to functionality, but for myself it would be a bit tidyer and will work if you decide to change the file you check (no fixed values depending on strlen).
I also modified the code otherwise how I'd do it, although it doesn't affect to functionality, but for myself it would be a bit tidyer and will work if you decide to change the file you check (no fixed values depending on strlen).
Code: Select all
Execute("version muimaster.library > ram:mui.ver")
muiver$ = FileToString("ram:mui.ver")
muiver = ToNumber(PatternFindStrShort(muiver$, "(%d+%.%d+)"))
If muiver > 20.344 Then SystemRequest("Mui version", "Your MUI version is above version 3.9 2015.R1/nYour Mui version number is: "..muiver, "OK")
Re: Get MUI version
Thanks, guys. This is how I'll do it.
As a side-question: Is there a way to circumwent the creation of a temp file in ram: and to directly receive the return string of the version command?
As a side-question: Is there a way to circumwent the creation of a temp file in ram: and to directly receive the return string of the version command?
Re: Get MUI version
No,
but I would suggest to use HW own functions for creating temporary files insted of hardcoded filenames.
but I would suggest to use HW own functions for creating temporary files insted of hardcoded filenames.
Re: Get MUI version
And a feature request to Andreas:
Could Execute() be made to return the output of the executed program?
Could Execute() be made to return the output of the executed program?
Re: Get MUI version
Maybe something like this is what you are looking for:
Code: Select all
Function p_getOutput(msg)
Switch(msg.action)
Case "RunOutput":
Print(msg.output)
EndSwitch
EndFunction
InstallEventHandler({RunOutput = p_getOutput})
Print("MUI version from event handler:\n")
Run("version", "muimaster.library")
Repeat
WaitEvent()
Forever
PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
Re: Get MUI version
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Get MUI version
Unlikely. Getting this to work with Run() on all platforms was a major pain and I'm not really keen on going through this again. Better just pipe the output to an external file and get it from there. Alternatively, you could also try to use a modal loop with CheckEvents() or something but that won't work with RapaGUI 2.0.