Printer errors
-
@chunter2 The fog-client software keeps a list of the printers it manages. So if it had installed/created/configured one it won’t do it on subsequent loop of the printer module again. If you stop the FOGService (Windows services), remove the printers in printer manager and start FOGService again it should re-create both printers for you.
I am still wondering why the setting type missed in the database. There is a chance those settings were different in 1.2.0 and did not get updated when upgrading properly.
-
My guess is the database upgrade from 1.2.0 didn’t go as smoothly as I had thought. I probably should have checked some of the tables just to see. Setting the pConfig to “Local” in the database filled in “TCP/IP” in the Printer Type column when clicking on List all printers.
I just fixed my “second” printer issue. There was an & sign in the path to the inf file and the fog gui was showing
&
for some reason. I removed that from the gui and removed the & from the server path and the printer installed correctly. Strange how there was no error in the fog log but I’m guessing that’s not something you can query? -
@chunter2 said in Printer errors:
Strange how there was no error in the fog log but I’m guessing that’s not something you can query?
Yeah interesting, unfortunately the rundll PrintUI call used within Windows to manage printers is not that great. I don’t think we can do much about this. Maybe we could add a normal file check before the call. What do you think? Would you test an updated DLL if I’d compile one with checks?
-
@Sebastian-Roth Sure, I can test an updated DLL. Do you know why I was getting the message “has already been configured” instead of “already exists”? Or is that what I’d be testing with the updated DLL?
-
@chunter2 said in Printer errors:
Do you know why I was getting the message “has already been configured” instead of “already exists”?
It’s impossible to say without having the full logs here and even then I’d need to try and replicate the problem to figure out why that is.
As you see in the code there are two internal lists handling if printers are installed and configured already.
-
@Sebastian-Roth Can you try adding a printer with a bad path to the inf file? I think that’s my error. Maybe that log message just needs to have “but not installed” added on. I’m assuming you don’t want to keep trying to install over and over if the path is wrong. And that’s the reason for two lists?
-
@chunter2 said in Printer errors:
Can you try adding a printer with a bad path to the inf file? I think that’s my error. Maybe that log message just needs to have “but not installed” added on. And that’s the reason for two lists?
Wasn’t me who came up with the printer management / the fog-client. I am just trying to take over from the original developer and help people to make things work and fix things as needed. I guess (not knowing!) that his idea was to use two lists, one for printers being installed (as in “created”) and one for printers being configured (as in “settings applied”) but I am not sure. I have dug through that part of the code a couple of times but I am still not sure I understand his logic. On the other hand I know he is/was a pretty good programmer and did things for a good reason. So I don’t want to rush in and change things too quickly.
I’m assuming you don’t want to keep trying to install over and over if the path is wrong.
Well the fog-client polls the settings every time and I think it’s good to try again as settings might have changed on the next loop cycle.
-
@chunter2 I just added a check (File.Exists…) and compiled a fresh DLL: https://github.com/FOGProject/fog-client/releases/download/0.11.16/Modules_printer_check_INF.dll
Stop
FOGService
(Windows services.msc), then go toC:\Program Files (x86)\FOG\
and renameModules.dll
. Now download the one from above and put in place of the original one. Start the service and watch the log file.Hope you didn’t get me wrong. I am not saying that printer management in the fog-client is perfect and we shouldn’t change it. It’s just that I don’t have a lot of time and wouldn’t be able to rework this all from scratch in a rush. If there is a good reason to change the whole logic and we can work together on this I am more than happy to go ahead.
-
@Sebastian-Roth Just tried out the dll. I set a bad path on the first of two printers. I get the following first in the log which I think is good.
05/09/2019 7:45 PM PrinterManager Adding printers
05/09/2019 7:45 PM Printer Adding: Computer Lab x64
05/09/2019 7:45 PM PrinterManager Could not read printer INF file: bad path
05/09/2019 7:45 PM Printer Adding: Workroom Copier_64bit
05/09/2019 7:45 PM PrinterManager PrintUI return code = 0
05/09/2019 7:45 PM PrinterManager Restarting spoolerAnd then this the second and subsequent times through.
05/09/2019 7:47 PM PrinterManager Adding printers
05/09/2019 7:47 PM PrinterManager Computer Lab x64 has already been configured
05/09/2019 7:47 PM PrinterManager Workroom Copier_64bit already existsSo the second printer gets added now which is good but I don’t think it tries the first one again until you restart the service. I think I’m fine with that. I think my confusion was the “already been configured” message. I just assumed that was good.
I do understand this is an opensource project so no need to feel bad for not having the time. I can wait. I hope I’m coming across as a help and not demanding.
Thanks
-
@chunter2 said:
05/09/2019 7:45 PM PrinterManager Adding printers 05/09/2019 7:45 PM Printer Adding: Computer Lab x64 05/09/2019 7:45 PM PrinterManager Could not read printer INF file: bad path 05/09/2019 7:45 PM Printer Adding: Workroom Copier_64bit 05/09/2019 7:45 PM PrinterManager PrintUI return code = 0 05/09/2019 7:45 PM PrinterManager Restarting spooler
And then this the second and subsequent times through.
05/09/2019 7:47 PM PrinterManager Adding printers 05/09/2019 7:47 PM PrinterManager Computer Lab x64 has already been configured 05/09/2019 7:47 PM PrinterManager Workroom Copier_64bit already exists
I might have misunderstood that part wrong when you mentioned this first. It’s not easy to keep up with dozens of requests in the forums and see it all clearly when things are a bit hidden between the lines or messages. I hope to get some more time to dig through that part of the code and see if I can find out why it was programed the way it is (or find a loop hole in it).
I do understand this is an opensource project so no need to feel bad for not having the time. I can wait. I hope I’m coming across as a help and not demanding.
Thanks for mentioning! Good to hear that we are on the same line here.