This is an old revision of the document!
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
;
;##################################################################
;Siehe auch unter
; http://www.haferbeck.de/support/techtalk/tt-auto-di/?list=Windows2000&ID=2
; http://www.administrator.de/Bei_autom._Druckerinstallation_mit_prnmgr.vbs_findet_er_nie_den_Pfad_od._die_inf._Datei.html
; helper dll and scripts from w2000 server resource kit
;
[Initial]
; Message at install time:
Message=Installiere Druckertreiber ......
LogLevel=2
; Log Errors in Logfile but don't abort:
ExitOnError=false
; Show syntax errors in the script:
ScriptErrorMessages=on
; Dont trace step by step through the script:
TraceMode=off
; let started programs run in front of the winst window
StayOnTop=false
[Aktionen]
DefVar $RebootFlag$
DefVar $WinstRegKey$
DefVar $RebootRegVar$
;Variables for version of the operating system (OS)-Test
DefVar $SYSTEMROOT$
DefVar $SYSTEMDRIVE$
Set $SYSTEMDRIVE$ = %SYSTEMDRIVE%
Set $SYSTEMROOT$ = "%SYSTEMROOT%"
DefVar $TEMP$
DefVar $OS$
DefVar $MinorOS$
DefVar $IpNumbers$
DefStringlist $IpList$
DefVar $aktIpNumber$
DefVar $MyPrinterName$
DefVar $MyPrinterNameIp$
DefVar $Path2InfFile$
DefVar $InfFile$
DefVar $PrinterPort$
DefVar $PrinterNameInInfFile$
set $OS$ = GetOS
set $MinorOS$ = GetNTVersion
if ( $OS$ = "Windows_NT")
; show product picture
ShowBitmap /3 "%scriptpath%\printer.png" "Druckertreiber"
; lets copy and register helper dll
Files_copy_prnadmin
DosInAnIcon_register_prnadmin
; der Pfad fuer PCL N:\4all\treiber\brother_mfc_8440\MFLPRO\Data\Pcl\Win2kXP\German
; should we install ?
set $IpNumbers$ = IniVar ("Brother_MFC_8840_PCL")
if not ($IpNumbers$ = "off")
; free defined printer name eg. bro_uib_room5
set $MyPrinterName$ = "Brother MFC-8440"
; Name of to printer model exactly as it is in the inf-file below
set $PrinterNameInInfFile$ ="Brother MFC-8440"
; full path to the inf-file to use
if ($MinorOS$ = "WinXP")
set $InfFile$ = "%ScriptPath%\files\brother_mfc_8440\pcl\win2kxp\german\adduni.inf"
endif
if ($MinorOS$ = "Win NT 5.2")
set $InfFile$ = "%ScriptPath%\files\brother_mfc_8440\pcl\win2kxp\german\adduni.inf"
endif
if ($MinorOS$ = "Win2k")
set $InfFile$ = "%ScriptPath%\files\brother_mfc_8440\pcl\win2kxp\german\adduni.inf"
endif
; get list of ipnumbers
set $IpList$ = splitstring($IpNumbers$, ";")
for $s$ in $IpList$ do sub_install_printer
endif
; der Pfad fuer PS N:\4all\treiber\brother_mfc_8440\MFLPRO\Data\Ps\Win2kXP\GERMAN
; should we install ?
set $IpNumbers$ = IniVar ("Brother_MFC_8840_PS")
if not ($IpNumbers$ = "off")
; free defined printer name eg. bro_uib_room5
set $MyPrinterName$ = "Brother MFC-8440 BR-Script3"
; Name of to printer model exactly as it is in the inf-file below
set $PrinterNameInInfFile$ ="Brother MFC-8440 BR-Script3"
; full path to the inf-file to use
if ($MinorOS$ = "WinXP")
set $InfFile$ = "%ScriptPath%\files\brother_mfc_8440\ps\win2kxp\german\br8840_2.inf"
endif
if ($MinorOS$ = "Win2k")
set $InfFile$ = "%ScriptPath%\files\brother_mfc_8440\ps\win2kxp\german\br8840_2.inf"
endif
; get list of ipnumbers
set $IpList$ = splitstring($IpNumbers$, ";")
for $s$ in $IpList$ do sub_install_printer
endif
endif
[Files_copy_prnadmin]
copy -v %ScriptPath%\files\prnadmin.dll %System%
[DosInAnIcon_register_prnadmin]
c:
cd %System%
regsvr32.exe /s prnadmin.dll
[sub_install_printer]
set $aktIpNumber$ = "$s$"
; define portname
set $PrinterPort$ = "IP_$s$"
set $MyPrinterNameIp$ = $MyPrinterName$+"_$s$"
set $Path2InfFile$ = ExtractFilePath($InfFile$)
; now install the printer
DosInAnIcon_install_printer
[DosInAnIcon_install_printer]
rem Install the printer port
cscript %ScriptPath%\files\portmgr.vbs -a -c "" -p $PrinterPort$ -h $aktIpNumber$ -t raw -n 9100
rem install printer driver and connect to port
rem cscript %ScriptPath%\files\prnmgr.vbs -a -b "$MyPrinterNameIp$" -p "$Path2InfFile$" -r "$PrinterPort$" -m "$PrinterNameInInfFile$" -f $InfFile$
cscript %ScriptPath%\files\prnmgr.vbs -a -b "$MyPrinterNameIp$" -r "$PrinterPort$" -m "$PrinterNameInInfFile$" -f "$InfFile$"