Jump to content
Sign in to follow this  
Jaysen

Working with .NET programs

Recommended Posts

Jaysen

Heya Peeps,

I did a search, but I don't know if I'm blind or if it really wasn't there, forgive me if a similar thread exists. I'm a Computer Tech and the majority of the work I do is removing infections. Over the past year and a half, I have been working on a program to do the following:

- Detect what programs are installed

- Download setup executables for the ones not installed

- Detect and uninstall old versions

- Automatically install the downloaded executables

- Update all programs

- Scans with all programs

with our normal list of programs (Ad-Aware, a-squared, CCleaner, etc...). Some of the programs are written in .NET (Ad-Aware, a-squared, Spyware Terminator) and AutoIT can't detect the buttons in order to use ControlClick(). I was wondering if there was any other way besides using DllCalls and Mouse positions relative to the size of the window to work with .NET programs. I can't possibly be the only one experiencing this can I?

I've already got all the downloads, detect previous versions, scans, and updates coded and working fine in seperate functions. The program is working fine the way it is, I was just looking to see if there was a better way to work with the .NET programs and try and reduce some of the lines of code.

I know there are programs out there, such as Hitman and GeekSquad's L.A.S.E.R., that basically do the same thing... But I'm doing this to work with the programs we use in our shop. That way I can just run my script and tell the customer that their computer is fixed and it'll be an hour and a half, or they need a reload, instead of constantly having to monitor the computer and see if the scan finished in order to start the next one.

Thnx

Jaysen

Share this post


Link to post
Share on other sites
PsaltyDS

I don't know a good way to work with controls that draw their own controls. You can still do some things, like click on controls in Ad-Aware, but you can't read the text in the popups or read the progress bar. This for example clicks on all the controls necessary to do a web update of Ad-Aware SE definitions:

Opt("WinTitleMatchMode", 4)
Opt("TrayIconDebug", 1)

WinWait("[CLASS:TAAWCore; TITLE:Ad-Aware SE Personal]")
$hAdAware = WinGetHandle("[CLASS:TAAWCore; TITLE:Ad-Aware SE Personal]")
WinActivate($hAdAware)
WinWaitActive($hAdAware)
ControlClick($hAdAware, "", "[CLASSNN:TACimage2]") ; Web Update

WinWait("[CLASS:Twebform; Title:Lavasoft Ad-Aware SE]")
$hUpdate = WinGetHandle("[CLASS:Twebform; Title:Lavasoft Ad-Aware SE]")
WinActivate($hUpdate)
WinWaitActive($hUpdate)
ControlClick($hUpdate, "", "[CLASSNN:TACimage3]") ; Connect

WinWait("[CLASS:Tawmessage; Title:Ad-Aware SE]")
$hDownload = WinGetHandle("[CLASS:Tawmessage; Title:Ad-Aware SE]")
WinActivate($hDownload)
WinWaitActive($hDownload)
ControlClick($hDownload, "", "[CLASSNN:TACimage1]") ; OK

Sleep(30000) ; Blind 30sec delay

WinActivate($hUpdate)
WinWaitActive($hUpdate)
ControlClick($hUpdate, "", "[CLASSNN:TACimage3]") ; Finish

The blind 30sec delay is in there because I can get no indication of when the download is complete. You might contact their tech support to see if the full paid-for versions have any command line switches.

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.