@@ -43,7 +43,11 @@ TPythonVersion = record
4343
4444 TPythonVersions = array of TPythonVersion;
4545
46- (* Compares two Version strings and returns -1, 0, 1 depending on result *)
46+ (*
47+ Compares two Version strings and returns -1, 0, 1 depending on result
48+ The function result has the semantics of Delphi compare functions
49+ -1: A is bigger (newer), 0: equal versions, 1: B is bigger (newer)
50+ *)
4751 function CompareVersions (A, B : String) : Integer;
4852
4953
@@ -206,7 +210,7 @@ function GetRegisterPythonVersion(SysVersion: string;
206210 RootKey := Root;
207211 if OpenKey(Key + ' \InstallPath' , False) then begin
208212 PythonVersion.InstallPath := ReadString(' ' );
209- if PythonVersion.IsAllUsers and (CompareVersions(SysVersion, ' 3.5' ) < 0 ) then
213+ if PythonVersion.IsAllUsers and (CompareVersions(SysVersion, ' 3.5' ) > 0 ) then
210214 PythonVersion.DLLPath := ' '
211215 else
212216 PythonVersion.DLLPath := PythonVersion.InstallPath;
@@ -246,7 +250,7 @@ function GetRegisterPythonVersion(SysVersion: string;
246250
247251 VersionSuffix := ' ' ;
248252{ $IFDEF CPUX86}
249- if CompareVersions(SysVersion, ' 3.5' ) > = 0 then
253+ if CompareVersions(SysVersion, ' 3.5' ) < = 0 then
250254 VersionSuffix := ' -32' ;
251255{ $ENDIF}
252256 key := Format(' \Software\Python\PythonCore\%s%s' , [SysVersion, VersionSuffix]);
0 commit comments