if (override) { prefBranch->SetBoolPref(PREF_HOMEPAGE_OVERRIDE, PR_TRUE); }
nsresult LaunchApplication(const char *aParam, PRInt32 height, PRInt32 width){  nsresult rv = NS_OK;  nsCOMPtr <nsICmdLineService> cmdLine =    do_GetService("@mozilla.org/appshell/commandLineService;1", &rv);  if (NS_FAILED(rv)) return rv;  nsCOMPtr <nsICmdLineHandler> handler;  rv = cmdLine->GetHandlerForParam(aParam, getter_AddRefs(handler));  if (NS_FAILED(rv)) return rv;  nsXPIDLCString chromeUrlForTask;  rv = handler->GetChromeUrlForTask(getter_Copies(chromeUrlForTask));  if (NS_FAILED(rv)) return rv;  PRBool handlesArgs = PR_FALSE;  rv = handler->GetHandlesArgs(&handlesArgs);  if (handlesArgs) {    nsXPIDLString defaultArgs;    /* GetDefaultArgs will always set the override pref to false but we don't want that       to happen yet (otherwise the setup page won't get displayed when a new       profile is used for the first time).  So we will fetch the override pref       before calling GetDefaultArgs and, if it is true, we will restore it to back       to true after calling GetDefaultArgs     */    PRBool override = PR_FALSE;    nsCOMPtr<nsIPrefBranch> prefBranch;    nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);    if (prefs) {      rv = prefs->GetBranch(nsnull, getter_AddRefs(prefBranch));      if (NS_SUCCEEDED(rv)) {        prefBranch->GetBoolPref(PREF_HOMEPAGE_OVERRIDE, &override);      }    }    rv = handler->GetDefaultArgs(getter_Copies(defaultArgs));    if (override) {      prefBranch->SetBoolPref(PREF_HOMEPAGE_OVERRIDE, PR_TRUE);    }    if (NS_FAILED(rv)) return rv;    rv = OpenWindow(chromeUrlForTask, defaultArgs);  }  else {    rv = OpenChromeURL(chromeUrlForTask, height, width);  }  return rv;}