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?
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.
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
(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)
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”)}
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}
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
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") )