LazHelpHTML: Quotation marks surrounding executable path prevent browser from being launched
Original Reporter info from Mantis: Christian Danner
-
Reporter name: Christian Danner
Original Reporter info from Mantis: Christian Danner
- Reporter name: Christian Danner
Description:
The HTMLBrowserHelpViewer refuses to start with the error message
| Help Viewer Error:
| Browser ""C:\Program Files\Mozilla Firefox\firefox.exe"" not found.
That happens because
lazarus\lcl\include\sysenvapis_win.inc
function FindDefaultBrowser(out ABrowser, AParams: String): Boolean;
returns a double quoted path to the executable file in case it contains spaces, whereas in the calling function
lazarus\lcl\lazhelphtml.pas
function THTMLBrowserHelpViewer.ShowNode(Node: THelpNode; var ErrMsg: string
): TShowHelpResult;
FileExistsUTF8() and FileIsExecutable(), called to validate the returned path,
(line 337 ff.)
| if (not FileExistsUTF8(Executable)) then begin
| ErrMsg:=Format(hhsHelpBrowserNotFound, [Executable]);
| exit;
| end;
| if (not FileIsExecutable(Executable)) then begin
| ErrMsg:=Format(hhsHelpBrowserNotExecutable, [Executable]);
| exit;
| end;
aren't prepared to locate files with the path parameter surrounded by quotation marks, thus return FALSE.
Mantis conversion info:
- Mantis ID: 30502
- OS: Windows 7
- OS Build: Professional
- Build: 52808
- Platform: Win32
- Version: 1.7 (SVN)
- Fixed in version: 1.6.2
- Fixed in revision: r52863 (#8c06636b)
- Target version: 1.6.2