Posted on 02-14-2022 07:44 AM
We are starting to use Printerlogic for printer installing across the company. Manually installing the pkg or via a Policy install from a script I found on the forums here it doesn't install the needed Safari extension. Found 2 commands to run from Printerlogic's forum that enables it.
sudo killall PrinterInstallerClient
open $(cat /etc/pl_dir)/service_interface/PrinterInstallerClient.app
I tried adding the commands as Exexute Commands under Files and Processes in the Policy. Watching the install on a MacBook it looks like it works but when I open Safari and check the extension it isn't there. I can then run both commands manually in terminal and it works as intended.
Has anyone else been able to successfully push out Printerlogic?
Solved! Go to Solution.
Posted on 02-22-2022 11:46 AM
Okay so I created a policy. It users 2 scripts. One to install PrinterLogic and another to kill it and relaunch it all in one action. It works!! Only problem is it finishes with an error not sure why.
Error message = Script result: The application cannot be opened for an unexpected reason, error=Error Domain=NSOSStatusErrorDomain Code=-600 "procNotFound: no eligible process with specified descriptor" UserInfo={_LSLine=379, _LSFunction=_LSAnnotateAndSendAppleEventWithOptions}
Here is my script
#!/bin/zsh
# kills the Printerlogic process and restarts it so the extension will be available in Safari
killall PrinterInstallerClient
# Pause for three seconds
sleep 3
# Repopens PrinterLogic client
sudo -u $USER open $(cat /etc/pl_dir)/service_interface/PrinterInstallerClient.app
Posted on 02-14-2022 08:06 AM
Self Service and policies run under root so your second line asking to open an application binary into the users console session won't work.
Something like this inserted into a script may:
currentUser=$(stat -f %Su "/dev/console")
sudo -u $currentUser open $(cat /etc/pl_dir)/service_interface/PrinterInstallerClient.app
Test test and test some more.
Posted on 02-14-2022 12:36 PM
We are in process of deploying PrinterLogic at one of our companies. We are using Chrome as our default browser though. I used a Configuration Profile to deploy the Chrome browser extension. When I deploy the PrinterInstallerClient though, we are seeing something where it is calling Safari instead of the default browser. I opened a ticket with PrinterLogic as it is a bug, but as a workaround I made a script that calls those two commands to close and reopen the PrinterInstallerClient. I advertise this script in Self-Service as "Relaunch PrinterLogic Client". It seems to do the trick as it only needs to be relaunched one time in order for the PrinterInstallerClient to be able to call the appropriate default browser.
Posted on 02-14-2022 01:26 PM
ctocci, would you be able to share the script you created because the one I created just doesn't work? Majority of my Mac users are developers so I could put in the description to have them run those commands themselves but obviously I'd like to idiot proof it because I have Graphic designers and some other none dev people on them.
02-14-2022 01:49 PM - edited 02-14-2022 01:50 PM
It's basically what you mentioned in the post... All of our users are admins on their Mac though.
I made this into a "script" (finger quotes cause it's really just two commands lol), then made a policy that runs the script.
sudo killall PrinterInstallerClient && open $(cat /etc/pl_dir)/service_interface/PrinterInstallerClient.app
Posted on 02-15-2022 06:12 AM
Similar to what I did, I do notice the PrinterLogic icon die and relaunch right away so I know the 1st part works but the second part doesn't seem to work with my script.
Posted on 02-14-2022 01:58 PM
Also, just a note... I tried sticking the relaunch script as a post install script during the install policy, but that for some reason did not work. Only thing that worked for me was making the relaunch script it's own advertised policy in Self-Service.
Posted on 02-15-2022 06:11 AM
Yeah I tried that one and tried putting it into Execute Command filed under Files and Processes neither worked.
Posted on 02-15-2022 08:18 AM
I cannot get it to work from Jamf. I even did 2 different scripts from Jamf and created 2 different policys to do the commands 1 at a time. They complete successfully, I open Safari and check for the extension and it isn't there. I run the commands manually from terminal and it works.
Posted on 02-15-2022 11:38 AM
For what it's worth, PrinterLogic support has confirmed a bug with the Mac client and appropriately opening the default browser. Doesn't sound like the issue you're having though. Maybe open a case with PrinterLogic support?
Posted on 02-15-2022 12:22 PM
Yeah I got it to the point that only the second command needs to be run manually. Just going to write up in the description instructions on entering that command and them having to enable the extension in Safari. Most of my users are Work from home anyways so it shouldn't generate very many support calls. Like I said before majority of them are developers.
Posted on 02-22-2022 11:46 AM
Okay so I created a policy. It users 2 scripts. One to install PrinterLogic and another to kill it and relaunch it all in one action. It works!! Only problem is it finishes with an error not sure why.
Error message = Script result: The application cannot be opened for an unexpected reason, error=Error Domain=NSOSStatusErrorDomain Code=-600 "procNotFound: no eligible process with specified descriptor" UserInfo={_LSLine=379, _LSFunction=_LSAnnotateAndSendAppleEventWithOptions}
Here is my script
#!/bin/zsh
# kills the Printerlogic process and restarts it so the extension will be available in Safari
killall PrinterInstallerClient
# Pause for three seconds
sleep 3
# Repopens PrinterLogic client
sudo -u $USER open $(cat /etc/pl_dir)/service_interface/PrinterInstallerClient.app
Posted on 02-22-2022 12:18 PM
If the installer is run on it's own from a policy is the process name mentioned above running once that successfully completes?
Posted on 02-22-2022 12:25 PM
Yes, the process starts up once the 1st script finishes, which performs the install. Then my 2nd script is what I listed here. This is the KB from Printerlogic detailing the issue
https://kb.printerlogic.com/s/article/How-to-manually-enable-the-Safari-extension-from-a-terminal
Posted on 02-22-2022 01:03 PM
Is the script above the exact one you have running now in that policy or just a loose example of it? If it's the exact script what variable declaration are you using for $USER? If you don't have one then insert this and try your policy again:
USER=$(stat -f %Su "/dev/console")
Posted on 02-22-2022 01:15 PM
Yes that is my exact script
Posted on 02-22-2022 01:14 PM
In my research I found were some say $USER is the wildcard for the current user like %USERNAME% is used in Windows.
02-22-2022 01:50 PM - edited 02-23-2022 05:42 AM
That's true to a point, but in this case you're trying to affect the console user(your end user) of that machine by using sudo -U user.name with a variable that pulls the console username. With the way it is now considering policies run as root if you were to echo sudo -U $USER it will come back as root instead of your end user.
Posted on 02-23-2022 05:27 AM
Ah, gotcha, sorry I'm pretty new too scripting. I added your recommendation from when you first replied to my post. I realized I didn't use both lines when I first tested it back then. The install completes and the extension is available in Safari. It still completes with an error though which is so weird considering everything works as intended. I know it isn't good scripting but can I just suppress this error so I don't get end users putting in tickets because it says it failed?
Script exit code: 1
Script result: The application cannot be opened for an unexpected reason, error=Error Domain=NSOSStatusErrorDomain Code=-600 "procNotFound: no eligible process with specified descriptor" UserInfo={_LSLine=379, _LSFunction=_LSAnnotateAndSendAppleEventWithOptions}
Error running script: return code was 1.
Posted on 02-23-2022 09:27 AM
Have you tried substituting the $(cat /etc/pl_dir)/service_interface/PrinterInstallerClient.app portion of that last command with /opt/PrinterInstallerClient/service_interface/PrinterInstallerClient.app ?
I wonder if it's tripping on $(cat /etc/pl_dir).
Posted on 02-23-2022 10:21 AM
It did complete like the other command but still get the error with the same error listed above.
Posted on 02-23-2022 11:20 AM
I cheated and added || true at the end of the line and the install finishes without any errors and everything works as desired. I know not the best way but I'm done messing around with this script and moving on to the next thing.
Posted on 02-23-2022 02:00 PM
As long as it works as desired then that's all that matters in most cases. Glad you have it sorted.
12-11-2022 08:58 AM - edited 12-11-2022 09:00 AM
How do I enable or activate the Printer Logic Safari Extension? Is there any command or script that I can follow?...
Posted on 12-12-2022 05:14 AM
I could never figure out a way to do so automatically. I just put in the description how to enable it and check the box "Ensure that user view the description"