Jump to content

Help!: Create install Nero 10 unattended with autoit


Recommended Posts

Hi guys!!!

I try to create au3 for nero 10 multimedia for a unattended install. Install nero 10 with one click. But my au3 not work fine! Can you help me!!?

; ----------------------------------------------------------------------------

;

; Nero10 - Install by Mayoral

;

; ----------------------------------------------------------------------------

Run("setup.exe")

WinWaitactive("[CLASS:#32770]")

ControlClick("InstallShield Wizard","","[CLASS:Button; TEXT:Instalar; INSTANCE:1]")

WinWaitactive("Nero 10 Lite - InstallShield Wizard", "&Siguiente")

Send("{ENTER}")

WinWaitactive("Nero 10 Lite - InstallShield Wizard", "&No")

Send("{ENTER}")

Sleep(5000)

WinWaitactive("Nero 10 Lite - InstallShield Wizard", "&Siguiente")

Send("{ENTER}")

WinWaitactive("Nero 10 Lite - InstallShield Wizard", "&Siguiente")

Send("!e")

Send("{ENTER}")

WinWaitActive("Nero 10 Lite - InstallShield Wizard", "Com&pleta")

Send("{ENTER}")

WinWaitActive("Nero 10 Lite - InstallShield Wizard", "Programa para la mejora de los productos de Nero")

ControlClick("Nero 10 Lite - InstallShield Wizard","","[CLASS:Button; TEXT:No, gracias.; INSTANCE:3]")

ControlClick("Nero 10 Lite - InstallShield Wizard","","[CLASS:Button; TEXT:&Siguiente; INSTANCE:5]")

WinWaitActive("Nero 10 Lite - InstallShield Wizard", "&Instalar")

Send("{ENTER}")

Link to comment
Share on other sites


Hi Mayoral,

I am going to guess the issue as you explained little and I am not testing Nero. So hopefully these changes I made may help. The 1st WinWaitActive does not match the following ControlClick title so I am guessing it is incorrect so I changed it from the #32770 class which IIRC is an explorer window to "InstallShield Wizard". I changed WinWaitActive functions to use the _WinWaitActive UDF which will wait for the window, activate the window and then wait until it is active. Using the UDF may help prevent the script from stalling if the window does not activate for some reason. I added use of the ProcessID for existence check and as a wait for the installation to finish. If the Run function errors or the ProcessID does not exist then the script will exit with code 1. Added TrayIconDebug option so if the script stalls, then move the mouse over the tray icon to see which line that the script has stalled at.

; ----------------------------------------------------------------------------
;
; Nero10 - Install by Mayoral
;
; ----------------------------------------------------------------------------

; shows current line processed in tray icon
Opt("TrayIconDebug", True)

$pid = Run("setup.exe")
; proceed if not error and the Process ID exists
If Not @error And ProcessExists($pid) Then
; changed WinWaitActive functions to use _WinWaitActive UDF below to force activation
_WinWaitactive("InstallShield Wizard")
ControlClick("InstallShield Wizard", "", "[CLASS:Button; TEXT:Instalar; INSTANCE:1]")
_WinWaitactive("Nero 10 Lite - InstallShield Wizard", "&Siguiente")
Send("{ENTER}")
_WinWaitactive("Nero 10 Lite - InstallShield Wizard", "&No")
Send("{ENTER}")
Sleep(5000)
_WinWaitactive("Nero 10 Lite - InstallShield Wizard", "&Siguiente")
Send("{ENTER}")
_WinWaitactive("Nero 10 Lite - InstallShield Wizard", "&Siguiente")
Send("!e")
Send("{ENTER}")
_WinWaitActive("Nero 10 Lite - InstallShield Wizard", "Com&pleta")
Send("{ENTER}")
_WinWaitActive("Nero 10 Lite - InstallShield Wizard", "Programa para la mejora de los productos de Nero")
ControlClick("Nero 10 Lite - InstallShield Wizard","","[CLASS:Button; TEXT:No, gracias.; INSTANCE:3]")
ControlClick("Nero 10 Lite - InstallShield Wizard","","[CLASS:Button; TEXT:&Siguiente; INSTANCE:5]")
_WinWaitActive("Nero 10 Lite - InstallShield Wizard", "&Instalar")
Send("{ENTER}")
; wait for installer process to close
ProcessWaitClose($pid)
Else
; exit with code 1
Exit 1
EndIf

Exit

Func _WinWaitActive($title, $text = "")
; window: wait, activate and then wait until active
WinWait($title, $text)
WinActivate($title, $text)
WinWaitActive($title, $text)
EndFunc

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
  • Recently Browsing   0 members

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