doomedFile.Delete(false);
doomedFile.Delete(PR_FALSE);
REGERR ReplaceFileNowOrSchedule(nsFileSpec& replacementFile, nsFileSpec& doomedFile ){    REGERR result = 0;        if(replacementFile == doomedFile)    {        /* do not have to do anything */        return result;    }    doomedFile.Delete(false);    if ( !doomedFile.Exists() )    {        // Now that we have removed the existing file, we can move the mExtracedFile or mPatchedFile into place.        nsFileSpec parentofFinalFile;        doomedFile.GetParent(parentofFinalFile);        result = replacementFile.Move(parentofFinalFile);        if ( NS_SUCCEEDED(result) )        {            char* leafName = doomedFile.GetLeafName();            replacementFile.Rename(leafName);            nsCRT::free(leafName);        }    }    else    {#ifdef _WINDOWS        if (DoWindowsReplaceExistingFileStuff(replacementFile.GetNativePathCString(), doomedFile.GetNativePathCString()) == 0)            return 0;#endif        RKEY newkey;        HREG reg;        if ( REGERR_OK == NR_RegOpen("", &reg) )         {            result = NR_RegAddKey( reg, ROOTKEY_PRIVATE, REG_REPLACE_LIST_KEY, &newkey);            if ( result == REGERR_OK )             {                char* replacementFileName = (char*)(const char*)replacementFile.GetNativePathCString();                result = NR_RegSetEntry( reg, newkey, (char*)(const char*)doomedFile.GetNativePathCString(), REGTYPE_ENTRY_FILE, replacementFileName, strlen(replacementFileName));                if (result == REGERR_OK)                    result = nsInstall::REBOOT_NEEDED;            }            NR_RegClose(reg);        }    }    return result;}