rem:         if (profile.profileExists(aProfName)) { alert(gCreateProfileWizardBundle.getString("profileExists"));   window.frames["content"].document.getElementById("ProfileName").focus(); return false; } var invalidChars = ["/", "\\", "*", ":"]; for( var i = 0; i < invalidChars.length; i++ ) { if( aProfName.indexOf( invalidChars[i] ) != -1 ) { var aString = gProfileManagerBundle.getString("invalidCharA"); var bString = gProfileManagerBundle.getString("invalidCharB"); bString = bString.replace(/\s*<html:br\/>/g,"\n"); var lString = aString + invalidChars[i] + bString; alert( lString ); window.frames["content"].document.getElementById("ProfileName").focus(); return false; } }    var useExistingDir = false; var fileSpec = Components.classes["@mozilla.org/file/local;1"].createInstance(); if ( fileSpec ) fileSpec = fileSpec.QueryInterface( Components.interfaces.nsILocalFile );  if (aProfDir == null) fileSpec.initWithPath(profile.defaultProfileParentDir.path); else fileSpec.initWithPath(aProfDir);  fileSpec.append(aProfName);  if (fileSpec != null && fileSpec.exists()) useExistingDir = true;  dump("*** going to create a new profile called " + aProfName + " in folder: " + aProfDir + "\n"); profile.createNewProfileWithLocales(aProfName, aProfDir, langcode, regioncode, useExistingDir); 
add: var profileLocation = profileRoot.clone(); profileLocation.append(profileName); gProfile.createNewProfileWithLocales(profileName, profileRoot.path, languageCode, regionCode, profileLocation.exists()); 
context: function processCreateProfileData( aProfName, aProfDir, langcode, regioncode){  try {    // note: deleted check for empty profName string here as this should be    //       done by panel. -bmg (31/10/99)    // todo: move this check into the panel itself, activated ontyping :P    //       this should definetly be moved to that page.. but how about providing    //       user with some feedback about what's wrong. .. TOOLTIP! o_O    //       or.. some sort of onblur notification. like a dialog then, or a     //       dropout layery thing. yeah. something like that to tell them when     //       it happens, not when the whole wizard is complete. blah.     if (profile.profileExists(aProfName)) {      alert(gCreateProfileWizardBundle.getString("profileExists"));      // this is a bad but probably acceptable solution for now.       // when we add more panels, we will want a better solution.       window.frames["content"].document.getElementById("ProfileName").focus();      return false;    }    var invalidChars = ["/", "\\", "*", ":"];    for( var i = 0; i < invalidChars.length; i++ )    {      if( aProfName.indexOf( invalidChars[i] ) != -1 ) {        var aString = gProfileManagerBundle.getString("invalidCharA");        var bString = gProfileManagerBundle.getString("invalidCharB");        bString = bString.replace(/\s*<html:br\/>/g,"\n");        var lString = aString + invalidChars[i] + bString;        alert( lString );        window.frames["content"].document.getElementById("ProfileName").focus();        return false;      }    }    // Adding code to see if the profile directory already exists....    // XXXX - Further modifications like adding propmt dialog are required - XXXX    var useExistingDir = false;    var fileSpec = Components.classes["@mozilla.org/file/local;1"].createInstance();    if ( fileSpec )        fileSpec = fileSpec.QueryInterface( Components.interfaces.nsILocalFile );    if (aProfDir == null)        fileSpec.initWithPath(profile.defaultProfileParentDir.path);    else        fileSpec.initWithPath(aProfDir);    fileSpec.append(aProfName);    if (fileSpec != null && fileSpec.exists())      useExistingDir = true;    dump("*** going to create a new profile called " + aProfName + " in folder: " + aProfDir + "\n");    profile.createNewProfileWithLocales(aProfName, aProfDir, langcode, regioncode, useExistingDir);    return true;  }  catch(e) {    dump("*** Failed to create a profile\n");    return false;  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/a2117844971366e3508a3d2430352b07dbbd62cc/createProfileWizard.js/clean/profile/resources/content/createProfileWizard.js