Open Bug 450826 Opened 16 years ago Updated 2 years ago

nsIProcess launches arguments as URL instead of passing them to the associated process

Categories

(Core :: XPCOM, defect)

x86
Windows XP
defect

Tracking

()

UNCONFIRMED

People

(Reporter: amcdanie, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
Build Identifier: Mozile/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 firefox/3.0.1

Trying to pass a command line argument to a process I'm running, but the process never gets the argument and firefox opens a new tab with the following URL: http://www.{ARGUMENT}.com

For reference here is the code to reproduce the error:

var file = Components.classes["@mozilla.org/extensions/manager;1"]
      .getService(Components.interfaces.nsIExtensionManager)
      .getInstallLocation("test@test.com")
      .getItemLocation("test@test.com"); // guid of extension

file.append("test.exe");

if (file.exists()) {

  var process = Components.classes['@mozilla.org/process/util;1']
      .getService(Components.interfaces.nsIProcess);

  process.init(file);

  var arguments = ["/ARG"] ; // command line arguments array
  process.run(false, arguments, arguments.length);


Reproducible: Always

Steps to Reproduce:
1. See above
2. 
3.
Actual Results:  
Test.exe was launched with no command line arguments and a new tab with http://www.ARG.com is launched.

Expected Results:  
Text.exe is launched with defined command line arguments
I copied notepad.exe into inspector@mozilla.org and ran the following

var file = Components.classes["@mozilla.org/extensions/manager;1"].getService(Components.interfaces.nsIExtensionManager).getInstallLocation("inspector@mozilla.org").getItemLocation("inspector@mozilla.org");
file.append("notepad.exe");
var process = Components.classes['@mozilla.org/process/util;1'].getService(Components.interfaces.nsIProcess);
process.init(file);
var arguments = ["test.txt"];
process.run(false, arguments, arguments.length);

notepad was launched and it prompted me that it couldn't find test.txt and asked if I would like to create it.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.