Need Help Running McAfee Uninstall

(imported topic written by Boz91)

Hello all, I am very new to the BigFix custom fixlet game and I am looking for some help creating a custom fixlet to uninstall the McAfee client. I have a lot of servers that failed a new McAfee update that I created under the Software Distribution Wizard. I investigated and found that all those servers that failed have the McAfee folders but the critical folders are empty, no files in them. I need to run an uninstall of the client and this is what I have:

%ProgramFiles%\McAfee\Common Framework\FrmInst.exe /forceuninstall

%ProgramFiles(x86)%\McAfee\Common Framework\FrmInst.exe /forceuninstall

How should the custom fixlet look to perform this simple task?

Thanks for your help!

(imported comment written by SystemAdmin)

Hi Boz,

Here’s a sample you can modify to your own needs. This should get you started.

My example targets PCs (other than Windows 2000) using the ePO framework (v4.0 to v4.5) where it isn’t running.

This is an older task, which is why I have the “dos” command there. I think that’s a little frowned upon now.

-Paul

Relevance:

((it starts with “Win” and it != “Win2000”) of name of operating system) AND (if exists service “McAfeeFramework” then (version of it >= “4.0.0.0” and version of it < version “4.6.0.0”) of file ((if exists substring between “%22” of it then substring between “%22” of it else it) of (preceding text of last " " of image path of service “McAfeeFramework”)) AND (State of service “McAfeeFramework” != “Running”) else false)

Action:

// Locate where the CMA is installed
parameter “CMAdir” = “{value “Installed Path” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\ePolicy Orchestrator\Agent” of registry as string}”

// Remove ePO agent
wait {parameter “CMAdir”}\frminst.exe /remove=agent /s

// Uninstall McAfee VirusScan
if {exists key whose (value “DisplayName” of it as string contains “McAfee VirusScan Enterprise”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry}
wait {pathname of system folder}\msiexec.exe /X {name of key whose (value “DisplayName” of it as string contains “McAfee VirusScan Enterprise”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry} /qn
endif

// Remove the framepackage if it’s still there after removing VirusScan
if {exists file (parameter “CMAdir” as string & “\frminst.exe”)}
wait {parameter “CMAdir”}\frminst.exe /forceuninstall /s
endif

// Cleanup leftover folders – Rename them first, then remove.
if {exists folder “C:\Program Files\Network Associates\VirusScan Enterprise”}
dos ren “C:\Program Files\Network Associates\VirusScan Enterprise” "C:\Program Files\Network Associates\VirusScan Enterprise-remove"
dos rmdir /Q /S "C:\Program Files\Network Associates\VirusScan Enterprise-remove"
endif

if {exists folder “C:\Program Files\McAfee\VirusScan Enterprise”}
dos ren “C:\Program Files\McAfee\VirusScan Enterprise” "C:\Program Files\McAfee\VirusScan Enterprise-remove"
dos rmdir /Q /S "C:\Program Files\McAfee\VirusScan Enterprise-remove"
endif

if {exists folder “C:\Program Files\Network Associates\Common Framework”}
dos ren “C:\Program Files\Network Associates\Common Framework” "C:\Program Files\Network Associates\Common Framework-remove"
dos rmdir /Q /S "C:\Program Files\Network Associates\Common Framework-remove"
endif

if {exists folder “C:\Program Files\McAfee\Common Framework”}
dos ren “C:\Program Files\McAfee\Common Framework” "C:\Program Files\McAfee\Common Framework-remove"
dos rmdir /Q /S "C:\Program Files\McAfee\Common Framework-remove"
endif

if {exists folder “C:\Documents and Settings\All Users\Application Data\Network Associates\Common Framework”}
dos ren “C:\Documents and Settings\All Users\Application Data\Network Associates\Common Framework” "C:\Documents and Settings\All Users\Application Data\Network Associates\Common Framework-remove"
dos rmdir /Q /S "C:\Documents and Settings\All Users\Application Data\Network Associates\Common Framework-remove"
endif

if {exists folder “C:\Documents and Settings\All Users\Application Data\McAfee\Common Framework”}
dos ren “C:\Documents and Settings\All Users\Application Data\McAfee\Common Framework” "C:\Documents and Settings\All Users\Application Data\McAfee\Common Framework-remove"
dos rmdir /Q /S "C:\Documents and Settings\All Users\Application Data\McAfee\Common Framework-remove"
endif

if {exists folder “C:\ProgramData\McAfee\Common Framework”}
dos ren “C:\ProgramData\McAfee\Common Framework” "C:\ProgramData\McAfee\Common Framework-remove"
dos rmdir /Q /S "C:\ProgramData\McAfee\Common Framework-remove"
endif

// Remove any leftover registry settings
delete __appendfile
appendfile REGEDIT4
appendfile {if (exists key “HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates” of registry) then ("-HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates") else “”}
appendfile {if (exists key “HKEY_LOCAL_MACHINE\SOFTWARE\McAfee” of registry) then ("-HKEY_LOCAL_MACHINE\SOFTWARE\McAfee") else “”}
copy __appendfile remove_mcafee.reg
wait regedit -s remove_mcafee.reg
delete remove_mcafee.reg