Jump to content

Auto Installation using Autoit


Recommended Posts

I create a setup file to install Kaspersky Anti-virus automatically.

Code here... but when it working for a half, the later steps is not work!

#NoTrayIcon
Run("kav6.0.2.621en.exe")
WinWaitActive("Kaspersky Anti-Virus 6.0", "We advise you to close all other applications before continuing.")
Send("!n")
WinWaitActive("Kaspersky Anti-Virus 6.0", "Standard End User License Agreement")
Send("!a")
Send("!n")
WinWaitActive("Kaspersky Anti-Virus 6.0", "To install in this folder")
Send("!n")
WinWaitActive("Kaspersky Anti-Virus 6.0", "Choose the setup type that best suits your needs")
Send("{SPACE}")
WinWaitActive("Kaspersky Anti-Virus 6.0", "Click Install to begin the installation")
Send("!i")
WinWaitActive("Kaspersky Anti-Virus 6.0", "Installation in progress")
WinWaitActive("Kaspersky Anti-Virus 6.0", "Installation completed successfully")
Send("!n")

;It being disable from here....

WinWaitActive("Setup Wizard: Kaspersky Anti-Virus", "&Activate using the activation code")
Send("!k")
Send("!n")
WinWaitActive("Setup Wizard: Kaspersky Anti-Virus", "B&rowse")
Send("!r")
WinWaitActive("Please specify the license key file name", "Look &in:")
Send("KAV.key")
Send("!o")
WinWaitActive("Setup Wizard: Kaspersky Anti-Virus", "Qihoo Special Deal (14)")
Send("!n")
WinWaitActive("Setup Wizard: Kaspersky Anti-Virus", "License key information")
Send("!n")
WinWaitActive("Setup Wizard: Kaspersky Anti-Virus", "B&asic protection (recommended for most users)")
Send("!n")
WinWaitActive("Setup Wizard: Kaspersky Anti-Virus", "Au&tomatically")
Send("!m")
Send("!s")
WinWaitActive("Settings: Update", "LAN Settings")
Send("^{TAB}")
WinWaitActive("Settings: Update", "Update source")
Send("{TAB}")
Send("{SPACE}")
Send("!a")
WinWaitActive("Select update source", "C:\Documents and Settings")
Send("{DOWN}")
Send("{DOWN}")
Send("{RIGHT}")
Send("{DOWN}")
Send("{RIGHT}")
Send("{DOWN}")
Send("!o")
WinWaitActive("Settings: Update", "Update source")
Send("!o")
WinWaitActive("Setup Wizard: Kaspersky Anti-Virus", "Au&tomatically")
Send("!u")
Sleep(30000)
Send("!c")
WinWaitActive("Setup Wizard: Kaspersky Anti-Virus", "Au&tomatically")
Send("!n")
WinWaitActive("Setup Wizard: Kaspersky Anti-Virus", "At program &startup")
Send("!s")
Send("!n")
WinWaitActive("Setup Wizard: Kaspersky Anti-Virus", "Enable &password protection")
Send("!n")
WinWaitActive("Setup Wizard: Kaspersky Anti-Virus", "&Restart computer")
Send("!f")

Help me... Great thanks!

Link to comment
Share on other sites

Paste the function below at the bottom of your script and then add an underscore in front of every WinWaitActive() function in your script. Give that a test and see how it goes.

Func _WinWaitActive($title, $text = '')
    WinWait($title, $text)
    WinActivate($title, $text)
    WinWaitActive($title, $text)
EndFunc

:shocked:

Edited by MHz
Link to comment
Share on other sites

I would use an easier method as discussed here. You can silent install the msi file and then add the registry entries. Just a few lines of code should do it fine.

Your current method is unreliable even if you remove the bug so try the one just mentioned.

:shocked:

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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