in Uncategorized

NSIS: How to check if the default browser is Chrome

Reading the registry key won’t cut it. This does.

; isDefaultBrowserChrome
!define isDefaultBrowserChrome "!insertmacro isDefaultBrowserChrome"

!macro isDefaultBrowserChrome Result

FileOpen $0 "$PLUGINSDIR\browser_detect.htm" "w"
FileClose $0
System::Call "Shell32::FindExecutable(t ‘$PLUGINSDIR\browser_detect.htm’, i 0, t .r1)"
${StrLoc} $0 $1 "chrome.exe" ">"
${If} $0 != ""
StrCpy ${Result} "1"
StrCpy ${Result} "0"


Write a Comment


This site uses Akismet to reduce spam. Learn how your comment data is processed.