Relevance to find Google Chrome

Hi,

I am trying to write a fixlet that removes Google Chrome. In the relevance for finding Chrome, nothing comes up. Here it is:

exists file whose (name of it as string = “setup.exe”) of folder “C:\Program Files (x86)\Google\Chrome\Application*\Installer” AND exists key whose (value “DisplayName” of it as string contains “Chrome”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry AND exists regapp whose (name of it = “chrome.exe”)

I had to use * in place of the exact version number because I don’t know which versions are out there. I think that is where the relevance is getting hung up. Some computers might have multiple versions of Chrome listed from previous upgrades. How would the relevance handle that?

Thanks

You cannot use wildcards in the application path. You will want to use a regular expression instead to form the string needed for the folder designation.

Look at this analysis which contains some Chrome relevance:

http://bigfix.me/analysis/details/2994622

Also, It seems like you would want OR between each of these, not AND.

This would be the proper way to do your first relevance:

files "setup.exe" of folders "Installer" of folders of folders whose(name of it as lowercase starts with "application") of folders "Google\Chrome" of folders whose(name of it as lowercase starts with "program files") of root folder of drive of system folder

How do you inject the RegEx into the relevance? I’ve got the RegEx.

Would it be practical to try and take the output from that statement and use to populate the path for the uninstall string?

Try the following relevance:

(exists key whose ((value "name" of it as string = "Google %c5%a9%b7%d2" or value "name" of it as string = "Google Chrome")) of keys "HKEY_LOCAL_MACHINE\Software\Google\Update\Clients" of registry) OR (exists key whose ((value "name" of it as string = "Google %c5%a9%b7%d2" or value "name" of it as string = "Google Chrome")) of keys "Software\Google\Update\Clients" of current user keys (logged on users) of registry)

Probably. What does the uninstall command look like?

That works great! Thanks. The computers are showing up now.

This is what I have. I need to figure a way to uninstall any version of Chrome without knowing the version number.

//stop Chrome from running
if {exists running application whose (name of it as lowercase = “chrome.exe”)}
waithidden taskkill /F /T /IM chrome.exe
pause while {exists running application “chrome.exe”}
endif

continue if {not exists running application whose (name of it as lowercase = “chrome.exe”)}

//uninstall Chrome
waithidden “C:\Program Files (x86)\Google\Chrome\Application*\Installer\setup.exe” --uninstall --multi-install --chrome --system-level --force-uninstall

You may try something like this to pick up uninsall string dynamically.

waithidden {value "UninstallString" of keys whose (name of it as string as lowercase contains "google") of key "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of registry}

I’ll try that. Many thanks

That didn’t work. “Relevance Substitution Failed”, according to the logs.

The uninstall string for Chrome doesn’t have the string “google” in it. Try looking for “Google Chrome” in the DisplayName value:

value "UninstallString" of key whose (value "DisplayName" of it as string contains "Google Chrome") of key "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of registry

So you are trying to uninstall all copies of chrome on a system?

That’s right. I am trying to remove all instances of Chrome from a Windows 7 computer.

The command completes successfully, but the task is stuck on “Running”, even though the log says it has finished. Thanks for the help thus far!

Do you know if google chrome was installed via MSI computer wide, or if it was installed per-user?

Do you want to uninstall chrome in both cases?


If it wasn’t installed by MSI, then it would be located here:

Win­dows 7: C:\Users\[you]\AppData\Local\Google\Chrome\Application\


Reference: https://productforums.google.com/forum/#!topic/chrome/vd3-DMq3orQ

This should give all of the Chrome setup files:

pathnames of files "setup.exe" of folders "Installer" of folders of folders whose(name of it as lowercase starts with "application") of folders "Google\Chrome" of ( (folders whose(name of it as lowercase starts with "program files") of root folder of drive of system folder) ; (folders "AppData\Local" of folders of folders "C:\Users") )

Something like this would be the contents of a BAT file that could be created dynamically:

("%22" & it & "%22 --uninstall --multi-install --chrome --force-uninstall") of pathnames of files "setup.exe" of folders "Installer" of folders of folders whose(name of it as lowercase starts with "application") of folders "Google\Chrome" of ( (folders whose(name of it as lowercase starts with "program files") of root folder of drive of system folder) ; (folders "AppData\Local" of folders of folders "C:\Users") )