Sign in to follow this  
Followers 0
NICStudent

Windowing Question - Noob Alert!

8 posts in this topic

Greetings!

I am trying to run my autoit v3 script to simply run a setup.exe. I am trying to have Autoit detect each setup window and answer the installer screen questions so I can have the local system account run setup unattended with SMS.

The exe I created runs great if I launch it, all the windows are handled correctly. If I send the exe to be run unattended, the initial window refuses to be recognized by AutoIt. When I log into the pc, the install is suspended at that first screen which has a title of "FSP Install" and the body of the box says "Install?" I see that the AutoIt system tray app says it is paused. If I click OK then the entire remaining script runs correctly unattended.

Script is attached as a jpg, please limit your laughs to just a few belly laughs at my noobish code. Note that my first window detection is intended to catch an untitled window since I didn't know what else to try to encourage AutoIt to detect that first window.

Cheers,

Scott

Share this post


Link to post
Share on other sites



alot of ur sendtabs could be done with Controlclicks :think:

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I can't be certain, but your initial WinWait('') isn't finding the right window because it's like saying "Wait for the currently active window to exist", and with the computer just starting up (still sluggish), your Run() command is completing, 5 seconds pass with Sleep(5000), and then your script just selects whatever window is active, not necessarily the one you want. In other words, "setup.exe" hasn't displayed it's first window by the time you select the currently active window with WinWait(''). Try this:

Run("setup.exe")
WinWait("PUT TITLE OF FIRST WINDOW HERE")
...

This also explains why the script hangs until you click on it. Because your next WinWaitActive() waits for the window you click on to be active, which is in turn activated by you clicking on it, and the rest of the setup continues just fine. Wow, that was wordy, but I hope it was helpful.

Edit: Bolded text added.

Edited by neogia

[u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia

Share this post


Link to post
Share on other sites

......so I can have the local system account run setup unattended with SMS.

The exe I created runs great if I launch it, all the windows are handled correctly...

Is SMS allowed to interact with the desktop as the user?

In other words, the Win... functions will not work on a locked system.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Is SMS allowed to interact with the desktop as the user?

In other words, the Win... functions will not work on a locked system.

Yes, SMS can be configured to allow the user (in this case the local system) to interact with the install. I'll try your steps tomorrow, thanks for the advice so far.

Share this post


Link to post
Share on other sites

Yes, SMS can be configured to...

I should have asked, "Was SMS allowed to...". I knew that it can be setup to interact... but from your great original post in this thread, you mention two critical things:

1) that the script works for you

2) but not for SMS (hung on the first window).

That is a classic symptom of not being able to "interact"....

...but that is not why I posted again - I could not locate the thread that I wanted to reference, it seems like there was a post about a tool (not SMS) that will work with AutoIt's Win... functions while the system is locked... maybe I dreamed it. Maybe someone else can find it for you.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Do you not think it's possible that WinWait('') is just capturing, say, the desktop, and pressing {ENTER}? Cause if that's the case, it won't ever fulfill the next WinWaitActive().

Yes, that could happen. The sleep may not be enough for all systems at all times. However, unless SMS is set to allow "interaction with the desktop", having a better WinWait line is not going to help...

It has been too long since I've used SMS, perhaps others could chime in.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


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
Sign in to follow this  
Followers 0