Printerlogic Safari extension issues

gloper1977
Contributor

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?

1 ACCEPTED SOLUTION

gloper1977
Contributor

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

View solution in original post

24 REPLIES 24

mainelysteve
Valued Contributor II

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.

 

ctocci
New Contributor III

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.

gloper1977
Contributor

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.

ctocci
New Contributor III

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


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.  

ctocci
New Contributor III

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. 

Yeah I tried that one and tried putting it into Execute Command filed under Files and Processes neither worked.  

gloper1977
Contributor

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.

ctocci
New Contributor III

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? 

gloper1977
Contributor

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.

gloper1977
Contributor

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

mainelysteve
Valued Contributor II

If the installer is run on it's own from a policy is the process name mentioned above running once that successfully completes?

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

mainelysteve
Valued Contributor II

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")

Yes that is my exact script

gloper1977
Contributor

In my research I found were some say $USER is the wildcard for the current user like %USERNAME% is used in Windows.

mainelysteve
Valued Contributor II

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.

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.

mainelysteve
Valued Contributor II

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).

It did complete like the other command but still get the error with the same error listed above.

gloper1977
Contributor

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.

mainelysteve
Valued Contributor II

As long as it works as desired then that's all that matters in most cases. Glad you have it sorted.

Vijay
New Contributor

How do I enable or activate the Printer Logic Safari Extension? Is there any command or script that I can follow?... 

gloper1977
Contributor

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"