chmhelp: auto compile lhelp when showing all help, patch #23411

git-svn-id: trunk@40593 -
This commit is contained in:
mattias 2013-03-20 09:00:29 +00:00
parent 07867f2b3a
commit 1b37181d38

View File

@ -419,23 +419,25 @@ end;
procedure TChmHelpViewer.ShowAllHelp(Sender: TObject); procedure TChmHelpViewer.ShowAllHelp(Sender: TObject);
var var
SearchPath: String; //; delimited list of directories SearchPath: String; //; delimited list of directories
LHelpFilename: String; HelpExeFileName: String;
begin begin
// Make sure the lhelp help viewer exists; build it if doesn't and it is lhelp
HelpExeFileName:=GetHelpExe;
if (not FileExistsUTF8(HelpExeFileName)) and
((ExtractFileNameOnly(HelpExeFileName) = 'lhelp') and (CheckBuildLHelp <> mrOK)) then begin
IDEMessageDialog(HELP_MissingLhelp, Format(
HELP_UnableToFindTheLhelpViewerPleaseCompileTheLhelpPro,
[#13, HelpExeFileName, #13, #13, #13,
SetDirSeparators('components/chmhelp/lhelp/lhelp.lpi')]),
mtError,[mbCancel]);
exit;
end;
SearchPath := GetHelpFilesPath; SearchPath := GetHelpFilesPath;
// Start up server if needed // Start up server if needed
if not(fHelpConnection.ServerRunning) then if not(fHelpConnection.ServerRunning) then
begin begin
LHelpFilename:=GetHelpExe; fHelpConnection.StartHelpServer(HelpLabel, HelpExeFileName);
if not FileExistsUTF8(LHelpFilename) then
begin
IDEMessageDialog(HELP_MissingLhelp, Format(
HELP_UnableToFindTheLhelpViewerPleaseCompileTheLhelpPro,
[#13, LHelpFilename, #13, #13, #13,
SetDirSeparators('components/chmhelp/lhelp/lhelp.lpi')]),
mtError,[mbCancel]);
exit;
end;
fHelpConnection.StartHelpServer(HelpLabel, LHelpFilename);
end; end;
// Open all chm files after it has started // Open all chm files after it has started
OpenAllCHMsInSearchPath(SearchPath); OpenAllCHMsInSearchPath(SearchPath);