5

I am developing an installer using Inno Setup and I need to find whether Google Chrome is installed in the machine.

I have found answers that say that I can check at the following path in the registry,

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome

But this didn't solve my problem. I don't have this path in my registry.

Can anyone help me?

poortip
  • 145
  • 1
  • 2
  • 10

3 Answers3

6

This will help:

(Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe').'(Default)').VersionInfo
kgangadhar
  • 4,886
  • 5
  • 36
  • 54
Walt
  • 61
  • 1
  • 2
0

I Know this is an old thread, however, building off of Walt's answer here is the full solution that I came up with:

$chromeInstalled = (Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe').'(Default)').VersionInfo

if ($chromeInstalled.FileName -eq $null) {
Write-Host "Chrome is not installed"}
else {
Write-Host "chrome is installed"
}
Chris
  • 1
  • 4
  • 1
    Yes, You use the boolean value from previous answer.. How is this answer different from previous answer? – Akin Okegbile Jun 30 '20 at 14:50
  • The only thing different is that the initial one was giving a starting point. What I ended up doing was expanding the answer to give a solution to what the original question was asking. – Chris Jun 30 '20 at 14:52
  • 1
    yea, write-host is not part of the question.. It's just a write out for you and your use case.. Your answer isn't different from the previous answer. – Akin Okegbile Jun 30 '20 at 14:59
0

I found a way easier way to do this.

$chrometest = Test-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe'

if($chrometest -eq $true){
   Write-Host "Chrome is installed"
}else{
   Write-Host "Chrome is not installed"
}
ndubs
  • 1
  • 1