From d26e42ba1780bcc82226eb6ad9c142944549a476 Mon Sep 17 00:00:00 2001 From: mronkain Date: Tue, 3 Jul 2018 15:54:50 +0300 Subject: [PATCH] Use FSetCurrentDir in CheckCEFLibrary as well so that the resource checking is done from the right place when the working directory is different from the executable location. --- source/uCEFApplication.pas | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/uCEFApplication.pas b/source/uCEFApplication.pas index aef1c9b7..aa2da54c 100644 --- a/source/uCEFApplication.pas +++ b/source/uCEFApplication.pas @@ -762,7 +762,7 @@ end; function TCefApplication.CheckCEFLibrary : boolean; var - TempString : string; + TempString, TempOldDir : string; TempMissingFrm, TempMissingRsc, TempMissingLoc : boolean; begin Result := False; @@ -771,6 +771,12 @@ begin Result := True else begin + if FSetCurrentDir then + begin + TempOldDir := GetCurrentDir; + chdir(GetModulePath); + end; + TempMissingFrm := not(CheckDLLs(FFrameworkDirPath, FMissingLibFiles)); TempMissingRsc := not(CheckResources(FResourcesDirPath, FMissingLibFiles, FCheckDevToolsResources)); TempMissingLoc := not(CheckLocales(FLocalesDirPath, FMissingLibFiles, FLocalesRequired)); @@ -804,6 +810,9 @@ begin ShowErrorMessageDlg(TempString); end; + + if FSetCurrentDir then chdir(TempOldDir); + end; end;