Jump to content

Kaspersky Internet Security 2009 - scripting problem w/ Config Wizard


Recommended Posts

Posted

I'm trying to write an AutoIt script for unattended installation of Kaspersky Internet Security 2009 v8.0.506. It's almost ready and uses simple AutoIt commands (see the code below). It seems to work ok unless the Configuration Wizard page pops up.

I used ShellExecute command to launch the main MSI installer. As soon as it finishes installing (even though 3 instances of "msiexec.exe" running in the Task Manager), it launches AVP.exe which is the actual program. But the problem is that at its first launch the program opens the Configuration Wizard, and starts the program only if you pre-configure the basic parameters before the actual program starts. I.e., AVP.exe is mainly responsible for the start of the main program but at its 1st launch only the Configuration Wizard starts and then passes the command to the main program.

However, I still cannot enable the script to "catch" the Configuration Wizard window. No way... On the other hand, when I divide the code to two separate scripts - one responsible for MSI install, and the other one - to launch AVP.exe after the MSI install - the script works!!! I think the problem is with the passing of "rights" from MSI to AVP.exe. You can see it in the attached script.

As you can see, when the mouse is on the "Next" button, AutoIt Window Info does not show any button info to include with ControlClick command - the command I often used in the script. Therefore, I've decided to use SEND("!n") command instead (since the underlined letter for "Next" is "N") but to no avail either. The only valuable information I could get from AutoIt Window Info was that that particular window belongs to Class AVP.WizardTpl. To be honest, it doesn't sound anything to me but I've googled around to find out a similar scripting problem. There is, however, no indication whatsoever.

I've attached the complete script so that everyone could test it and guide me in the right direction. My question is - what can be done to proceed with Conf. Wizard Page and make it "catchable" for AutoIt?!?

Thank you very much in advance!!

; ----------------------------------------------------------------------------
;
; Kaspersky Internet Security 2009 (8.0.506)
; Language: English
; Creator: SIMurq
; Version: 1.0
; ----------------------------------------------------------------------------


;Setup start
ShellExecute("kis.en.msi")

;Actual installation
WinWaitActive("Kaspersky Internet Security 2009", "Welcome to Kaspersky Internet Security 2009 Setup Wizard")
ControlClick("Kaspersky Internet Security 2009", "", "Button1")

;License
WinWaitActive("Kaspersky Internet Security 2009", "Standard End User License Agreement")
ControlClick("Kaspersky Internet Security 2009", "", "Button2")
ControlClick("Kaspersky Internet Security 2009", "", "Button5")

;Install type selection
WinWaitActive("Kaspersky Internet Security 2009", "Installation type")
ControlClick("Kaspersky Internet Security 2009", "", "Button1")

;Start install
WinWaitActive("Kaspersky Internet Security 2009", "Ready to install")
ControlClick("Kaspersky Internet Security 2009", "", "Button3")

;---------------------------------------------------------------
;That's the funny part when MSI install stops and launches the installed AVP.exe (actual program).
;As soon as AVP.exe starts, it opens NOT the program but the Configuration Wizard to pre-configure some basic program parameters.
;The below script doesn't work, however, since it cannot "catch" the Conf. Wizard window!
;Also, when I make another script and input ShellExecute("avp.exe") and the following lines (see below), it works! But, as I said, the below lines
;don't work within one script. :(
;---------------------------------------------------------------

;Configuration Wizard Start Page
WinWaitActive("Kaspersky Internet Security 2009", "Welcome")
Send("{ENTER}")

;Wizard Start
WinWaitActive("Kaspersky Internet Security Configuration Wizard", "&Next")
Send("!n")

;Postponing Activation of Program
WinWaitActive("Kaspersky Internet Security Configuration Wizard", "Activate your copy of Kaspersky Internet Security")
Send("!l")

;Disabling Feedback/Network Participation
WinWaitActive("Kaspersky Internet Security Configuration Wizard", "Feedback")
Send("{TAB}")
Send("{TAB}")
Send("{SPACE}")
Send("!n")

;Stop Restart
WinWaitActive("Kaspersky Internet Security Configuration Wizard", "Restart")
Send("!r")
Send("!f")


Posted

You can use switches to install it silently. I don't remember them, but i think you can grab the MSI installers from Program Data/Kaspersky and use /qb /norestart or /qn /norestart.

Also, make a search, there a few topics that discuss this.

Posted (edited)

Muchas gracias, elajua! Your website is great, by the way! :)

I have solved the problem finally. The problem was with... nothing but the stupid behaviour of AutoIt itself changing from time to time. I prefer using the SciTe Editor instead of SciTe Writer. Testing my script repeatedly, I have noticed a strange thing - AutoIt was reading the same script differently at different times. E.g., soemtimes it recognized the window titles, sometimes - not! That's why I have decided to run taskkill command at a certain place of the script (at the end of actual installation of the program) to stop execution of MSI installer and then launch AVP.exe (the actual Kaspersky anti-virus program) separately to be able to make AutoIt to see the window titles.

But yesterday, quite suddenly my previous script (posted above) with taskkill command deleted this time (since I thought it is not good and aesthetic to use the script this way) :) started working OK and gave me the result I wanted from it - it recognized the post-install windows of KIS Configuration Wizard. I'm happy now!

Edited by simurqq

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...