* @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)
| 336 | * The promise will resolve to {@code null} if Firefox was not found. |
| 337 | */ |
| 338 | function findInProgramFiles(file) { |
| 339 | let files = [ |
| 340 | process.env['PROGRAMFILES'] || 'C:\\Program Files', |
| 341 | process.env['PROGRAMFILES(X86)'] || 'C:\\Program Files (x86)', |
| 342 | ].map((prefix) => path.join(prefix, file)) |
| 343 | return io.exists(files[0]).then(function (exists) { |
| 344 | return exists |
| 345 | ? files[0] |
| 346 | : io.exists(files[1]).then(function (exists) { |
| 347 | return exists ? files[1] : null |
| 348 | }) |
| 349 | }) |
| 350 | } |
| 351 | |
| 352 | /** @enum {string} */ |
| 353 | const ExtensionCommand = { |