Skip to content

Commit 87f8f77

Browse files
committed
Try to find index.html help file, in unregistered versions.
1 parent 3b95d07 commit 87f8f77

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Source/PythonVersions.pas

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ function TPythonVersion.GetDisplayName: string;
166166
function TPythonVersion.GetHelpFile: string;
167167
var
168168
PythonHelpFilePath: string;
169+
HtmlIndex: string;
169170
Res: Integer;
170171
SR: TSearchRec;
171172
begin
@@ -176,7 +177,13 @@ function TPythonVersion.GetHelpFile: string;
176177
PythonHelpFilePath := IncludeTrailingPathDelimiter(InstallPath) + 'Doc\python*.chm';
177178
Res := FindFirst(PythonHelpFilePath, faAnyFile, SR);
178179
if Res = 0 then
179-
Result := IncludeTrailingPathDelimiter(InstallPath) + 'Doc\' + SR.Name;
180+
Result := IncludeTrailingPathDelimiter(InstallPath) + 'Doc\' + SR.Name
181+
else if Result = '' then
182+
begin
183+
HtmlIndex := IncludeTrailingPathDelimiter(InstallPath) + 'Doc\index.html';
184+
if FileExists(HtmlIndex) then
185+
Result := HtmlIndex;
186+
end;
180187
FindClose(SR);
181188
end;
182189
end;

0 commit comments

Comments
 (0)