Jump to content

Recommended Posts

Script that I have to install many programs with stops working when launching the second exe, the first exe is fine and will install with no problems, but the second one just opens and does not do anything.

Here is the installation of the both programs.

#RequireAdmin

Run(@ScriptDir & 'COTS01.exe')
AutoItSetOption('MouseCoordMode', 0)

WinWait('Microsoft Visual C++ 2010  x64 Redistributable Setup')
WinActivate('Microsoft Visual C++ 2010  x64 Redistributable Setup')
MouseClick('primary', 54, 185, 1, 0)
MouseClick('primary', 368, 447, 1, 0)
WinWait('Microsoft Visual C++ 2010  x64 Redistributable Setup', 'Installation Is Complete')
MouseClick('primary', 456, 444, 1, 0)


RunWait(@ScriptDir & 'COTS01_2.exe')
AutoItSetOption('MouseCoordMode', 0)

WinWait('Microsoft Visual C++ 2010  x86 Redistributable Setup')
WinActivate('Microsoft Visual C++ 2010  x86 Redistributable Setup')
MouseClick('primary', 53, 185, 1, 0)
Sleep(100)
MouseClick('primary', 366, 446, 1, 0)
WinWait('Microsoft Visual C++ 2010  x86 Redistributable Setup', 'Microsoft Visual C++ 2010  x86 Redistributable has been installed.')
WinActivate('Microsoft Visual C++ 2010  x86 Redistributable Setup', 'Microsoft Visual C++ 2010  x86 Redistributable has been installed.')
MouseClick('primary', 451, 446, 1, 0)

Exit

This all will be a silent install in the end so looking for suggestions for silent installing alot of programs too.

Link to post
Share on other sites
  • Developers

You really don't want to use WinWait() in a silent install process when that can be avoided. Why aren't you using the standard available silent option of the installer?

In case you really need to use WinWait(0 you can check with Opt("TrayIconDebug", 1) ;0=no info, 1=debug line info  and ensure the trayicon is displayed while debugging, to see where the script is "hanging".

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites
17 minutes ago, Jos said:

You really don't want to use WinWait() in a silent install process when that can be avoided. Why aren't you using the standard available silent option of the installer?

In case you really need to use WinWait(0 you can check with Opt("TrayIconDebug", 1) ;0=no info, 1=debug line info  and ensure the trayicon is displayed while debugging, to see where the script is "hanging".

Jos

No I meant it like, right now its visible, I want to see everything work first and then make it a silent install.

Link to post
Share on other sites
  • Developers

... yes ....and how exactly is the an answer om my quoted text ( which is not needed as I know what I wrote ;) ) ?

anyways ...use the opt() to see which line the script is hanging.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

For the first installer you use Run(), so the lines behind can do their work.

 

For the 2nd installer you use RunWait. That means, the script will wait at this point, until the installer has finished.

 

So the lines below *CANNOT* click any dialoges coming up from the 2nd installer!

Doing silent install was mentioned before. There are installers, that need user intervention. For doing so use the Autoit Window Info Tool to get the *CONTROL* of the button to click or to fill information to, instead of clicking certain graphical coordinates.

 

For better readability (?) I'd also like to mention to use an 2D array with "Title | Text | Control-ID | Action | [additional information]"

Then you have all info compact in the array definition and can loop through that one.

 

Rudi

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to post
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...