Giter Site home page Giter Site logo

Comments (6)

jryans avatar jryans commented on September 17, 2024

I think it's unlikely that we'd bundle random EXEs with the addon. As I user, I certainly would not want a Simulator installing strange EXEs in my Windows folder.

If that's what is needed for Windows XP Home to work, I think we just won't be able to support it at this time.

Out of curiosity, does the same issue happen with the newest simulators, like 1.5?

from r2d2b2g.

Loirooriol avatar Loirooriol commented on September 17, 2024

Oh, I didn't meant Simulator should install it in Windows folder, but that it could include it (in Simulator folder) and run this one if necessary.

If not, I think that Simulator should handle this case properly.

In [email protected]\resources\r2d2b2g\lib\adb.js (line 240):

if (platform === "WINNT") {
  ps = "C:\\windows\\system32\\tasklist.exe";
  args = [];
} else {
  args = ["aux"];
  let psCommand = "ps";

  let paths = env.PATH.split(':');
  let len = paths.length;
  for (let i = 0; i < len; i++) {
    let fullyQualified = file.join(paths[i], psCommand);
    if (file.exists(fullyQualified)) {
      ps = fullyQualified;
      break;
    }
  }
  if (!ps) {
    debug("Error: a task list executable not found on filesystem");
    deferred.resolve(false); // default to restart adb
    return deferred.promise;
  }
}

In case of Windows XP Home, I think the following code should run:

    debug("Error: a task list executable not found on filesystem");
    deferred.resolve(false); // default to restart adb
    return deferred.promise;

But instead, since it's windows, it assumes that C:\windows\system32\tasklist.exe does exist.

from r2d2b2g.

jryans avatar jryans commented on September 17, 2024

Ah, okay. This is part of the older Firefox OS 1.1 Simulator that is no longer maintained.

The 1.2+ simulators do not contain the above file because all ADB stuff is handled separately. The newer addons are used via the App Manager.

With the App Manager, you can run ADB manually or use the ADB helper addon to do this for you. It looks like the ADB helper has the same flaw you've found here though.

We also have a more experimental ADB addon which does not appear to use tasklist which might work for you, but again this is only meant for use with the App Manager and FxOS 1.2+.

I have filed a bug about the ADB helper on this issue.

from r2d2b2g.

AprilMorone avatar AprilMorone commented on September 17, 2024

Not sure as I have temporarily had to step away from testing the Firefox
OS. But, I soon will check on that later this week, if possible.
On May 6, 2014 2:48 PM, "J. Ryan Stinnett" [email protected] wrote:

I think it's unlikely that we'd bundle random EXEs with the addon. As I
user, I certainly would not want a Simulator installing strange EXEs in my
Windows folder.

If that's what is needed for Windows XP Home to work, I think we just
won't be able to support it at this time.

Out of curiosity, does the same issue happen with the newest simulatorshttps://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/,
like 1.5?


Reply to this email directly or view it on GitHubhttps://github.com//issues/892#issuecomment-42342871
.

from r2d2b2g.

AprilMorone avatar AprilMorone commented on September 17, 2024

Thank you for having filed a bug on this issue.
On May 6, 2014 6:28 PM, "J. Ryan Stinnett" [email protected] wrote:

Ah, okay. This is part of the older Firefox OS 1.1 Simulator that is no
longer maintained.

The 1.2+ simulators do not contain the above file because all ADB stuff is
handled separately. The newer addons are used via the App Managerhttps://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Using_the_App_Manager
.

With the App Manager, you can run ADB manually or use the ADB helper addonhttps://developer.mozilla.org/en-US/Firefox_OS/Using_the_App_Manager#Adb_Helper_Add-onto do this for you. It looks like the ADB helper has the same flaw you've
found here though.

We also have a more experimental ADB addonhttps://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/adb-helper/adbhelper-windows.xpiwhich does not appear to use
tasklist which might work for you, but again this is only meant for use
with the App Manager and FxOS 1.2+.

I have filed a bug about the ADB helperhttps://bugzilla.mozilla.org/show_bug.cgi?id=1006844on this issue.


Reply to this email directly or view it on GitHubhttps://github.com//issues/892#issuecomment-42367984
.

from r2d2b2g.

Loirooriol avatar Loirooriol commented on September 17, 2024

Replacing _isAdbRunning with the following code fixes the problem:

_isAdbRunning: function() {
  let deferred = Promise.defer();

  let ps, args;
  let platform = Services.appinfo.OS;
  if (platform === "WINNT") {
    ps = "C:\\windows\\system32\\tasklist.exe";
    args = [];
  } else {
    args = ["aux"];
    let psCommand = "ps";

    let paths = env.PATH.split(':');
    let len = paths.length;
    for (let i = 0; i < len; i++) {
      let fullyQualified = file.join(paths[i], psCommand);
      if (file.exists(fullyQualified)) {
        ps = fullyQualified;
        break;
      }
    }
  }

  if (ps) try {

    let buffer = [];

    subprocess.call({
      command: ps,
      arguments: args,
      stdout: function(data) {
        buffer.push(data);
      },
      done: function() {
        let lines = buffer.join('').split('\n');
        let regex = (platform === "WINNT") ? psRegexWin : psRegexNix;
        let isAdbRunning = lines.some(function(line) {
          return regex.test(line);
        });
        deferred.resolve(isAdbRunning);
      }
    });

    return deferred.promise;

  }catch(err){
    if(err.name !== "NS_ERROR_FILE_NOT_FOUND") throw err;
  }

  debug("Error: a task list executable not found on filesystem");
  deferred.resolve(false); // default to restart adb
  return deferred.promise;

},

from r2d2b2g.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.