Sign in to follow this  
Followers 0
bhunji

updating McAfee v8

11 posts in this topic

#1 ·  Posted (edited)

Hi,

I'm new to AutoIt and am trying to automate the process of updating McAfee for users as a login script.

Here is my script so far:

SplashTextOn ( 'AutoIt', 'Please do not touch the keyboard or mouse until the updates have finished.', 300, 100 )
Sleep ( 2000 )

Run ( 'C:\Progra~1\Networ~1\VirusScan\mcconsol.exe' )

WinWaitActive ( 'VirusScan Console' )

ControlSend("VirusScan Console", "", 3, "{Down 2}a{ENTER}")

Sleep ( 1000 )

ControlSend("VirusScan AutoUpdate Properties - AutoUpdate", "Update &Now", 4, "n")

Sleep ( 5000 )

WinClose ( 'VirusScan AutoUpdate Properties - AutoUpdate' )

WinClose ( 'VirusScan Console' )

When mcconsol.exe loads, It has two options that start with the letter a;

Access Protection and AutoUpdate

I'm currently using this line

ControlSend("VirusScan Console", "", 3, "{Down 2}a{ENTER}")

to select AutoUpdate from that screen.

Is there a better way to select 'AutoUpdate' from the menu? It doesn't seem to have any IDs or unique Identifiers when I run the Au3Info.exe.

Edited by bhunji

Share this post


Link to post
Share on other sites



What type of control are you dealing with?

All we have to go on is Control #3...

I'm currently using this line

ControlSend("VirusScan Console", "", 3, "{Down 2}a{ENTER}")

to select AutoUpdate from that screen.

Is Control #3 a listbox/combo box?

If so, you can use the ControlCommand...SetCurrentSelection / SelectString commands.

Is there a better way to select 'AutoUpdate' from the menu? It doesn't seem to have any IDs or unique Identifiers when I run the Au3Info.exe.

If it's a menu, you can use WinMenuSelectItem().

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites

One thing I always do before i make AutoIt click buttons and select stuff, is I look into the help file and search for "commandline" or "command line". I am pretty sure that McAfee 8 has a way to update the virus definitions by using a command line switch or a dll call.

If you can't find anything in the help file, just write a small note (i mean email^^) to McAfee saying that you want to automate the updating in your company by using a script. Ask em whether there's a command line switch or a dll call...

That way is much more reliable and faster.

I would also help you with the way ur doing it right now, but i don't have McAfee8, sorry!

Felix N. (tdlrali)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I tried using the command line option 'mcupdate.exe', Unfortunately running it as a user doesn't work properly, but going through the gui as a user calls the mcupdate.exe as the system account and updates the dat files properly.

Here's the info I get from Au3Info:

Press CTRL-ALT-F to pause the display.

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: VirusScan Console

Class: NaiConsoleMainWindow

Size: X: 457 Y: 524 W: 600 H: 280

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Window: X: 181 Y: 154

Cursor ID: 2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xFFFFFF Dec: 16777215

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size: X: 0 Y: 28 W: 592 H: 186

Control ID: 3

ClassNameNN: SysListView321

Text:

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<

(1): VirusScan Console

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

VirusScan Console

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<

I think this is a Combo or List box...

Edited by bhunji

Share this post


Link to post
Share on other sites

How do I get the currentselection or string info?

I tried these

ControlCommand ("VirusScan Console", "", 3, "GetCurrentSelection", "")

$selection = ControlCommand ("VirusScan Console", "", 3, "GetCurrentSelection", "Access Protection")

MsgBox (0, "Access", $selection , 5000 )

$selection2 = ControlCommand ("VirusScan Console", "", 3, "FindString", "AutoUpdate")

MsgBox (0, "AutoUp", $selection2 , 5000 )

but both just spit back a number 1 in the MsgBox...

Share this post


Link to post
Share on other sites

Now that we've established that it's a ListBox, this will be much easier.

It is much more reliable and clear to refer to the control as "SysListView321" rather than #3.

How do I get the currentselection or string info?

Try this:

Local $WinTitle = "VirusScan Console"
  Local $SelectedIndex = ControlListView($WinTitle, "", "SysListView321", "GetSelected")
  Local $SelectedText = ControlListView($WinTitle, "", "SysListView321", "GetText", $SelectedIndex)
  Msgbox(0, "Selected", $SelectedText)

