jimevins / glabels-qt

gLabels Label Designer (Qt/C++)

Home Page:http://glabels.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to print using gLabels executables via background services (NSSM,Nomad) Windows 10

ichetanbhatt opened this issue · comments

Greetings, I hope you all are doing well and healthy amidst the pandemic.

We have been trying to trigger gLabels commands via background services such as NSSM and Nomad. Unluckily we are not able to find a decent solution for the same.

We have tried executing the same via Powershell and it is working as expected.
When we try to execute the same via the background process, no printing jobs are sent to the printer queue. (Execution level changes to SYSTEM).
Since there are no errors thrown via cp.exec(), I believe that we are able to execute the binary properly but not able to send the print request to the printing queue/

We are trying to execute the following cmds from within a nodeJs application using cp.exec():
glabels-batch-qt "${templatePath}" [Contains a merge file]
glabels-qt "${templatePath}"
glabels-batch-qt "${printJobObj.templatePath}" -p "${printerName}" -D var1="TEST"

It would be really helpful if someone can propose a solution or a feasible workaround here for the same.

Thank You

Facing same problem.

I think the problem is with Windows Services rather than gLabels itself. Windows services can not start applications which have GUI, they can only run other scripts / CLI, because of Session 0 Isolation read about it here

There seems to be a way around, using CreateProcessAsUser Windows API but still figuring that out.