1 let executableFile = Services.dirsvc.get("CurProcD", Ci.nsIFile);
2 executableFile.append("xpcshell.exe");
4 let quote = '"'; // Windows' cmd processor doesn't actually use single quotes.
5 for (let suffix of ["", " -osint", ` --blah "%PROGRAMFILES%"`]) {
6 let cmdline = quote + executableFile.path + quote + suffix;
7 info(`Testing with ${cmdline}`);
8 let f = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFileWin);
9 f.initWithCommandLine(cmdline);
13 "Should be able to recover executable path"
17 let f = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFileWin);
18 f.initWithCommandLine("%ComSpec% -c echo 'hi'");
19 let cmd = Services.dirsvc.get("SysD", Ci.nsIFile);
20 cmd.append("cmd.exe");
21 Assert.equal(f.path, cmd.path, "Should be able to replace env vars.");