Printer Deployment does not install driver but port



  • Hi,

    iam trying to use fog client (new one) to install printers.
    I am currently under trunk 7416

    alt text

    I can see in the fog service log that the printer should be installed, when i check the printers i cannot set the installed printer but when i check the available ports i can see the fog created the port IP_x.x.x.x but the printer install itself is missing.

    When i try to access the unc path of the printer inf showing in the log i can successfull open the share (inf).
    Also the Printer Model is exactly like in the inf file.

    What could be the problem here? The Client is a Windows 10 x64
    Did i made any wrong inputs to the printer configuration?

    Please help me.

    Regards X23




  • Testers

    @x23piracy It uses the printUI.DLL

    The code looks like PrintUI($"/if /q /b \"{printer.Name}\" /f \"{printer.File}\" /r \"{printer.Port}\" /m \"{printer.Model}\"")
    The command line to try it yourself manually looks like RUNDLL32 PRINTUI.DLL,PrintUIEntry /if /q /b "Printer Name" /f "path\ot\inf" /r "Printer Port Name" /m "Printer Model referenced in INF" You may want to take out the /q so you get error messages.

    Personally I use the following script template for each of my network printers on my base image and then remove them and use the C:\Windows\INF\oem#.inf file that gets created for each printer. You just have to watch and document which oem#.inf the pnputil adds the driver too.

    ::-----------------------------------------------------------------------------
    :: Script Name: InstallPrinters
    :: Original Author: jfullmer
    :: Created Date: 2016-02-18 16:39:19
    :: Last Updated Date: 2016-03-16 10:01:27
    :: Update Author: jfullmer
    :: Version: 2.0
    ::-----------------------------------------------------------------------------
    
    @ECHO off
    
    call :main
    exit
    
    :main
    	REM Function to call other functions and run the installation process
    
    	call :setVars
    	call :funcHead "Welcome to the Printer installer!"
    	REM inputs: 1 - Printer Port Name, 2 - printer ip or hostname 3- driverPath 4 - printer name 5 - printer model 6 - config file 7 - raw or lpr
    
    	call :installPrinter %portName% %hostname% "%inf%" "%printerName%" "%printerModel%" "%config%" %portType%
    
    	EXIT /B
    
    :setVars
    	REM function for setting script variables, typically for directories
    
    	:: Set input names in the set commands, should be easier this way
    	:: Avoid using quotes in variable definitions, enclose the calls to variables in quotes instead
    	call :funcHead "Setting script variables"
    	set share=\\path\to\drivers\share
    	set portName=
    	set hostname=
    	set inf=%share%\
    	set printerName=
    	set printerModel=
    	set config=%share%\
    	set portType=raw
    	
    	echo. mounting share...
    	net use "%share%"
    	
    	echo. done!
    
    	EXIT /B
    
    :installPrinter
    	REM Function to add a new Printer
    	REM inputs: 1 - Printer Port Name, 2 - printer ip or hostname 3- driverPath 4 - printer name 5 - printer model 6 - config file 7 - raw or lpr
    
    	call :funcHead "Installing Printer %~4"
    
    	call :printerPort %~1 %~2 %~7
    	call :printerDriver "%~3"
    	call :addPrinter "%~4" "%~5" %~1
    	call :configPrinter "%~6" "%~4"
    
    	echo. done installing printer %~4!
    
    	EXIT /B
    
    :printerPort
    	REM function for adding a printer port
    	REM var inputs 1 - port name 2 -hostname or ip address 3 -port type (raw or lpr)
    
    	call :dots
    	echo. Creating the printer port...
    	
    	IF %~3==lpr (
    		Cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prnport.vbs -a -r %~1 -h %~2 -o lpr -q lp -n 515
    	) ELSE ( REM raw
    		Cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prnport.vbs -a -r %~1 -h %~2 -o raw -n 9100 
    	) 
    	
    	echo. done!
    	call :dots
    
    	EXIT /B
    
    :printerDriver
    	REM function to add the driver input 1=full driver path
    
    	call :dots
    	
    	echo. Adding printer driver...
    	PNPUTIL -i -a "%~1"
    	echo. done!
    	
    	call :dots
    
    	EXIT /B
    
    :addPrinter
    	REM add the printer to the created port
    	REM 1 - printer name 2 - printer model associated with driver 3 - port name
    	
    	call :dots
    	
    	echo. adding printer to network port...
    	Cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prnmngr.vbs -a -p "%~1" -m "%~2" -r %~3
    	echo. done!
    	
    	call :dots
    
    	EXIT /B
    
    :configPrinter
    	REM add any special printer configurations
    	REM 1 - config file path 2 - printer name
    
    	call :dots
    	
    	echo. Configuring Printer...
    	REM To create a config file for a printer, use the following syntax
    	REM RUNDLL32 PRINTUI.DLL,PrintUIEntry /Ss /nPrinterName /a ConfigFilePath.dat m f g p
    	RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n"%~2" /a %~1 m f g p
    	echo. done!
    	
    	call :dots
    
    	EXIT /B
    
    :dots
    	REM just echoing dots in a Function instead of copy pasting them so that it's consistent
    	echo ......................................................................
    	EXIT /B
    
    :funcHead
    	REM A simple function for displaying a consistent header at the start of functions
    	call :dots
    	echo. %~1
    	call :dots
    	EXIT /B
    

    Also, it sounds like this is an HP printer. I’ve had some good luck using the HP universal print driver.
    Within the hp universal print driver files, the inf you need is something along the lines of hpcu180u.inf With a model name of “HP Universal Printing PCL 6”(The numbers slightly change with each version of the UPD, but that’s the general structure of the file that works) But you will need all the other files from the driver in the original directory structure. In other words, you can’t just copy the inf file to the share because it will look for more files that are referenced. This is probably also the case for the model specific print driver, so if you are only putting the inf in the share, that could also be the problem.

    I hope that helps



  • @x23piracy Just use the windows new printer install wizard and copy paste each value you have in fog into the wizard.



  • @Scott-B how to do this steps manually, what is the client doing? is it using the ms vbs scripts for this?

    Regards X23



  • In the past when I have had this issue its always been the path to the driver was wrong or the driver itself was corrupt or not added correctly. Are you able to manually make a port and install a printer using all the information in the FOG configuration of the printer?



  • @Tom-Elliott afai remember no. but i think there is additionally another problem since i am on latest trunk with client 10.6, have a look: https://forums.fogproject.org/topic/7413/fog-client-0-10-6-error-object-reference-not-set-to-an-instance-of-an-object/12


  • Senior Developer

    @x23piracy after you see the port is created, if you reboot the machine does the printer show up in the list?



  • Hey guys,

    don’ get me wrong. Okay i reexplain it:

    First of all i have used the Printer Helper binary.
    Next thing Windows 10 has an embedded driver for the HP M401 and i have a downloaded one.

    My first attempt was to use the downloaded driver on a network share readable by everyone. This Method seems to fail because the port will be created but printer driver is not installed.

    Then i tried the embedded one and i have the same issue port is there but printer itself not.
    I have used exactly the information given the printer helper program.

    Can maybe someone of you test this with a windows 10 machine?

    This i what printer helper shows me when using the embedded driver:
    alt text

    This i what printer helper shows me when using the downloaded driver vom hp:
    alt text

    @Tom Elliot FYI i am now on trunk 7645

    Regards X23


  • Moderator

    @x23piracy It might be worth noting here that if you want the printer to use specific drivers, install it manually using the drivers you want, and THEN run the printer manager helper.


  • Senior Developer

    @x23piracy I have to be honest, that video is from 0.12 version of FOG and probably the same version of the client from between all of them. The new client is New and it’s labelled as such for a very specific reason.

    @jbob wrote the new client more or less from scratch. He also built the printer manager helper that he linked which will tell you EXACTLY what to place for the printer definition. Why not just take it for a spin? We’re not telling you information to spin you on your head, rather to help you get to the tasking you needed to reach.


  • Senior Developer

    Have you used the exact output of printer manager helper? It detemermines all of that for you. I know there’s only 1 entry in the ntprint file on newer versions of Windows but thats fine.



  • @Wayne-Workman sure here it is: http://freeghost.sourceforge.net/videotutorials/printer.swf
    The video shows howto determine printer name from ntprint.inf but in windows 10 there are a lot of embedded drivers but they cannot be found in ntprint.inf

    That’s the reason i tried the share (readable by everyone, checked the inf for the right name and took em) with a downloaded driver for the device from hp.

    If you install the HP M401 under windows 10 by adding the port and driver autodetection it installs the embedded driver but i don’t know howto locate the names and the correct inf under windows 10.

    Regards X23


  • Moderator

    @x23piracy I’m not aware of any videos in the wiki about printers. Can you give a link?


  • Senior Developer

    @x23piracy have you tried using the ntprint file? It acts as a “search our whole system for a working driver”



  • @Arrowhead-IT @Jbob the share is readable by anyone (anonymous) a can also place the driver on the local system even then it will not install only the port is created.

    @Wayne-Workman i tried the printer manager helper and on my productive windows 10 i used the embedded driver that windows 10 brings for the hp m401 and not the one on the share.

    The strange thing is the helper tells me that the ntprint.inf was used on my local system for the driver but when i open the ntprint.inf i cannot find the entry the helper is showing for the printername. Thats the reason why i tried it with a dowloaded driver from hp in the share i used.

    In the wiki example video i can see a lot of entrys for printer names in ntprint.inf but under windows 10 there is not a single entry but if you create network ports it automatically detects the driver and uses the embedded one, how to locate the right drivers names for embedded printer driver in windows 10 like the wiki video is showing?

    Regards X23


  • Senior Developer

    I believe @Arrowhead-IT is on the right track. The share must be configured for anonymous read.


  • Testers

    @x23piracy Does the share require a login?
    If it isn’t a public share it probably won’t work.



  • Hi,

    hey tom and wayne, i missed your answer before ;) thank u for the reply.
    Tom i will update and report back, wayne i will try that thank you and get back to u guys.

    Regards X23


  • Senior Developer

    Also, could you try updating to the latest?


Log in to reply
 

459
Online

38710
Users

10539
Topics

99781
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.