Jump to content

AutoIt Error


Recommended Posts

Hi,

Since yesterday I try installing with the here bellow script, the Vista Codecs Package prog.

It well installed but at the end i get AutoIt Error message (see bellow)

post-5679-12720231251924_thumb.jpg

AutoIt Error
Line 36  (File "C:\Test\Vista Codec\VistaCodecs_Install.exe"):
Error: Illegal text at the end of statement (one statement per line)

In fact, I don't silent install the prog by a swiychless (prog.msi/qb) to prevent the Bing Toolbar (ad) installation.

Here my script

AdlibRegister("_Adlib")

Opt('TrayIconDebug', 1)

$title = "Vista Codec Package - VistaCodecs Installer"
;Run("msistub.exe VistaCodecs_v568.msi")
ShellExecute("VistaCodecs_v568.msi")

;Welcome
WinWaitActive($title, "Welcome")
Sleep(2000)
ControlClick($title, "Welcome", "Button1")

;License Agreement
WinWaitActive($title, "License Agreement")
Sleep(500)
ControlClick($title, "License Agreement", "Button3"); I accept
Sleep(500)
ControlClick($title, "License Agreement", "Button5"); Next

;Destination Folder
WinWaitActive($title, "Destination Folder")
Sleep(500)
ControlClick($title, "Destination Folder", "Button1"); Next

;Installing the Bing Toolbar
WinWaitActive($title, "Installing the Bing Toolbar")
Sleep(500)
ControlClick($title, "Installing the Bing Toolbar", "Button4"); Uncheck
Sleep(500)
ControlClick($title, "Installing the Bing Toolbar", "Button1"); Next

;Setup Type
WinWaitActive($title, "Setup Type")
Sleep(500)
ControlClick($title, "Setup Type", "Button5"); Complete and Next

;Install
WinWaitActive($title, "Ready to Install")
Sleep(500)
ControlClick($title, "Ready to Install", "Button1")

;Finish
WinWaitActive($title, "The InstallShield")
Sleep(2000)
ControlClick($title, "The InstallShield", "Button1")

Sleep(3000)
;Process Close
ProcessWait("iexplore.exe", 50)
Sleep(500)
    For $i = 1 To 10 Step 1
  If ProcessExists("iexplore.exe") Then
   ProcessClose("iexplore.exe")
   Sleep(500))
  Else
   ExitLoop
  EndIf
Next

Func _Adlib()
  If WinExists("AutoIt Error", "")  Or @error Then
  ControlClick("AutoIt Error", "", "Button1") ;OK
  AdlibUnRegister("_Adlib")
  EndIf
EndFunc

I'll appreciate any help to get ride from that error

Regards

Edited by coucou
Link to comment
Share on other sites

You have one closing parenthesis too many with Sleep.

You are right. Especially with this prog.

I noticed when NO Sleep, the script go much fast than the windows prog (the ControlClick miss its WinWaitActive).

Regards

Link to comment
Share on other sites

  • Moderators

coucou,

trancexx has given you the answer. In line 55 of your script you have:

Sleep(500))

where you should have:

Sleep(500)

Before you ask, the reason the error is listed as line 36 in the dialog is because all comments and blank lines are stripped when you compile. Count through the script and you will find that the line in question is the 36th statement line. :idea:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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...