Skip to content

Commit

Permalink
feat: add process.env.ProgramW6432 as root location for binaries
Browse files Browse the repository at this point in the history
On Windows systems, depending on the installed software (32 bit or 64 bit), querying process.env.PROGRAMFILES might yield 'C:\Program Files (x86)' even on a 64 bit system. That is why process.env.ProgramW6432 needs to be added as a root location, which holds 'C:\Program Files'.
  • Loading branch information
sbley authored and pmvald committed Apr 20, 2023
1 parent d193ef3 commit 12a73db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function getChromeExe (chromeDirName) {
}
var windowsChromeDirectory, i, prefix
var suffix = '\\Google\\' + chromeDirName + '\\Application\\chrome.exe'
var prefixes = [process.env.LOCALAPPDATA, process.env.PROGRAMFILES, process.env['PROGRAMFILES(X86)']]
var prefixes = [process.env.LOCALAPPDATA, process.env.PROGRAMFILES, process.env['PROGRAMFILES(X86)'], process.env.ProgramW6432]

for (i = 0; i < prefixes.length; i++) {
prefix = prefixes[i]
Expand Down Expand Up @@ -108,7 +108,7 @@ function getChromiumExe (chromeDirName) {
}
var windowsChromiumDirectory, i, prefix
var suffix = '\\Chromium\\Application\\chrome.exe'
var prefixes = [process.env.LOCALAPPDATA, process.env.PROGRAMFILES, process.env['PROGRAMFILES(X86)']]
var prefixes = [process.env.LOCALAPPDATA, process.env.PROGRAMFILES, process.env['PROGRAMFILES(X86)'], process.env.ProgramW6432]

for (i = 0; i < prefixes.length; i++) {
prefix = prefixes[i]
Expand Down

0 comments on commit 12a73db

Please sign in to comment.