Topic: Is there any way to enable printing support in Win10PE SE?  (Read 1916 times)

Is there any way to enable printing support in Win10PE SE?
« on: August 23, 2016, 07:34:11 AM »

PetePossum

  • Jr. Chef
  • **
  • Date Registered: Mar 2016
  • Posts: 51
Hey,

I am wondering what is needed to enable printer support. Background is that we use Win10PE SE from time to time to open incomming attachments from unknown sources in a secure environment. I am talking about Office documents (using libre office) or PDFs (Opera as viewer). The reason we use Opera and Libre Office is that we can re-render the documents as PDFs... and eliminate any scripts or dangerous code by using the built in PDF Printing method. However, it would be handy to just print to physical printer and hand the prints out to the end users, instead of transfering them back to USB, then transfer to production network and send via email or file share, just to have the users then print them themselves...

Also tried to install a PDF Printer in PE... to be more flexible regarding the applications we print from. But this fails due to print spooler server.

So long question short... do you guys see any chance to add printing support? Or is it there already and I missed it? (via Plugin maybe?)

Thanks

Re: Is there any way to enable printing support in Win10PE SE?
« Reply #1 on: November 21, 2019, 04:31:19 PM »

Jon_2030

  • Chef
  • ***
  • Date Registered: Jun 2018
  • Posts: 123
We need a solution to this problem

Re: Is there any way to enable printing support in Win10PE SE?
« Reply #2 on: November 21, 2019, 05:08:55 PM »

James

  • Grand Chef
  • *****
  • Location: USA
  • Date Registered: Dec 2017
  • Posts: 2272
Jon,
You have posted MANY times about Printer Support...
On several Topics regarding the Support...
This topic is 3 Years Old....

Clearly IF there WAS Printer Support > You would have been pointed into the correct Topic....

If Printer Support is ADDED then you will find out... Until then there is NONE...

Re: Is there any way to enable printing support in Win10PE SE?
« Reply #3 on: November 22, 2019, 12:07:21 AM »

slore

  • WimBuilder
  • Sr. Chef
  • ****
  • Date Registered: Jun 2016
  • Posts: 664
You can try WimBuilder2 to add the feature. It has printer support
 for windows 10 PE.
So far  it is the only project to support printer , because it is open source,
It is very very easy to port it to Win10 PE SE or Win10XPE projects.

« Last Edit: November 22, 2019, 01:30:25 AM by slore »

Re: Is there any way to enable printing support in Win10PE SE?
« Reply #4 on: November 22, 2019, 10:43:46 AM »

sharp

  • Jr. Chef
  • **
  • Date Registered: Jun 2019
  • Posts: 76
Dear slore,
for printer support you have said:
Quote
It is very very easy to port it to Win10 PE SE or Win10XPE projects.
And I say HOW?
I examined your bat and cmd files. It seemed a very hard work to me to port them into XPE.
Would you please help?
Regards.

Re: Is there any way to enable printing support in Win10PE SE?
« Reply #5 on: November 22, 2019, 11:48:21 AM »

slore

  • WimBuilder
  • Sr. Chef
  • ****
  • Date Registered: Jun 2016
  • Posts: 664
I examined your bat and cmd files. It seemed a very hard work to me to port them into XPE.
Would you please help?

enable printing support you just need do 3 things,
1). add require system files (extract from install.wim)
2). update registry (reg add or reg import *.reg)
3). set X:\Windows\System32\spool\PRINTERS folder's ACL to everyone
4). [optional]Create a shortcut to start printer service.

1). In WimBuilder2 is like:
Code: [Select]
call AddFiles %0 :end_files
goto :end_files

\Windows\splwow64.exe
\Windows\PrintDialog

\Windows\Inf\prn*.inf

\Windows\System32\drivers\usbprint.sys
@\Windows\System32\driverstore\en-US
;devices and printers
c_dot4print.inf_loc
c_pnpprinters.inf_loc
c_printer.inf_loc
c_receiptprinter.inf_loc

@\Windows\System32\

;Windows Photo Viewer needs them too
spool\
coloradapterclient.dll,efswrt.dll,icm32.dll,mscms.dll,photowiz.dll,shimgvw.dll

DafPrintProvider.dll
DevDispItemProvider.dll,DeveloperOptionsSettingsHandlers.dll,deviceassociation.dll
DeviceCenter.dll,DeviceDisplayStatusManager.dll
...
:end_files

It is very clear to me what need to extract from install.wim. (Is this hard to understand? just file list for me.)

If you ask me How to extract files from install.wim, there are lots XPE script in XPE project, you just copy them.
WIN10XPE\Projects\Win10XPE\Features\Audio.Script

Code: [Select]
[Process]
Echo,"Processing %ScriptTitle%..."
Run,%ScriptFile%,AddFiles

[AddFiles]
If,ExistFile,%ScriptDir%\Audio_AddFiles.txt,ExtractListFiles,%ScriptDir%\Audio_AddFiles.txt
If,%SourceBuild%,Bigger,18300,ExtractSectionFiles,%ScriptFile%,Audio_1903_AddFiles

[Audio_1903_AddFiles]
\Windows\System32\SysFxUI.dll
\Windows\System32\WMALFXGFXDSP.dll

Is this hard to create Printer.Script?
Code: [Select]
[Process]
Echo,"Processing %ScriptTitle%..."
Run,%ScriptFile%,AddFiles

[AddFiles]
ExtractSectionFiles,%ScriptFile%,Printer_AddFiles

