* @param {string} file Path to the file to find, relative to the program files * root. * @return {!Promise<?string>} A promise for the located executable. * The promise will resolve to null if Firefox was not found.
(file)
| 431 | * The promise will resolve to {@code null} if Firefox was not found. |
| 432 | */ |
| 433 | function findInProgramFiles(file) { |
| 434 | let files = [ |
| 435 | process.env['PROGRAMFILES'] || 'C:\\Program Files', |
| 436 | process.env['PROGRAMFILES(X86)'] || 'C:\\Program Files (x86)', |
| 437 | ].map((prefix) => path.join(prefix, file)) |
| 438 | return io.exists(files[0]).then(function (exists) { |
| 439 | return exists |
| 440 | ? files[0] |
| 441 | : io.exists(files[1]).then(function (exists) { |
| 442 | return exists ? files[1] : null |
| 443 | }) |
| 444 | }) |
| 445 | } |
| 446 | |
| 447 | /** @enum {string} */ |
| 448 | const ExtensionCommand = { |