bitovi / launchpad

NodeJS Browser Launcher
MIT License
47 stars 28 forks source link

ShowVer.exe does not return browser versions on Windows 10 #110

Closed hellokatili closed 2 years ago

hellokatili commented 5 years ago

The ShowVer.exe does not return any browsers versions on Windows 10. If you add an error logging in the exec callback you can see that the command returns a "Permission denied" error on Windows 10:

https://github.com/bitovi/launchpad/blob/master/lib/local/version.js#L21

  // Run ShowVer.exe and parse out ProductVersion key (Windows)
  if (process.platform === 'win32') {
    var command = path.join('"' + __dirname, '..', '..', 'resources', 'ShowVer.exe" "' + browser.command + '"');
    var deferred = Q.defer();

    debug('Retrieving version for windows executable', command);
    // Can't use Q.nfcall here unfortunately because of non 0 exit code
    exec(command, function(error, stdout) {
      console.log('DEBUG:', error); // <-- Added logging
      var regex = /ProductVersion:\s*(.*)/;
      // ShowVer.exe returns a non zero status code even if it works
      if (typeof stdout === 'string' && regex.test(stdout)) {
        browser.version = stdout.match(regex)[1];
        debug('Found browser version', browser.name, browser.version);
      }

      return deferred.resolve(browser);
    });

    return deferred.promise;
  }

Output:

image

I have set the environment variables LAUNCHPAD_BROWSERS and LAUNCHPAD_FIREFOX, LAUNCHPAD_CHROME, LAUNCHPAD_EDGE.

joao-m-santos commented 4 years ago

I'm having this issue on Windows 7 as well. This is causing problems when using the web-components-tester (https://github.com/Polymer/tools/issues/528) As far as I understand, this happens when you set the environment variables, overriding the default paths.

Does anyone know a way to go around this error?

bmomberger-bitovi commented 2 years ago

Closed via #125