Page 1 of 1

Libraries not found when startup directory is different from exe directory

Posted: Thu Jul 06, 2017 12:35 am
by anothercef4duser2
I'm working on an application that installs into "Program Files", but the installer sets the startup directory of the desktop shortcut it creates, to the public "Documents" folder.

When I try to start the app from this shortcut, the app errs because the chromium libraries are not found. The libraries *are* installed into the .exe folder in "Program Files" and the app starts up if I manually go to that folder and start it.

Is it WAD that the libraries are not found, if the active directory is not the same as the directory containing the executable?

Re: Libraries not found when startup directory is different from exe directory

Posted: Thu Jul 06, 2017 6:50 am
by salvadordf
Hi,

Try setting the full path to the libraries in GlobalCEFApp.FrameworkDirPath and GlobalCEFApp.ResourcesDirPath before the GlobalCEFApp.StartMainProcess call in the DPR file.

Re: Libraries not found when startup directory is different from exe directory

Posted: Fri Jul 07, 2017 5:32 am
by anothercef4duser2
Thanks, that works, when I also set the GlobalCEFApp.LocalesDirPath.

However, the question still remains, shouldn't the libraries be found in the exe directory by default? If I put other needed DLLs there, Windows still finds and loads them.

Re: Libraries not found when startup directory is different from exe directory

Posted: Fri Jul 07, 2017 7:17 am
by salvadordf
Hi,
anothercef4duser2 wrote: Fri Jul 07, 2017 5:32 am Thanks, that works, when I also set the GlobalCEFApp.LocalesDirPath.
However, the question still remains, shouldn't the libraries be found in the exe directory by default? If I put other needed DLLs there, Windows still finds and loads them.
Yes. The CEF3 binaries are loaded by default from the main exe directory but in some rare cases it's better to specify the full path.