nsIChromeRegistry* reg,
nsIXULChromeRegistry* reg,
JSObject * InitXPInstallObjects(JSContext *jscontext,                             JSObject *global,                             nsIFile* jarfile,                             const PRUnichar* url,                             const PRUnichar* args,                             PRUint32 flags,                             nsIChromeRegistry* reg,                             nsIZipReader * theJARFile){  JSObject *installObject  = nsnull;  nsInstall *nativeInstallObject;    if (global == nsnull)    {        //we are the global        // new global object        global = JS_NewObject(jscontext, &InstallClass, nsnull, nsnull);    }  installObject  = JS_InitClass( jscontext,         // context                                 global,            // global object                                 nsnull,            // parent proto                                 &InstallClass,     // JSClass                                 nsnull,            // JSNative ctor                                 0,                 // ctor args                                 nsnull,            // proto props                                 nsnull,            // proto funcs                                 InstallProperties, // ctor props (static)                                 InstallMethods);   // ctor funcs (static)  if (nsnull == installObject)  {      return nsnull;  }  if ( PR_FALSE == JS_DefineConstDoubles(jscontext, installObject, install_constants) )            return nsnull;  nativeInstallObject = new nsInstall(theJARFile);  nativeInstallObject->SetJarFileLocation(jarfile);  nativeInstallObject->SetInstallArguments(nsAutoString(args));  nativeInstallObject->SetInstallURL(nsAutoString(url));  nativeInstallObject->SetInstallFlags(flags);  nativeInstallObject->SetChromeRegistry(reg);  JS_SetPrivate(jscontext, installObject, nativeInstallObject);  nativeInstallObject->SetScriptObject(installObject);  //  // Initialize and create the FileOp object  //  if(NS_OK != InitXPFileOpObjectPrototype(jscontext, global, &gFileOpProto))  {    return nsnull;  }  gFileOpObject = JS_NewObject(jscontext, &FileOpClass, gFileOpProto, nsnull);  if (gFileOpObject == nsnull)      return nsnull;  JS_SetPrivate(jscontext, gFileOpObject, nativeInstallObject);  JS_DefineProperty (jscontext, installObject, "File", OBJECT_TO_JSVAL(gFileOpObject),                     JS_PropertyStub, JS_PropertyStub, JSPROP_READONLY | JSPROP_PERMANENT);  //  // Initialize the FileSpecObject  //  if(NS_OK != InitFileSpecObjectPrototype(jscontext, installObject, &gFileSpecProto))  {    return nsnull;  }  //  // Initialize platform specific helper objects  //#ifdef _WINDOWS  JSObject *winRegPrototype     = nsnull;  JSObject *winProfilePrototype = nsnull;  if(NS_OK != InitWinRegPrototype(jscontext, global, &winRegPrototype))  {      return nsnull;  }  nativeInstallObject->SaveWinRegPrototype(winRegPrototype);  if(NS_OK != InitWinProfilePrototype(jscontext, global, &winProfilePrototype))  {      return nsnull;  }  nativeInstallObject->SaveWinProfilePrototype(winProfilePrototype);#endif  return installObject;}