Jump to content

MSI Installs with Modal Dialog Boxes not "letting go" correctly


Aaron Danbury
 Share

Recommended Posts

I apologize for the lengthiness of this my post, but I want to make sure that I get as much information in here as possible regarding my scenario.

My problem is to do with a valid way to detect once a Modal Dialog has "completed" in an MSI Install.

My scenario is using the AutoITX3 released with AutoIt v3.2.0.1 linked into C#.

I tried detecting when the Modal Window was no loger active using WinWaitNotActive(). That returned with a "good" value. I also tried to check to see when the Modal Window was no longer existant by using WinWaitClose(). That returned a "good" value. I then verified that the next window I was looking for Existed using WinExists(). That returned with a "good" value as well. Then I verified that the control I needed to interact with ( a Next Button ) was now enabled after clicking Yes on the Modal Dialog. I used the ControlCommand() with "IsEnabled", and "" for the option field. This also returned with a "good" value. I then used ControlFocus() and was able to get Focus on the Next Button control. Whenever I use ControlClick() it also indicates that everything went all right for the Next Button click.

After all of these "good" return values I end up seeing the Window that I was trying to click the Next Button on, and it never does what it indicates that it was supposed to do. It almost appears as if the Modal Window is somehow not done eventhough all of the indicators that I have checked say I should be able to click the Next Button.

I CAN get this to work by adding in a Sleep() into the code after clicking the Yes Button on the Modal Dialog. That's a nice workaround, but I want to be able to detect something that tells me when to Clikc the Next Button AFTER the Modal Window is gone. I don't want to do fixed Sleep() amounts because it skews the timing results of the install that I need to keep track of. The time amounts are also unknown since some machines may be able to react faster than others.

Is there something that I can do, that I haven't already done, to detect what's going on in a more event driven fashion?

Link to comment
Share on other sites

You check that Next is enabled, what kind of debugging are you using to see these are "good" values?

I check each return value. The ControlCommand() has to be converted from a String to an int for the "IsEnabled" check, but other than that it's basically checking the return value on each operation for what the help indicates is a "good" value. Usually it appears to be 1 for "good", and 0 for "bad".

Link to comment
Share on other sites

False is zero, true is non-zero. I'm not sure why when it is enabled that it wouldn't work. Sorry I can't be more help then.

Thanks for your help anyway. Since I could find any other user having this problem readily in the forums, I was afraid that this would be something puzzling. If I can figure out was is going on, and how to "fix" it, I'll post a reply to this forum.

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