Cubicsdr: Running from a relative path

Created on 14 Feb 2018  路  7Comments  路  Source: cjcliffe/CubicSDR

Running CubicSDR.exe from the command-line in the directory of CubicSDR.exe is no problem.

But running from the command-line from a directory relative. E.g. ..\bin\CubicSDR.exe is a problem;
it fails to find all the share/font/*.fnt files and I get no sound!.

All 7 comments

You would have to create a shortcut and set the working directory in the properties dialog. The Windows build is probably hardcoded to act like a portable install so it's always going to look for assets in the same folder you run it from.

A GetModuleFileName (NULL, my_name. sizeof(my_name)); could fix it. But OK.
I don't follow you on the portable install. I have lot of portable apps here that can run from any directory.

@gvanem As the Wiki says for Build Windows you need to build with BUILD_INSTALLER=1. In this case, the fonts dir is searched relative to the executable.
If not set, fonts are searched in ../share/cubicsdr/ whatever that means.

Since I built with BUILD_INSTALLER = 1, I tried to run using a relative path as you did and it worked for me. (Windows 10 x64, using either CMD or Git Bash)

Since I built with BUILD_INSTALLER = 1, I tried to run using a relative path as you did and it worked for me.

Which means -DRES_FOLDER="../share/cubicsdr/". The RES_FOLDER is a compile-time constant. Nothing to do with a run-time directory variable.
IMHO, it should be /share/cubicsdr/. How hard could that be? Must be something in wxWidgets for this..

@gvanem Hello, I've comitted some changes to make the fonts search smarter:

  • First search for : RES_FOLDER/fonts
  • else search for [Cubic exe path]/RES_FOLDER/fonts,
  • else search for [Cubic exe path]/fonts

I think it covers your issue now, so far as my tests have shown.

@vsonnier : thanks for your effort. That fixed it.

@gvanem De nada.

Was this page helpful?
0 / 5 - 0 ratings