[Printer_AddFiles]
\Windows\splwow64.exe
\Windows\PrintDialog
\Windows\Inf\prn*.inf
\Windows\System32\DafPrintProvider.dll
\Windows\System32\DevDispItemProvider.dll
\Windows\System32\DeveloperOptionsSettingsHandlers.dll
\Windows\System32\deviceassociation.dll
\Windows\System32\xxx.dll
\Windows\System32\yyy.dll
\Windows\System32\aaa.dll
\Windows\System32\zzz.dll
...

2).About updating registry
In WimBuilder2 is like:
Quote
rem ==========update registry==========

call RegCopy SYSTEM\ControlSet001\Control\Print
call RegCopy SYSTEM\ControlSet001\Control\Class\{1ed2bbf9-11f0-4084-b21f-ad83a8e6dcdc}
call RegCopy SYSTEM\ControlSet001\Control\Class\{4658ee7e-f050-11d1-b6bd-00c04fa372a7}

rem add services
call RegCopyEx Services Spooler

rem remove usbprint if this is additional component
call RegCopyEx Services usbprint

rem avoid error: "the printer driver is not compatible with a policy on your computer which disable NT4.0 driver"
reg add "HKLM\Tmp_Software\Policies\Microsoft\Windows NT\Printers" /v KmPrintersAreBlocked /t REG_DWORD /d 0 /f

rem register WNF_DEP_OOBE_COMPLETE notification for v1903 and later
if %VER[3]% GTR 18300 (
  reg add "HKLM\tmp_SOFTWARE\Microsoft\Windows NT\CurrentVersion\Notifications\Data" /v 41960B29A3BC0C75 /t REG_BINARY /d 0100000001000000 /f
)

If you ask me How to update registry in XPE, there are lots XPE script in XPE project, you just copy them.
Also see WIN10XPE\Projects\Win10XPE\Features\Audio.Script

Quote
RegCopyKey,HKLM,"Tmp_Software\Microsoft\Windows NT\CurrentVersion\MCI Extensions"
RegCopyKey,HKLM,"Tmp_Software\Microsoft\Windows NT\CurrentVersion\MCI32"
//In WinRE.wim RegCopyKey,HKLM,"Tmp_Software\Microsoft\Windows NT\CurrentVersion\Multimedia"

// Sound Volume Bar
RegWrite,HKLM,0x4,Tmp_Software\Microsoft\Windows NT\CurrentVersion\MTCUVC,EnableMtcUvc,0
// Associate .mp3 with mpg123.exe
RegWrite,HKLM,0x1,Tmp_Software\Classes\.mp3,,mpg123


3). set X:\Windows\System32\spool\PRINTERS folder's ACL to everyone
In WimBuilder2 is like:
Quote
rem ; V1709
SetACL.exe -on "%X_SYS%\spool\PRINTERS" -ot file -actn ace -ace "n:Everyone;p:full;s:y"


I think you can call Execute in XPE script, or there is a FileACL macro for this.

4). Shortcut
_printer.bat
Quote
call LinkToDesktop -paramlist "#{@printui.dll,12007}.lnk" "[[X:\%opt[loader.PEMaterial]%\EnablePrintFeature.bat]], '', 'shell32.dll', 16"

WimBuilder2's LinkToDesktop can create shortcut with system dll's string resource, make the name in the language of Windows PE's language.
WIN10XPE's AddShortcut macro don't have the ability, you can simply make it to "EnablePrinter.lnk".


Quote
It seemed a very hard work to me to port them into XPE.
I can't understand which part is hard for you. all the steps have a lots of well sample codes in XPE project.
« Last Edit: November 22, 2019, 12:17:17 PM by slore »

Re: Is there any way to enable printing support in Win10PE SE?
« Reply #6 on: November 22, 2019, 12:45:15 PM »

James

  • Grand Chef
  • *****
  • Location: USA
  • Date Registered: Dec 2017
  • Posts: 2272
Device & Printer Support
I think I have already followed Slore's process for XPE - I can not verify working as I have Network Printer....
And have not received any Input from anyone in regards to testing or corrections....

I will note that topic has gone off track as this was a PESE inquiry..

Re: Is there any way to enable printing support in Win10PE SE?
« Reply #7 on: November 22, 2019, 08:00:33 PM »

sharp

  • Jr. Chef
  • **
  • Date Registered: Jun 2019
  • Posts: 76
Dear slore,
Thanks a lot for your complete answer.
I'm very grateful. Thanks. But remember, if I fail in any stage I will knock at your door once more :smile:

Re: Is there any way to enable printing support in Win10PE SE?
« Reply #8 on: November 23, 2019, 08:22:08 AM »

sharp

  • Jr. Chef
  • **
  • Date Registered: Jun 2019
  • Posts: 76
Hi James,
I used your printer support script. Although it runs and never gives an error, I can not add printer in running live XPE system.
When I try to add a printer add printer dialog appears (which is added only by your script) but in that window there isn't USB port in the list.
Just LPT etc ports. So I think there is smt missing.
Regards.

Re: Is there any way to enable printing support in Win10PE SE?
« Reply #9 on: November 24, 2019, 03:20:21 PM »

James

  • Grand Chef
  • *****
  • Location: USA
  • Date Registered: Dec 2017
  • Posts: 2272
what windows 10 version did you test with ?

Re: Is there any way to enable printing support in Win10PE SE?
« Reply #10 on: November 25, 2019, 09:05:11 AM »

sharp

  • Jr. Chef
  • **
  • Date Registered: Jun 2019
  • Posts: 76
I tested printer script with Windows 10 Pro x64 18362 (1909)
When I run TextMaker in my XPE live system it gives an message that there isn't any
printer installed. And print button is grey, I mean disable. When I try to print smt with Notepad++
it asks whether I want to install a printer or not. I say yes but nothing happens.

 

Powered by EzPortal