1 2 Previous Next 18 Replies Latest reply on Jul 7, 2016 10:43 AM by phoffmann

    Google Chrome Uninstallation

    skarnad Apprentice

      Hi,

       

      Can anyone provide me a single script to uninstall any versions of google chrome through LANDesk?

       

      -SK

        • 1. Re: Google Chrome Uninstallation
          Kenyon Expert

          Microsoft Installer: MSI: Packaging Google Chrome for Enterprise deployment

           

          Go to the section called Uninstall Any Previous Version of Chrome:

           

          o Uninstall any previous version of Chrome, I have written this VBScript which can be run before the installation of your MSI.

           

          '==============================================================

          'Lines to get the computer Name

          Const HKEY_LOCAL_MACHINE = &H80000002

          Set wshShell = WScript.CreateObject( "WScript.Shell" )

          strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )

          dim folder, MyProperties, arrMyProperties, Exe, Param, oReg, strKeyPath, strValueName

           

          '==============================================================

          'To check whether the OS is 32 bit or 64 bit of Windows 7

          '==============================================================

          'Lines to detect whether the OS is 32 bit or 64 bit of Windows 7

          Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputerName & "\root\default:StdRegProv")

             strKeyPath = "HARDWARE\DESCRIPTION\System\CentralProcessor\0"

             strValueName = "Identifier"

           

          oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

          '==============================================================

          'Checking Condition whether the build is 64bit or 32 bit

             if (instr(strValue,"64")) then

          folder = "C:\Program Files (x86)\Google\Chrome"

          RegVal = ReadReg ("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome\UninstallString")

          End If

          if (instr(strValue,"x86")) then

          folder = "C:\Program Files\Google\Chrome"

          RegVal = ReadReg ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome\UninstallString")

          End If

          '==============================================================

           

          MyProperties = RegVal

          arrMyProperties = Split(MyProperties, "-")

          Exe = arrMyProperties(0)

          Param = "--uninstall --multi-install --chrome --system-level --force-uninstall"

          'Uninstall Previous version Chrome

          '==============================================================

          wshShell.run Exe & Param, 1, True

          'Delete leftover folder and files from Previous version Chrome

          '==============================================================

          dim filesys

          Set filesys = CreateObject("Scripting.FileSystemObject")

          If filesys.FolderExists(folder & "\") Then 

             filesys.DeleteFolder folder

          End If

          Function ReadReg(RegPath)

                Dim objRegistry, Key

                Set objRegistry = CreateObject("Wscript.shell")

                Key = objRegistry.RegRead(RegPath)

                ReadReg = Key

          End Function

          • 2. Re: Google Chrome Uninstallation
            Kenyon Expert

            This seems to work too;

            wmic product where "name like 'Google Chrome'" call uninstall /nointeractive

            • 3. Re: Google Chrome Uninstallation
              skarnad Apprentice

              Hi Kenyon,

               

              Thanks for the reply.

               

              Just wanted to understand as how can I execute it via landesk?

               

              Due to some application constraint I need to deploy older version of google chrome i.e. 13.3.3802 version but I couldn't install it as all my desktops have latest versions than the mentioned one. So first I need to uninstall all the versions of google chrome which are installed in the desktops and then install it.

               

              if I go with your first option then do I have to execute the 13.3.3804 msi package and under pre-requisite option do I have to enter the vbs script that you have provided above?

               

              Kindly suggest.

               

              -SK

              • 4. Re: Google Chrome Uninstallation
                Kenyon Expert

                I would put everything in a batch file. Call the VBscript first using cscript then call the installer for 13.3.3804. If you want to put everything in the package you will configure it they way you mentioned. With the 13.3.3804 package and the VB script as the pre-req.

                • 5. Re: Google Chrome Uninstallation
                  skarnad Apprentice

                  when I am executing the vbs script its giving me an error Invalid root in registry key.

                  "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome\UninstallString")

                   

                  in line 89 and char: 7.

                   

                  Note:- I have executed the vb script manually just to check if the script is running properly and is uninstalling the chrome, but got the above error.

                  • 6. Re: Google Chrome Uninstallation
                    Kenyon Expert

                    Is the OS you are running the script on 32bit or 64bit?

                    • 7. Re: Google Chrome Uninstallation
                      skarnad Apprentice

                      its 64 bit OS.

                       

                      I am trying to execute it on windows 7 pro 64 bit and windows 8.1 pro 64 bit.

                      • 8. Re: Google Chrome Uninstallation
                        Kenyon Expert

                        The line that errors out is looking for the uninstall entry for Google Chrome. I am guessing the naming has changed from when this article was written. I looked in the registry of one of my machines and it displays as the product ID. You might be better off with the "wmic product where "name like 'Google Chrome'" call uninstall /nointeractive" command as it looks for the name "google Chrome".

                        • 9. Re: Google Chrome Uninstallation
                          skarnad Apprentice

                          I ran the above script but its gave an error google chrome not found, so I checked in add remove program and found the name was chrome. so I changed the above script from google chrome to chrome and executed it.

                          It executed successfully but the software was not uninstalled.:-(

                          • 10. Re: Google Chrome Uninstallation
                            Kenyon Expert

                            Interesting. When I look at the uninstall entry in the registry on my test machine it shows as google chrome. What version of Chrome do you have on your test machine?

                            • 11. Re: Google Chrome Uninstallation
                              skarnad Apprentice

                              13.3.3802

                              • 12. Re: Google Chrome Uninstallation
                                Kenyon Expert

                                I cant find that version to load and test.

                                • 13. Re: Google Chrome Uninstallation
                                  skarnad Apprentice

                                  were you able to uninstall other versions of chrome?

                                  • 14. Re: Google Chrome Uninstallation
                                    Kenyon Expert

                                    Yes. The version I primarily tested is version 50.

                                    1 2 Previous Next