nsSoftwareUpdate::NeedCleanup(); }
PRInt32 ReplaceFileNowOrSchedule(nsIFile* replacementFile, nsIFile* doomedFile ){    PRInt32 result = ReplaceFileNow( replacementFile, doomedFile );    if ( result == nsInstall::ACCESS_DENIED )    {        // if we couldn't replace the file schedule it for later#ifdef _WINDOWS        if ( ReplaceExistingWindowsFile(replacementFile, doomedFile) == 0 )            return nsInstall::REBOOT_NEEDED;#endif        RKEY    listkey;        RKEY    filekey;        HREG    reg;        REGERR  err;        char* regFilePath = GetRegFilePath();        if ( REGERR_OK == NR_RegOpen(regFilePath, &reg) )         {            err = NR_RegAddKey( reg, ROOTKEY_PRIVATE, REG_REPLACE_LIST_KEY, &listkey );            if ( err == REGERR_OK )             {                char     valname[20];                REGERR   err2;                err = NR_RegGetUniqueName( reg, valname, sizeof(valname) );                if ( err == REGERR_OK )                {                    err = NR_RegAddKey( reg, listkey, valname, &filekey );                    if ( REGERR_OK == err )                    {                        nsXPIDLCString srcowner;                        nsXPIDLCString destowner;                        nsresult rv = GetPersistentStringFromSpec(                                replacementFile, getter_Copies(srcowner));                        nsresult rv2 = GetPersistentStringFromSpec(                                doomedFile, getter_Copies(destowner));                        if ( NS_SUCCEEDED(rv) && NS_SUCCEEDED(rv2) )                        {                            const char *fsrc  = srcowner;                            const char *fdest = destowner;                            err = NR_RegSetEntry( reg, filekey,                                                   REG_REPLACE_SRCFILE,                                                  REGTYPE_ENTRY_BYTES,                                                   (void*)fsrc,                                                   strlen(fsrc)+sizeof('\0'));                            err2 = NR_RegSetEntry(reg, filekey,                                                  REG_REPLACE_DESTFILE,                                                  REGTYPE_ENTRY_BYTES,                                                  (void*)fdest,                                                  strlen(fdest)+sizeof('\0'));                            if ( err == REGERR_OK && err2 == REGERR_OK )                                result = nsInstall::REBOOT_NEEDED;                            else                                NR_RegDeleteKey( reg, listkey, valname );                        }                    }                }            }            NR_RegClose(reg);        }        if (regFilePath)            nsCRT::free(regFilePath);    }    return result;}