Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve detection of Chrome channel variants #61

Merged
merged 4 commits into from
Nov 22, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/browsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ exports.chrome = {
find: function () {
// Joined with filename (or [browser name].exe)
this.dir('LOCALAPPDATA', 'Google\\Chrome\\Application')

this.dir('LOCALAPPDATA', 'Google\\Chrome Beta\\Application')
this.dir('LOCALAPPDATA', 'Google\\Chrome Dev\\Application')
// Chrome Canary
this.dir('LOCALAPPDATA', 'Google\\Chrome SxS\\Application')

// programFiles() is a shortcut to dir() that checks both
// "Program Files" and "Program Files (x86)" if on 64-bit Windows
this.programFiles('Google\\Chrome\\Application')
this.programFiles('Google\\Chrome Beta\\Application')
this.programFiles('Google\\Chrome Dev\\Application')
this.programFiles('Google\\Chrome SxS\\Application')
vweevers marked this conversation as resolved.
Show resolved Hide resolved

// Expanded to HKEY_LOCAL_MACHINE\Software, HKEY_CURRENT_USER\Software
// and if on a x64 machine, their 32-bit (Software\WoW6432) counterparts.
Expand Down
11 changes: 9 additions & 2 deletions lib/chrome/find-progids.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ function queryHive (self, hive, done) {
if (err) return next(err.notFound ? null : err)

const metadata = {
channel: id === 'ChromeHTML' ? 'stable' : 'canary'
channel: id.startsWith('ChromeSSHTM.') ? 'canary' : {
'ChromeHTML': null, // In some cases this can be ambiguous
'ChromeBHTML': 'beta',
'ChromeDHTML': 'dev'
}[id]
vweevers marked this conversation as resolved.
Show resolved Hide resolved
}

self.found(extractPath(bin), metadata, key, next)
Expand All @@ -39,5 +43,8 @@ function queryHive (self, hive, done) {
}

function isChromeHTML (id) {
return id === 'ChromeHTML' || id.slice(0, 12) === 'ChromeSSHTM.'
return id === 'ChromeHTML' ||
id === 'ChromeBHTML' ||
id === 'ChromeDHTML' ||
id.slice(0, 12) === 'ChromeSSHTM.'
}
5 changes: 4 additions & 1 deletion lib/chrome/find-update-clients.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ const { basename, resolve, dirname } = require('path')
const registry = require('../registry')

const GUIDS = [
'401C381F-E0DE-4B85-8BD8-3F3F14FBDA57', // dev
'8237E44A-0054-442C-B6B6-EA0509993955', // beta
'8A69D345-D564-463C-AFF1-A69D9E530F96', // 32
'4DC8B4CA-1BDA-483E-B5FA-D3C12E15B62D', // 64
'4EA16AC7-FD5A-47C3-875B-DBF4A2008C20' // canary
]

const CHANNELS = [
'stable',
'canary',
'beta',
'dev'
Expand Down Expand Up @@ -91,5 +94,5 @@ function getReleaseChannel (ap) {
if (ap.has(channel)) return channel
}

return 'stable'
return null
vweevers marked this conversation as resolved.
Show resolved Hide resolved
}