Sign in to follow this  
Followers 0
jcchipper2

Window Detection

8 posts in this topic

#1 ·  Posted (edited)

Hello all I could use a little help on an item I've been trying to get working.

I've been trying to get autoIT to be able to issue commands to an installer for a program so that I can automate the program installation. While it detects the window(s) and even issues the commands....that is as far as it goes. The command never actually hits the intended target. The screen shot/code below should help clear up what I am attempting to do.

Any assistance would be appreciated. While I believe the problem is being caused by the program having two windows I'm not sure. You should see the main window and the target window have the same name....I can use the Win commands to manipulate other type's of windows just this one is giving me a run for my money.

I have verfied that the handle I am calling below is the one I am trying to get....but the commands still fail to hit the box.

CODE
$handle = ControlGetHandle("PureEdge Viewer 6.5 Setup","","")

MsgBox(0,"", $handle)

If WinExists("PureEdge Viewer 6.5 Setup") Then

WinActivate("PureEdge Viewer 6.5 Setup")

AutoItSetOption("WinSearchChildren", 1)

ControlClick ($handle,"","[CLASSNN:Button1]")

MsgBox(0, "", "Window exists")

Else

MsgBox(0, "", "Window Does not exist")

EndIf

The intended button I am trying to hit is Next.

Additonal information:

The outer most window info capture from Window Info:

>>>> Window <<<<

Title: PureEdge Viewer 6.5 Setup

Class: InstallShield_Win

Position: 0, 0

Size: 1280, 1024

Style: 0x94CF0000

ExStyle: 0x00000100

Handle: 0x000D110E

>>>> Control <<<<

Class:

Instance:

ClassnameNN:

ID:

Text:

Position:

Size:

ControlClick Coords:

Style:

ExStyle:

Handle:

>>>> Mouse <<<<

Position: 832, 295

Cursor ID: 13

Color: 0x008080

>>>> StatusBar <<<<

>>>> Visible Text <<<<

PureEdge Viewer 6.5

>>>> Hidden Text <<<<

post-33837-1206492026_thumb.jpg

Edited by jcchipper2

Share this post


Link to post
Share on other sites



If you don't have any need for user input, why don't you do a silent installation? It's using installshield so you should be able to create an answerfile (.iss) using "Setup.exe -r" (or something like that) and then reference it (setup.exe -f1\path\response.iss) in your autoit script. I don't remember the exact syntax but check here for more info. http://www.appdeploy.com/tips/detail.asp?id=18

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

There you go, look at the bottom half of that page for exactly what I am saying. Good find weaponx, I was shooting at the bigger picture (installshield)

Edited by Legacy99

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

If you don't have any need for user input, why don't you do a silent installation? It's using installshield so you should be able to create an answerfile (.iss) using "Setup.exe -r" (or something like that) and then reference it (setup.exe -f1\path\response.iss) in your autoit script. I don't remember the exact syntax but check here for more info. http://www.appdeploy.com/tips/detail.asp?id=18

I have tried the standard switches against the .exe and it doesn't respond to any of them sadly. Always does the same motion. Fires off the .exe in a gui mode and waits for user response. While that is exactly the behavior you would expect when generating a .iss file I cannot locate a .iss file from this program.

At WeaponX

I cannot use that software. Due to policy restriction I have to use this exact piece of software. It isn't always fun to make the archaic software work but in the IT field it is often not a negotiable option either. In this case it isn't negotiable. So I am stuck trying to get this piece of software automated. My last resort will be to install the software one by one on each PC that has to receive it. This also causes greater problems when I "eventually" have to remove this software. Our standard way of deploying software is through SMS. We also generally don't rebuild PC's until they have either hit their life cycle and the user receives a new PC or a problem occurs which requires us to rebuild. All updates are controlled and automated for all software. Repacking this piece of software into a MSI is also not an option at this point due the complexity of performing such a task. (Already made an attempt saw the amount of work that will be required to clean up the package and put in a "useable" state that won’t damage the client machine) Right now doing this form of automation is the quickest and "cleanest" solution if possible at all.

Edited by jcchipper2

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

So you tried "setup.exe -a -r -f1c:\WFsetup.iss" and your .iss file is not located at c: called WFsetup.iss? Then you have a poorly written installer my friend :) ...that is fairly standard. Personally, I would try every means possible to deploy this silent especially when using SMS. Sorry but I don't have any other input to help.

Edit* remember that you have to walk through 1 install to record your responses for the .iss (just in case you didn't know)

Edited by Legacy99

Share this post


Link to post
Share on other sites

So you tried "setup.exe -a -r -f1c:\WFsetup.iss" and your .iss file is not located at c: called WFsetup.iss? Then you have a poorly written installer my friend :) ...that is fairly standard. Personally, I would try every means possible to deploy this silent especially when using SMS. Sorry but I don't have any other input to help.

Edit* remember that you have to walk through 1 install to record your responses for the .iss (just in case you didn't know)

Final results:

I ended up extracting the files contained in the .exe to hit another setup.exe that was inside. Passing the commands against this .exe actually did work and did generate the required files that I needed to execute it in its current state silently...so I am going to go with that. (Not sure why the commands weren't hitting properly to begin with. Not even the -a was helping) While I would still like to at some point get the automation of windows clicking to actually work properly I am going to have to let that one go.(Only for future installers that do not work) Not all battles can produce fruitful results...but at least I got this program to install silently finally! For the most part though any installer that cannot actually run the command lines I generally just repackage into a .msi. (Though that can be a very messy process)

Thx for the reply's

Share this post


Link to post
Share on other sites

Thanks to AutoIt you can use FileInstall(), $CmdLine[], and Run()/RunWait() to make a wrapper for the EXE. This way you can make an EXE that will extract the installer and run it with your own custom options

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