Unable to install printer
-
@tatanas Maybe there is some message in the Windows event log? Just a quick idea from the top of my head. I will try to find some time to help you on getting fog-client compiled soon as well.
-
@sebastian-roth We need detailed log of printui command result.
The command in the client code is the same I have used to test from command line (test was ok), so it’s strange it doesn’t work. -
@tatanas Finally I found some time to look into this in more depth. Most of the fog-client code came from Joe who is not actively working on this project anymore. While I try to fix things in the fog-client as much as I can I don’t know it well.
As far as I understand things the problem might occour because
_configuredPrinters
is an internal list the fog-client keeps to know which printer was configured earlier already to skip that on the next loop. But obviously a situation can arise where the rundll32 PrintUI calls return but still the printer is not setup correctly. In that case the fog-client code add it to its internal list of_configuredPrinters
and won’t try to configure it until you restart the fog-client service (FOGService
in Windows service managment).So what we need to find out is why this part is not working as it should: https://github.com/FOGProject/fog-client/blob/master/Modules/PrinterManager/Windows/WindowsPrinterManager.cs#L124
-
More details :
I tried adding 2 Fog managed printers and the ports are created (IP_X.X.X.X with the associated IP) but not the printers.
I would say the printui method (even if return code is 0) is not working properly. -
I can understand “…already exists” but what does “… already configured” mean ?
Here is a sample of the log when I try to install a printer which is not already installed on the host :
22/09/2021 15:58 PrinterManager Adding printers 22/09/2021 15:58 Printer Adding: B503-LASER (fog) 22/09/2021 15:59 PrinterManager PrintUI return code = 0 22/09/2021 15:59 PrinterManager Restarting spooler ... 22/09/2021 16:02 PrinterManager Adding printers 22/09/2021 16:02 PrinterManager B503-LASER (fog) has already been configured ... 22/09/2021 16:04 PrinterManager Adding printers 22/09/2021 16:04 PrinterManager B503-LASER (fog) has already been configured
I you want, I can give you a remote access to this computer.
-
So it seems the list “_configuredPrinters” contains the printer that I want to install.
Is it the host’s printers list configured through the fog server web ?
And the “installedPrinters” list will be the printers already installed on the host ? -
@sebastian-roth
Don’t hesitate if you need help debugging.
I’m using the module a lot and this bug is very frustating…@Matthieu-Jacquart
The bug was there in 1.5.8 too and I think it wasn’t before. -
@tatanas Hi, it looks like same problem I’m facing since few month too, no workaround for now…
https://forums.fogproject.org/topic/15185/problem-mapping-network-printer-after-upgrade-to-1-5-9-60?_=1631803438100
Matthieu -
@tatanas said in Unable to install printer:
How Fog client checks if a printer is already installed ?
Check out this part of the fog-client code: https://github.com/FOGProject/fog-client/blob/85da019cbd8a939e69fea42779f1bc53b06323cb/Modules/PrinterManager/PrinterManager.cs#L81
-
I Updated Fog to 1.5.9. The problem is still the same.
How Fog client checks if a printer is already installed ?