Share this post

Link to post

Share on other sites

[b]Crystal Codec Pack 4.3.3[/b]
[b]Windows "Hardware Installation" dialog[/b]
I am not sure how many of You are using this codec pack (it's pretty old), but here is the script anyway. The reason I am posting it because it includes a solution I was looking for a long time: [b]how to bypass that annoying "Hardware installation" dialog[/b] that windows displays when an unsigned driver is about to be installed.
I added some comments inline so You can easily understand it. Here is the code:
[code]; AutoIt Version: 3.0
; Language: English
; Platform: Win9x/NT
; Script Function: Install KS Codec Pack 4.3.3
; Author: Csimbi

;This is the function we will call every now and then to close all those annoying dialogs.
Func getRidOfAnnoyingWindow()
If WinActive("Hardware Installation") Then
ControlClick("Hardware Installation","", "Button1")
EndIf
EndFunc

;Start installation of the codec pack
Run("install.exe")
;Wait until installer is started.
WinWaitActive("Install")
;Send an enter key to bypass the installation confirmation (Yes is selected by default, so we just need to hit enter).
Send("{ENTER}")
;The first dialog is expected to pop up soon, so we start our watchdog function that will close that annoying dialog. We run the script every 250 msecs.
AdlibEnable ("getRidOfAnnoyingWindow", 250)
;The next annoying dialog is windows file protection. We wait for this dialog.
WinWaitActive("Confirm File Replace")
;The dialog has three buttons: Yes, No, and No to all. We emulate keypress on "a" key so that we select the "No to all" button.
Send("a")
;Installation will complete without further interference with the UI, so we can disable the watchdog function.
AdlibDisable ()
;And finally quit.
Exit[/code]