SRL Archive - S.M.A.R.T.

Get SMART version


Bixby Sayz

2012-05-11 07:52:58

Is there a way to check the SMART version from within a script?

riwu

2012-05-11 08:01:05

you will probably need some additional plugins. But why do u want to do that? SMART gets updated together with simba iirc

Bixby Sayz

2012-05-11 11:03:36

I'll take that as a no.

BenLand100

2012-05-11 18:14:10

There is no implemented way, but you can check the window title programatically. It's a hack, but it might serve your purposes. I can add this into v7.1, never really considered a need for it though.

Brandon

2012-05-11 18:42:20


Function GetSmartVersion: String;
var
T: TSysProcArr;
I, V, D: Integer;
begin
T := GetProcesses;
for I := High(T) downto 0 do
if Pos('SMART', T[I].Title) <> 0 then
begin
V:= Pos('v', T[I].Title);
D:= Pos(' -', T[I].Title);
Result:= Copy(T[I].Title, V + 1, D - V);
end;
end;

Will print it like: 6.9

If you remove the 1 from the result, it will print v6.9

Bixby Sayz

2012-05-11 19:06:35

Yeah that will work, but now that I think about it still won't do what I want.

If I use a particular feature/function of the latest SMART (I'm always using the latest pre-release just because) it fails to compile on other machines because their version of SMART may not have the function I called.

Was trying to figure out a way to conditionally compile so if newer version x include this code, otherwise compile that code for older version y.

Brandon

2012-05-11 19:39:16

If Simba suported pre-processor directives properly! then the following would work:


{$IF Version}
{$ELSE}
{$DEFINE First}
{$ENDIF}

{$IFDEF First}
RunSomeFunction;
{$ENDIF}

Since it doesn't support it then your out of luck for now :c