System command for checking driver details not working after enabling app sandbox

StackOverflow https://stackoverflow.com/questions/21797780

  •  12-10-2022
  •  | 
  •  

Вопрос

In my cocoa application, i am checking whether the drivers are installed in system.

Here is the code for checking driver installation

if (0 == system("lpstat -p MyDriver"))
{
   //Code inside if
}

it works fine and showing driver details without enabling sandbox. But after enabling sandbox, it shows lpstat: Invalid destination name in list "MyDriver" error.

And i found some reference System() command not working when enabling app sandboxing. In this reference, they are using password privillages to delete directory. but my scenario here is different, i'm just checking whether the drivers were installed or not.

Is there any solution to to check driver installation details if sandbox enabled.

Это было полезно?

Решение

Above given system commands works fine, after enabling allow printing option in Entitlements.

enter image description here

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top