Tuesday, July 9, 2013

Uninstalling non-admin install of Google Chrome

******************
EDIT:  I've heard that some folks are having issues with this process.  I'm currently working on a PowerShell script to run this as system (ie. from System Center or PSExec -s) which will fix a couple things.

EDIT 2: The new version is here:
http://sccmbrokeit.blogspot.com/2013/09/uninstalling-non-admin-install-of.html
******************

This was a fun one.  If a non-privledged user goes to www.google.com/chrome they can get it installed.  I'm not going to tell you how, but leave it to our usrs to find a way.  BTW, I like Chrome and Google as a whole, but I don't need the headache of supporting custom web applications through yet another browser so it had to go.

Since the user isn't privledged, it can't be installed in Program Files.  So the user's profile is used. 
I tried something fancy like:
 
for /D %%G In (%userprofile%\AppData\Local\Google\Chrome\Application\*Do %%G\Installer\setup.exe --uninstall --multi-install --chrome --verbose-logging --force-uninstall

Yes the double dash is needed for the chrome setup.exe.

But 1) that has to run for each user, and 2) it was unreliable, and 3) I don't like it because a user might leave and never come back and I'm stuck looking at a report with his software one it.  My OCD can't stand that.  So I found a link on Google that has all the registry keys that Chrome installs.  Time to undo those:

Windows Registry Editor Version 5.00
 

[-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\chrome.exe]

[HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications]
"Chrome"=-

[-HKEY_CURRENT_USER\SOFTWARE\Classes\ChromeHTML]

[-HKEY_CURRENT_USER\SOFTWARE\Clients\StartMenuInternet\chrome.exe]

[HKEY_CURRENT_USER\SOFTWARE\RegisteredApplications]
"Chrome"=-

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\Chrome]

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome]

[-HKEY_CURRENT_USER\Software\Google\Update\Clients\{8A69D345-D564-463c-AFF1-A69D9E530F96}]

[-HKEY_CURRENT_USER\Software\Google\Update\ClientState\{8A69D345-D564-463c-AFF1-A69D9E530F96}]
 
[-HKEY_CURRENT_USER\Software\Google\Update\Clients\{00058422-BABE-4310-9B8B-B8DEB5D0B68A}]

[-HKEY_CURRENT_USER\Software\Google\Update\ClientState\{00058422-BABE-4310-9B8B-B8DEB5D0B68A}]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Google\Update\ClientStateMedium\{8A69D345-D564-463c-AFF1-A69D9E530F96}]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Google\Update\Clients\{8A69D345-D564-463c-AFF1-A69D9E530F96}]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Google\Update\ClientState\{8A69D345-D564-463c-AFF1-A69D9E530F96}]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Google\Update\Clients\{8A69D345-D564-463c-AFF1-A69D9E530F96}]
 
Kick it off via a batch file, which can also do some cleanup.
 
@echo off
regedit.exe /s ~dp0RegEntries.reg
IF EXIST "C:\Users\" (
for /D %%G in ("C:\Users\*") do (
rmdir /s /q "%%G\AppData\Local\Google\Chrome"
        del /f /s /q "%%G\Desktop\Google Chrome.lnk")
)
 
Put the batch and .reg file in the same folder, and advertise out the .batch file through SCCM 2012 as a package.
 
--Dave

No comments:

Post a Comment