Activation issue on MacOSAnswered

Hi,

we are currently facing an issue with licence activation on some MacOs computer on a C++ application. The license check appear to work on some machines, but not on others, and we haven't been able to figure out why. The problem occured only on the machines of our client and we didn't manage to reproduce it our machines, so we do not have many opportunities to find out more about the bug.

The following lines of code seem to be the problem:

char execPathBuffer[PATH_MAX];
uint32_t bufsize = PATH_MAX;
if (!_NSGetExecutablePath(execPathBuffer, &bufsize))
{
    executablePath = execPathBuffer;
    executablePath = executablePath.parent_path();
}
HRESULT result = TA_PDetsFromPath((executablePath.parent_path() / "Resources" / "TurboActivate.dat").c_str());
TA_GetHandle(_T("XXXXX")); //Problem: This line returns 0

The folder structure inside our .app is as follows:

Content:

  • MacOS
    • <executable file>
  • Resources
    • TurboActivate.dat

Do you know what could be causing this?

Answer

You'll have to add debugging to the logic around your path getting. I'm not familiar with those particular APIs you're calling, so there are likely bugs somewhere in there. Adding debugging will give you clarity on where the bugs are.

Also, make sure you're using the latest TurboActivate library (and don't use the static library). Also, you can avoid this problem altogether by just putting the TurboActivate.dat right next to your executable and letting TurboActivate load it.

Thanks for your answer. Just a small remark concerning your solution (putting the TurboActivate.dat next to the executable). The MacOS notarization tool doesn't seem to like it when there are data files in the MacOS folder, and was refusing to notarize our application when TurboActivate.dat was in this folder.
Our solution was to leave the TurboActivate.dat file in the Resources folder, but put a symbolic link next to the executable that points to it, and that seemed to work.