Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Libraries not found when startup directory is different from exe directory

Post Reply
anothercef4duser2
Posts: 2
Joined: Thu Jul 06, 2017 12:22 am

Libraries not found when startup directory is different from exe directory

Post 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?
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

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

Post 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.
anothercef4duser2
Posts: 2
Joined: Thu Jul 06, 2017 12:22 am

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

Post 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.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

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

Post 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.
Post Reply