To select "AutoUpdate", try this:

Local $TargetItem = ControlListView($WinTitle, "", "SysListView321", "FindItem", "AutoUpdate")
ControlListView($WinTitle, "", "SysListView321", "Select", $TargetItem)

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites

Okay, that highlights the option but doesn't run it.

So I figured adding a simple "Send ('ENTER')" would work, but it opens Access Protection instead. I think it's because it is the first thing in the list...

Here is the updated script I have:

Local $WinTitle = "VirusScan Console"

;SplashTextOn ( 'AutoIt', 'Please do not touch the keyboard or mouse until the updates have finished.', 300, 100 )

Sleep ( 2000 )

Run ( 'C:\Progra~1\Networ~1\VirusScan\mcconsol.exe' )

WinWaitActive ( $WinTitle )

Local $TargetItem = ControlListView($WinTitle, "", "SysListView321", "FindItem", "AutoUpdate")
ControlListView($WinTitle, "", "SysListView321", "Select", $TargetItem)

  Local $SelectedIndex = ControlListView($WinTitle, "", "SysListView321", "GetSelected")
  Local $SelectedText = ControlListView($WinTitle, "", "SysListView321", "GetText", $SelectedIndex)
  Msgbox(0, "Selected", $SelectedText)

Send ( '{ENTER}' )

;ControlSend( $WinTitle, $TargetItem, "", "{ENTER}")

Sleep ( 1000 )

ControlSend("VirusScan AutoUpdate Properties - AutoUpdate", "Update &Now", "Button2", "n")

Sleep ( 5000 )

WinClose ( 'VirusScan AutoUpdate Properties - AutoUpdate' )

WinClose ( 'VirusScan Console' )

The Msgbox displays that AutoUpdate is selected, and it is highlighted in the window...

I tried doing a ControlSend to, but I'm not sure I have the syntax correct...

How do i get it to open the selection now?

Share this post


Link to post
Share on other sites

ControlSend("VirusScan AutoUpdate Properties - AutoUpdate", "Update &Now", "Button2", "n")

I tried doing a ControlSend to, but I'm not sure I have the syntax correct...

How do i get it to open the selection now?

Sending "N" won't do it.

Alt+N might, but it's more reliable to click the button instead.

(Sometimes windows have multiple controls that respond to Alt+N)

Try this...

ControlClick("VirusScan AutoUpdate Properties - AutoUpdate", "Update &Now", "Button2")

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites

bhunji,

I do not think that updating the anti-virus-software via a 'proces' of sending 'keystrokes' on a end-user workstation is safe at all!

Why not just download the latest updater from NAI and run it (forced) upon logon of the user??

Here is some info to get you started:

- versionnumber and filename of latest virusdef-file can be found in http://download.nai.com/products/datfiles/4.x/nai/update.ini

- download location of the actual updater is http://speedownload.nai.com/products/licen.../english/intel/[name of updater]

Another tip, lock the virusscan console for end-user, way to dangerous!

I hope this helps.

Arno Rog

Share this post


Link to post
Share on other sites

@awrog - I tried running the sdats at login a few months ago, If I remember right the problem I had was either it tried to run the sdat with the user's account (they don't have permission to install things) or it was that our repository servers didn't provide the files I needed like the update.ini to script it. I would like to use our internal servers if possible for downloading the dats, since the group in charge of them supposedly tests the dats in our environment for a day or two before making it available to the rest of us.

@Skruge - Actually the problem I'm having is before that line, when it selects 'AutoUpdate' it doesn't open the next window, it just highlights the word in the list. How do I get it to click, or open the AutoUpdate page once it has been selected?

Neither of these seem to work...

Send ( '{ENTER}' )

;ControlSend( $WinTitle, $TargetItem, "", "{ENTER}")

I will switch the line you suggested though, since you said its more reliable to click the button then press a keystroke.

Share this post


Link to post
Share on other sites

I just noticed that when it selects AutoUpdate from the list it leaves a dotted box around Access Protection.

Is there a way to move the dotted box to AutoUpdate?

Is it a hidden control?

If I tell it to do a keypress of either down or up it moves the dotted box too.

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