The following might work because the registry key that I am referencing is described in official docsfor the Chrome installer. There is one registry key that directly contains the file path chrome.exe, so in my opinion this is the best choice for getting a Chrome application. file name. Here is the key:
<root>\Software\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe
Where <root>is the root directory HKEY_LOCAL_MACHINEor HKEY_CURRENT_USERdepending on whether Chrome is installed for the current user or globally for the entire system.
Chrome. , , Chrome:
[Files]
Source: "chrome_installer.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall
[Run]
Filename: "{tmp}\chrome_installer.exe"; Check: not IsChromeInstalled
Filename: "{code:GetChromeFileName}"; Parameters: "www.stackoverflow.com"; \
Check: IsChromeInstalled
[Code]
const
ChromeAppRegKey = 'Software\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe';
function IsChromeInstalled: Boolean;
begin
{ check if there the Chrome app registration entry under the HKCU, or }
{ HKLM root key, return the result }
Result := RegKeyExists(HKEY_CURRENT_USER, ChromeAppRegKey) or
RegKeyExists(HKEY_LOCAL_MACHINE, ChromeAppRegKey);
end;
function GetChromeFileName(Value: string): string;
var
S: string;
begin
{ initialize returned value to an empty string }
Result := '';
{ first attempt to read the Chrome app file name from the HKCU root key; }
{ if that fails, try to read the same from HKLM; if any of that succeed, }
{ return the obtained registry value }
if RegQueryStringValue(HKEY_CURRENT_USER, ChromeAppRegKey, '', S) or
RegQueryStringValue(HKEY_LOCAL_MACHINE, ChromeAppRegKey, '', S)
then
Result := S;
end;