clivebuckwheat Posted August 25, 2012 Posted August 25, 2012 (edited) I have a script to install a Xerox DocuClor 242 printer driver.yet the warning still plagues me.bcdedit.exe /set loadoptions DDISABLE_INTEGRITY_CHECKSbcdedit.exe /set loadoptions TESTSIGNINGONnet stop spoolerreg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports" /v \\Myprintserver\4G11P-DocuColor242 /t REG_SZ /fnet start spoolerprintui.exe /ia /m "DocuColor 242-252-260 PCL" /h "x64" /v "Type 3 - User Mode" /f "\\Myprintserver\drivers\Xerox\DocuColor 242\PRNTDRVR\Pcl6_drvr\Win_2K_XP_VISTA\oemsetup.inf"RUNDLL32 PRINTUI.DLL,PrintUIEntry /if /b "4G11P-DocuColor242" /r "\\Myprintserver\4G11P-DocuColor242" /m "DocuColor 242-252-260 PCL"The problem is the driver is not signed, and I get the popup in the attached screenshot, if i click install the driver the printer installs fine. I have tried to disable the Digital driver signing under windows 7 using bcdedit.exe /set loadoptions DDISABLE_INTEGRITY_CHECKSbcdedit.exe /set loadoptions TESTSIGNINGONHere is the oemsetup.inf; PCL printer INF for WINXP; ;[Version]Signature="$Windows NT$"Provider=%MFG%ClassGUID={4D36E979-E325-11CE-BFC1-08002BE10318}Class=PrinterDriverVer=05/01/2009CatalogFile.NTx86=5p1x12e3.catCatalogFile.NTamd64=5p1x12e6.cat[Watermark_Reg]HKLM,"SYSTEM\CurrentControlSet\Control\Print\Watermark","1",2,"0,0,255,0,0,1,0,0,450,700,0,24,Helvetica,CONFIDENTIAL"HKLM,"SYSTEM\CurrentControlSet\Control\Print\Watermark","2",2,"0,0,0,0,255,1,0,0,450,700,0,24,Helvetica,COPY"HKLM,"SYSTEM\CurrentControlSet\Control\Print\Watermark","3",2,"0,0,0,255,0,1,0,0,450,700,0,24,Helvetica,DRAFT"HKLM,"SYSTEM\CurrentControlSet\Control\Print\Watermark","4",2,"0,0,0,255,0,1,0,0,450,700,0,24,Helvetica,TOP SECRET"HKLM,"SYSTEM\CurrentControlSet\Control\Print\Watermark","5",2,"0,0,0,255,0,1,0,0,450,700,0,24,Helvetica,ORIGINAL";; Manufacturer Sections;; This section lists all of the manufacturers that we will; display in the Dialog box.;[Manufacturer]%MFG%=Xerox, NTamd64;; Model Sections ;; These sections correspond with an entry listed in the; [Manufacturer] section above. The models will be displayed in the order; that they appear here.;; plug-and-play id, if hw does not support it, remove everything after .pdd[Xerox]%Printer1%=EF5P1X12.PDD,LPTENUM\XeroxDocuColor_242-2D26[Xerox.NTamd64]%Printer1%=EF5P1X12.PDD,LPTENUM\XeroxDocuColor_242-2D26;; Installer Sections;;[EF5P1X12.PDD]CopyFiles=@EF5P1X12.PDD,PCLDriverFiles_NT1, SYS32DataFile=EF5P1X12.PDDDataSection=PCLData_NT1AddReg=Watermark_Reg;;; Copy Sections;;; Lists of files that are actually copied. These sections are referenced; from the installer sections above. Only create a section if it contains; two or more files (if we only copy a single file, identify it in the; installer section, using the @filename notation) or if it's a color; profile (since the DestinationDirs can only handle sections, and not; individual files).[SYS32]msvcp80.dllmsvcr80.dll[PCLDriverFiles_NT1]EF5P1X12.chmEF5P1X12.dllEF5P1X12.dlxEF5P1X12.esiEF5P1X12.extEF5P1X12.finEF5P1X12.ifxEF5P1X12.lanEF5P1X12.mrxEF5P1X12.oemEF5P1X12.uatEF5P1X12.uimEF5P1X12.updEF5P1X12.xmlMicrosoft.VC80.CRT.manifestefjm.dllmsvcp80.dllmsvcr80.dllharmony10.dllharmony_bridge.dllharmony_core.dllharmony_ctp.dllharmony_efi.dllharmony_efi_color.dll; Data Sections;[PCLData_NT1]DriverFile=EF5P1X12.dlxConfigFile=EF5P1X12.ifx;; Call SetupSetDirectoryId with 66000 to set the target directory at runtime; (depending on which environment drivers are getting installed);[DestinationDirs]DefaultDestDir=66000SYS32 = 66002;; diskid = description,tagfile,unused,subdir;[SourceDisksNames]1 = %DiskID1%,, 0000-0000;;[SourceDisksNames.x86]1 = %DiskID1%,, 0000-0000;;[SourceDisksFiles.x86]EF5P1X12.PDD = 1EF5P1X12.chm = 1,\i386EF5P1X12.dll = 1,\i386EF5P1X12.dlx = 1,\i386EF5P1X12.esi = 1,\i386EF5P1X12.ext = 1,\i386EF5P1X12.fin = 1,\i386EF5P1X12.ifx = 1,\i386EF5P1X12.lan = 1,\i386EF5P1X12.mrx = 1,\i386EF5P1X12.oem = 1,\i386EF5P1X12.uat = 1,\i386EF5P1X12.uim = 1,\i386EF5P1X12.upd = 1,\i386EF5P1X12.xml = 1Microsoft.VC80.CRT.manifest = 1,\i386efjm.dll = 1,\i386msvcp80.dll = 1,\i386msvcr80.dll = 1,\i386harmony10.dll = 1,\i386harmony_bridge.dll = 1,\i386harmony_core.dll = 1,\i386harmony_ctp.dll = 1,\i386harmony_efi.dll = 1,\i386harmony_efi_color.dll = 1,\i386[SourceDisksFiles.amd64]EF5P1X12.PDD = 1EF5P1X12.chm = 1,\amd64EF5P1X12.dll = 1,\amd64EF5P1X12.dlx = 1,\amd64EF5P1X12.esi = 1,\amd64EF5P1X12.ext = 1,\amd64EF5P1X12.fin = 1,\amd64EF5P1X12.ifx = 1,\amd64EF5P1X12.lan = 1,\amd64EF5P1X12.mrx = 1,\amd64EF5P1X12.oem = 1,\amd64EF5P1X12.uat = 1,\amd64EF5P1X12.uim = 1,\amd64EF5P1X12.upd = 1,\amd64EF5P1X12.xml = 1Microsoft.VC80.CRT.manifest = 1,\amd64efjm.dll = 1,\amd64msvcp80.dll = 1,\amd64msvcr80.dll = 1,\amd64harmony10.dll = 1,\amd64harmony_bridge.dll = 1,\amd64harmony_core.dll = 1,\amd64harmony_ctp.dll = 1,\amd64harmony_efi.dll = 1,\amd64harmony_efi_color.dll = 1,\amd64; Localizable Strings;[Strings]MFG="Xerox"DiskID1="User Software"Printer1="DocuColor 242-252-260 PCL"CLASSNAME="Printer"] Edited August 25, 2012 by clivebuckwheat
jaclaz Posted August 25, 2012 Posted August 25, 2012 The problem is the driver is not signed, and I get the popup in the attached screenshot, if i click install the driver the printer installs fine.What about the good old way of AutoIt or nircmd clicking the "OK"? jaclaz
clivebuckwheat Posted August 25, 2012 Author Posted August 25, 2012 I am really not good with auto it?Nircmd can click ok?
jaclaz Posted August 25, 2012 Posted August 25, 2012 Nircmd can click ok?Sure , it has a few ways, cannot say which one will be suited to the specific message/window....jaclaz
allen2 Posted August 26, 2012 Posted August 26, 2012 To disable driver signing in Windows 7 try following this tutorial and then reboot.Also you script indeed disable driver signing but you need a reboot for it to be disabled as bcdedit only change boot parameter and as stated in thistutorial.As for autoit, if you still want to do it this way, there are many way of doing it, but in all cases, you'll need to wait for the security check to appear with either a sleep command (not recommended) or a loop waiting for the right windows to appear (you can use the "autoit windows info" tool to get the need infos from the window) then focus on the windows and then send a tab and a space (or enter) with the sendkey command. When you'll get some code, if you're struggling with it post it to the right forum and you'll get help.
jaclaz Posted August 26, 2012 Posted August 26, 2012 How would I do it with autoit?Some suitable examples can be found here:http://www.coretechnologies.com/products/AlwaysUp/AutoIt/The approach with AutoIt or with nircmd is essentially the same.You must find a way to "identify" the window, then "wait" until it comes up, then let the program "click" on the right button.jaclaz
clivebuckwheat Posted August 26, 2012 Author Posted August 26, 2012 To disable driver signing in Windows 7 try following this tutorial and then reboot.Also you script indeed disable driver signing but you need a reboot for it to be disabled as bcdedit only change boot parameter and as stated in thistutorial.As for autoit, if you still want to do it this way, there are many way of doing it, but in all cases, you'll need to wait for the security check to appear with either a sleep command (not recommended) or a loop waiting for the right windows to appear (you can use the "autoit windows info" tool to get the need infos from the window) then focus on the windows and then send a tab and a space (or enter) with the sendkey command. When you'll get some code, if you're struggling with it post it to the right forum and you'll get help.I tried the tutorial with a reboot and the dialog box still pops up unfortunately.
clivebuckwheat Posted August 26, 2012 Author Posted August 26, 2012 (edited) I tried to click install with autoit to get the driver installed. It seems the Window is not activate. How do I get around this?My Windows Security ScriptWinWait("Windows Security", "")WinActive("Windows Security", "")Send("{TAB}")Send("{ENTER}")Exit(0)Any Help would be great as I am not very skilled with autoit. Edited August 26, 2012 by clivebuckwheat
jaclaz Posted August 26, 2012 Posted August 26, 2012 My Windows Security ScriptUse this:http://www.coretechnologies.com/products/AlwaysUp/AutoIt/SendEnterKeyToWindow.au3as a base (seemingly you only need to add to it a "send TAB" command), i.e. replace:$result = ControlSend($windowName, "", "", "{ENTER}")with$result = ControlSend($windowName, "", "", "{TAB}")$result = ControlSend($windowName, "", "", "{ENTER}") try with logging enabled...jaclaz
clivebuckwheat Posted August 26, 2012 Author Posted August 26, 2012 I got it working with this.WinWait("Windows Security", "")WinActivate("Windows Security")Send("{TAB}")Send("{ENTER}")Exit(0)Now the issue is I need the script to loop, once the security warning box appears I need the autoit script to execute. Right now once the security warning box appears I must run the autoit script manually.
jaclaz Posted August 26, 2012 Posted August 26, 2012 Now the issue is I need the script to loop, once the security warning box appears I need the autoit script to execute. Right now once the security warning box appears I must run the autoit script manually.Try running it BEFORE (that should be the idea of the WinWait command), no need to loop... i.e. call it with the same batch with which you start the install.http://www.autoitscript.com/autoit3/docs/functions/WinWait.htmIf you omit the timeout and - for any reason - the windows does not appear or is not "sensed" the script will "wait forever", so giving it a "reasonable" timeout may be a smart thing to do.jaclaz
clivebuckwheat Posted August 26, 2012 Author Posted August 26, 2012 (edited) Here is the batch file I do the execution of the printer script in as well as the autoit script. \\MyPrintserver\WindowsSecurityInstallYes.exenet stop spoolerreg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports" /v \\MyPrintserver\4G11P-DocuColor242 /t REG_SZ /fnet start spoolerprintui.exe /ia /m "DocuColor 242-252-260 PCL" /h "x64" /v "Type 3 - User Mode" /f " \\MyPrintserver\drivers\Xerox\DocuColor 242\PRNTDRVR\Pcl6_drvr\Win_2K_XP_VISTA\oemsetup.inf"RUNDLL32 PRINTUI.DLL,PrintUIEntry /if /b "4G11P-DocuColor242" /r " \\MyPrintserver\4G11P-DocuColor242" /m "DocuColor 242-252-260 PCL"Here is the autoit script with pauseWinWait("[CLASS:Windows Security]", "", 45)WinActivate("Windows Security")Send("{TAB}")Send("{ENTER}")Exit(0)The problem is I must run the autoit script before I run the line that generates the windows security dialog.I call the autoit script from the batch file, the batch file pauses for 45 seconds runs the autoit script and exits and THEN runs the printui.exe /ia /m "DocuColor 242-252-260 PCL" /h "x64" /v "Type 3 - User Mode" /f " \\MyPrintserver\drivers\Xerox\DocuColor 242\PRNTDRVR\Pcl6_drvr\Win_2K_XP_VISTA\oemsetup.inf" which generates the windows security warning. Edited August 26, 2012 by clivebuckwheat
allen2 Posted August 27, 2012 Posted August 27, 2012 You could either integrate everything in your autoit script (using runwait and run command) or modify your batch script like this:start /separate "process security warning" \\MyPrintserver\WindowsSecurityInstallYes.exe
jaclaz Posted August 27, 2012 Posted August 27, 2012 You could either integrate everything in your autoit script (using runwait and run command) or modify your batch script like this:start /separate "process security warning" \\MyPrintserver\WindowsSecurityInstallYes.exeHmmm. http://ss64.com/nt/start.html Options for 16-bit WINDOWS programs only /SEPARATE Start in separate memory space (more robust) /SHARED Start in shared memory space (default)I would try with a simpler:START "process security warning" \\MyPrintserver\WindowsSecurityInstallYes.exeand then try with:START "process security warning" /MIN \\MyPrintserver\WindowsSecurityInstallYes.exejaclaz
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now