Ugh! Gosubs?? ;\)

The simplest answer would be to write and debug a new script that does what you want using a seriese of functions.. Then, when you are sure that it works, you can add it to the ":Updates" section of your script.

Here's the basic idea:
 Code:
============================================================
== Updates
============================================================
:Updates
WriteDebugLog( "Started subroutine 'Updates'" )

IF READPROFILESTRING( "$ScriptDir\custom\Servers.ini" , "ServerRoutines" , "Updates" ) <> "YES" AND $SkipServer = 1
	RETURN
ENDIF

IF $SkipServer <> 1
	INSTALLPATCH( "ALL" )
	INSTALLPATCH( $IEVersion )
ENDIF

INSTALLPATCH( @PRODUCTTYPE )

If Not CheckSoftware('name') InstallSoftware('name') EndIf
If Not CheckMcAfee() UpdateMcAfee() EndIf

RETURN
Note the two lines added just before the RETURN. You will need to write 4 UDFs -
CheckSoftware('name') - reads an INI file, checks the section 'NAME' for imformation on how to verify the software is present (Reg Path check?) It returns True if present and False (0) if not.
InstallSoftware('Name') - uses the same ini file to determine how to install the software package.
CheckMcAfee() - and UpdateMcAfee() - checks the current DAT version and forces an update if necessary.

Note that there are several UDFs available to check for AV info, including a universal UDF that checks for several different products that Doc and I worked on. That UDF uses an external config file to manage the definitions so you don't need to update the code.

One thing - this whole script and concept of a user updating their own software may not work with the enhanced security of Vista, Win-7 and higher systems. We employ a "Detect and Request" method at our client sites so the user can detect if something is needed and then sends a request to a server where the task is immediately performed with Admin rights. Since the install is a separate process, the user login is not delayed, the user account is never granted admin rights, and the user has no access to an admin level account. This has been discussed here before with code samples if you want to give that a try.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D