Changes

Jump to: navigation, search

Printer drivers

4,190 bytes added, 21:35, 16 January 2012
no edit summary
</package>
</source>
 
=== Samsung SCX-4x28 Series (Requires WPKG 1.2.1-RC20 or higher) ===
''Tested only on Windows 7''
 
Script to install driver and network printer (IP-port connection)
 
<source lang="xml">
<packages>
<package
id="printer-samsung"
name="Printer Samsung"
revision="20120117-04"
priority="0"
reboot="false">
 
<variable name="PKG_PRINTERNAME" value="Samsung SCX-4x28 Series PS" />
<variable name="PKG_ADDRESS" value="192.168.1.11" />
<variable name="PKG_PRINTERMODEL" value="Samsung SCX-4x28 Series PS" />
<variable name="PKG_LANGUAGEFULL" value="English"/>
<variable name="PKG_LANGUAGEFULL" value="Russian" lcid="419,1049,422,1058"/>
<variable name="PKG_SOURCE" value="%SOFTWARE%\hardware\Samsung SCX-4828FN\Printer\PS\%PKG_LANGUAGEFULL%\WinXP_VISTA_64\smf428.inf" architecture="x64" />
<variable name="PKG_SOURCE" value="%SOFTWARE%\hardware\Samsung SCX-4828FN\Printer\PS\%PKG_LANGUAGEFULL%\WinXP_2000_VISTA_32\smf428.inf" architecture="x86" />
<variable name="PKG_DRIVERSDATA" value="smf428.ppd" />
 
<variable name="PKG_LANGUAGE" value="en-US"/>
<variable name="PKG_LANGUAGE" value="ru-RU" lcid="419,1049,422,1058"/>
<variable name="PKG_PRNPORT" value="%windir%\System32\prnport.vbs" os="5\.\d\.\d{4}" /> <!-- WinXP/2000 -->
<variable name="PKG_PRNPORT" value="%windir%\System32\Printing_Admin_Scripts\%PKG_LANGUAGE%\prnport.vbs" os="6\.\d\.\d{4}" /> <!-- Vista/Seven -->
 
<check type="logical" condition="or">
<!-- Windows XP -->
<check type="registry" condition="equals" path="HKLM\SYSTEM\CurrentControlSet\Control\PrintEnvironments\Windows NT x86\Drivers\Version-3\%PKG_PRINTERMODEL%\Data File" value="%PKG_DRIVERSDATA%" />
<check type="registry" condition="equals" path="HKLM\SYSTEM\CurrentControlSet\Control\PrintEnvironments\Windows x64\Drivers\Version-3\%PKG_PRINTERMODEL%\Data File" value="%PKG_DRIVERSDATA%" />
<!-- Windows 7 -->
<check type="registry" condition="equals" path="HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows NT x86\Drivers\Version-3\%PKG_PRINTERMODEL%\Data File" value="%PKG_DRIVERSDATA%" />
<check type="registry" condition="equals" path="HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows x64\Drivers\Version-3\%PKG_PRINTERMODEL%\Data File" value="%PKG_DRIVERSDATA%" />
</check>
 
<!-- -s %PKG_SERVER% -->
<install cmd='cscript.exe "%PKG_PRNPORT%" -a -r IP_%PKG_ADDRESS% -h %PKG_ADDRESS% -me -y public -i 1 -o raw -n 9100' />
<install cmd='rundll32 PrintUI.dll,PrintUIEntry /if /b "%PKG_PRINTERNAME%" /f "%PKG_SOURCE%" /m "%PKG_PRINTERMODEL%" /r "IP_%PKG_ADDRESS%"' />
<install cmd="net stop spooler" />
<install cmd="net start spooler" />
 
<upgrade include="remove" />
<upgrade include="install" />
 
<remove timeout="15" cmd='rundll32 PrintUI.dll,PrintUIEntry /dl /n "%PKG_PRINTERNAME%"' >
<exit code="any" />
</remove>
<remove timeout="15" cmd='cscript.exe "%PKG_PRNPORT%" -d -r IP_%PKG_ADDRESS%' >
<exit code="any" />
</remove>
<remove timeout="15" cmd='rundll32 PrintUI.dll,PrintUIEntry /dd /m "%PKG_PRINTERMODEL%"' >
<exit code="any" />
</remove>
<remove cmd="net stop spooler" />
<remove cmd="net start spooler" />
</package>
</packages>
 
</source>
 
==
== Adding a Printer Port ==
cscript %WINDIR%\system32\prnport.vbs -a -r ExamplePortName -h ExampleIP -o raw -n 9100
rundll32 PrintUI.dll,PrintUIEntry /if /b "Brother HL-2150N" /f "%SOFTWARE%\BrotherHL2150N\BROHL07A.INF" /m "Brother HL-2150N series" /r "ExamplePortName"
</source>
 
For Windows Seven there is another path for prnport.vbs:
<source lang="dos">
...
cscript %WINDIR%\System32\Printing_Admin_Scripts\%PKG_LANGUAGE%\prnport.vbs -a -r ExamplePortName -h ExampleIP -o raw -n 9100
...
</source>
[[Category:Silent Installers]]
[[Category:Changing Windows settings]]
3
edits

Navigation menu