engine Posted July 5, 2008 Share Posted July 5, 2008 (edited) I was having problems using Adlib to click on windows driver signing popups, on some of my scripts. So I made a search on the web, trying to find a better solution. Turns out it's not as simple as changing a simple registry key! I eventually found this code written in C -> http://openvpn.net/archive/openvpn-users/2...1/msg00341.html Finally I decided to translate it to AutoIt so I could include it on my scripts. Turns out it really works!So here is the result:DriverSigning.au3It works at least on Windows XP SP3. And Windows XP SP2 according to the original author. This code is around since 2004!To use this UDF I recommend something like this:#include "DriverSigning.au3" ; Backup current state $iCU = RegRead("HKCU\Software\Policies\Microsoft\Windows NT\Driver Signing", "BehaviorOnFailedVerify") $iLM = RegRead("HKLM\Software\Microsoft\Driver Signing", "Policy") If Not @error Then $iLM = Number($iLM) _SetDriverSigning() EndIf ; Do your stuff here Func OnAutoItExit() ; Restore back to original state If $iLM <> "" Then _SetDriverSigning($iLM, $iCU) EndFuncThis way you won't even see the popup!Enjoy! Edited January 5, 2009 by engine My contributions:Local account UDF Registry UDFs DriverSigning UDF Windows Services UDF [url="http://www.autoitscript.com/forum/index.php?showtopic=81880"][/url] Link to comment Share on other sites More sharing options...
MadBoy Posted July 6, 2008 Share Posted July 6, 2008 (edited) It's missing Then in line: If Not @error Then _SetDriverSigning() Other then that it works great. Thank You very much!! I looked for this for years to put this in my program (Pro-S Hardware Installer)!! Edited July 6, 2008 by MadBoy My little company: Evotec (PL version: Evotec) Link to comment Share on other sites More sharing options...
engine Posted July 6, 2008 Author Share Posted July 6, 2008 Thanks. Looks like that registry key "HKCU\Software\Microsoft\Driver Signing" doesn't work from my Windows Unattended. I checked and it doesn't even exist. It's written when you change driver signing policy under Windows, so it works from regular Windows. Also there is another key ("HKCU\Software\Policies\Microsoft\Windows NT\Driver Signing", "BehaviorOnFailedVerify"). But writing to it makes no difference under my tests. However I will include it in the next release. Regards. My contributions:Local account UDF Registry UDFs DriverSigning UDF Windows Services UDF [url="http://www.autoitscript.com/forum/index.php?showtopic=81880"][/url] Link to comment Share on other sites More sharing options...
engine Posted July 6, 2008 Author Share Posted July 6, 2008 Updated. Now can set both at the user level and at the machine level. This is based on the behavior observed in Windows XP. Here is an example of my script to install Virtual CloneDrive. expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.12.0 Language: Multi Platform: Multi Author: engine Script Function: Install Virtual CloneDrive #ce ---------------------------------------------------------------------------- $installdir = @ProgramFilesDir & "\Elaborate Bytes\VirtualCloneDrive" ; Set your prefered install location here $desktop = 0 ; Set the value to "0" to disable the Desktop icon $AutoMount = 0 ; Automount last image $bufferedIO = 1 $NumberOfDrives = 1 $VirtualSheep = 1 $LocaleName = "EN" ; Two letter language code from list below #cs List of available languages "AR" Arabic "CZ" Czech "DE" Deutch "EL" Greek "EN" English "FR" French "IT" Italiano "JP" Japanese "PL" Polish "RU" Russian "SK" Slovak #ce List of available languages #cs ---------------------------------------------------------------------------- Script Start! #ce ---------------------------------------------------------------------------- #NoTrayIcon #include <Misc.au3> #include "..\..\Include\DriverSigning.au3" _Singleton("Virtual CloneDrive AutoIt v3 Script 1.0", 0) ; It's already running ; Options AutoItSetOption("WinDetectHiddenText", 1) AutoItSetOption("WinTitleMatchMode", 4) AutoItSetOption("WinWaitDelay", 1) ; Search for the installer $search = FileFindFirstFile(@ScriptDir & "\*VirtualCloneDrive*.exe") $vcd = FileFindNextFile($search) FileClose($search) $iCU = RegRead("HKCU\Software\Policies\Microsoft\Windows NT\Driver Signing", "BehaviorOnFailedVerify") $iLM = RegRead("HKLM\Software\Microsoft\Driver Signing", "Policy") If Not @error Then $iLM = Number($iLM) _SetDriverSigning() EndIf ; Run the installer RunWait(@ScriptDir & "\" & $vcd & ' /S /D="' & $installdir & '"') ; Delete desktop icon If $desktop = 0 Then FileDelete(@DesktopCommonDir & "\Virtual CloneDrive.lnk") ; Write settings to the registry $KEY = "HKLM\SOFTWARE\Elaborate Bytes\VirtualCloneDrive" RegWrite($KEY, "AutoMount", "REG_DWORD", $AutoMount) RegWrite($KEY, "bufferedIO", "REG_DWORD", $bufferedIO) RegWrite($KEY, "NumberOfDrives", "REG_DWORD", $NumberOfDrives) RegWrite($KEY, "VirtualSheep", "REG_DWORD", $VirtualSheep) RegWrite($KEY & "\Settings", "LocaleName", "REG_SZ", $LocaleName) RegWrite("HKCU\Software\Elaborate Bytes\VirtualCloneDrive\Settings", "LocaleName", "REG_SZ", $LocaleName) ; Make settings active immediately Run($installdir & "\VCDPrefs.exe", "", @SW_HIDE) WinWait("[TITLE:Virtual CloneDrive; CLASS:TMainForm]", $NumberOfDrives) ControlClick("[TITLE:Virtual CloneDrive; CLASS:TMainForm]", $NumberOfDrives, "TButton1") Exit Func OnAutoItExit() If $iLM <> "" Then _SetDriverSigning($iLM, $iCU) EndFunc My contributions:Local account UDF Registry UDFs DriverSigning UDF Windows Services UDF [url="http://www.autoitscript.com/forum/index.php?showtopic=81880"][/url] Link to comment Share on other sites More sharing options...
engine Posted July 9, 2008 Author Share Posted July 9, 2008 (edited) Updated. It was failing in some situations. The "CRYPT_VERIFYCONTEXT" constant solved the problem for me. Regards. Edited July 9, 2008 by engine My contributions:Local account UDF Registry UDFs DriverSigning UDF Windows Services UDF [url="http://www.autoitscript.com/forum/index.php?showtopic=81880"][/url] Link to comment Share on other sites More sharing options...
engine Posted August 22, 2008 Author Share Posted August 22, 2008 Updated! UDF revised internally for greater simplicity. My contributions:Local account UDF Registry UDFs DriverSigning UDF Windows Services UDF [url="http://www.autoitscript.com/forum/index.php?showtopic=81880"][/url] Link to comment Share on other sites More sharing options...
thor918 Posted October 17, 2008 Share Posted October 17, 2008 (edited) any chance anyone knows a method to install only the driver for Virtual CloneDrive, and nothing else? that driver can be used with the exellent buring program imgburn Edited October 17, 2008 by thor918 Link to comment Share on other sites More sharing options...
MadBoy Posted October 17, 2008 Share Posted October 17, 2008 any chance anyone knows a method to install only the driver for Virtual CloneDrive, and nothing else?that driver can be used with the exellent buring program imgburnUse devcon.exe (get it from Microsoft website). It should be able to do what you need. My little company: Evotec (PL version: Evotec) Link to comment Share on other sites More sharing options...
thor918 Posted October 17, 2008 Share Posted October 17, 2008 Use devcon.exe (get it from Microsoft website). It should be able to do what you need.I have allready tried that road.Used uniextractor on the nsis package and inside there it was a driver folder.Then I used this command:devcon.exe install VClone.inf @ROOT\SCSIADAPTER\0000Device node created. Install is complete when drivers are installed...Updating drivers for @ROOT\SCSIADAPTER\0000 from C:\Documents and Settings\Administrator\Skrivebord\imgburn\SetupVirtualCloneDrive5\Ó\VClone.inf.devcon.exe failed. Link to comment Share on other sites More sharing options...
thor918 Posted October 17, 2008 Share Posted October 17, 2008 (edited) hehe.think I got it:devcon.exe install VClone.inf ROOT\vcloneEdit:nope. seems to still be something missing...I 11:45:05 ELBYCDIO.DLL - Elaborate Bytes CDRTools - ElbyCDIO DLL - Version 6.0.7.0E 11:45:05 ElbyCDIO_InitScsi Failed!E 11:45:05 Reason: Kernel Mode driver not loaded - try rebooting your machine Edited October 17, 2008 by thor918 Link to comment Share on other sites More sharing options...
thor918 Posted October 17, 2008 Share Posted October 17, 2008 Use devcon.exe (get it from Microsoft website). It should be able to do what you need.any other tips? Link to comment Share on other sites More sharing options...
engine Posted October 17, 2008 Author Share Posted October 17, 2008 You are getting off topic. My contributions:Local account UDF Registry UDFs DriverSigning UDF Windows Services UDF [url="http://www.autoitscript.com/forum/index.php?showtopic=81880"][/url] Link to comment Share on other sites More sharing options...
WeMartiansAreFriendly Posted October 17, 2008 Share Posted October 17, 2008 This will come in handy. Thanks for sharing. Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Link to comment Share on other sites More sharing options...
thor918 Posted October 17, 2008 Share Posted October 17, 2008 You are getting off topic.sorry Link to comment Share on other sites More sharing options...
engine Posted January 5, 2009 Author Share Posted January 5, 2009 UDF updated. It should now work with AutoIt v3.3.0.0 as well as previous versions. My contributions:Local account UDF Registry UDFs DriverSigning UDF Windows Services UDF [url="http://www.autoitscript.com/forum/index.php?showtopic=81880"][/url] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now