@@ -43,7 +43,11 @@ TPythonVersion = record
43
43
44
44
TPythonVersions = array of TPythonVersion;
45
45
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
+ *)
47
51
function CompareVersions (A, B : String) : Integer;
48
52
49
53
@@ -206,7 +210,7 @@ function GetRegisterPythonVersion(SysVersion: string;
206
210
RootKey := Root;
207
211
if OpenKey(Key + ' \InstallPath' , False) then begin
208
212
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
210
214
PythonVersion.DLLPath := ' '
211
215
else
212
216
PythonVersion.DLLPath := PythonVersion.InstallPath;
@@ -246,7 +250,7 @@ function GetRegisterPythonVersion(SysVersion: string;
246
250
247
251
VersionSuffix := ' ' ;
248
252
{ $IFDEF CPUX86}
249
- if CompareVersions(SysVersion, ' 3.5' ) > = 0 then
253
+ if CompareVersions(SysVersion, ' 3.5' ) < = 0 then
250
254
VersionSuffix := ' -32' ;
251
255
{ $ENDIF}
252
256
key := Format(' \Software\Python\PythonCore\%s%s' , [SysVersion, VersionSuffix]);
0 commit comments