Recreate .autoreg even if it already exists, so that we're sure the newer timestamp will trigger component registration on startup. Bug 279800, r=bsmedberg, sr=darin.

This commit is contained in:
bryner%brianryner.com 2005-01-27 15:50:09 +00:00
Родитель 5ec522dcc1
Коммит 45ff58d8bf
1 изменённых файлов: 9 добавлений и 10 удалений

Просмотреть файл

@ -137,20 +137,19 @@ NS_SoftwareUpdateRequestAutoReg()
}
file->AppendNative(nsDependentCString(".autoreg"));
PRBool condition;
if (NS_SUCCEEDED(file->Exists(&condition)) && condition) {
if (NS_SUCCEEDED(file->IsFile(&condition)) && condition)
return;
#ifdef DEBUG_timeless
if (NS_SUCCEEDED(file->IsDirectory(&condition)) && condition) {
/* someone did this intentionally, no point in complaining */
return;
}
#endif
NS_WARNING("Found an .autoreg object, but it isn't a file or directory");
PRBool condition;
if (NS_SUCCEEDED(file->IsDirectory(&condition)) && condition) {
/* someone did this intentionally, no point in complaining */
return;
}
#endif
// Remove and recreate the file to update its timestamp.
// .autoreg must be newer than compreg.dat for component registration
// to occur.
file->Remove(PR_FALSE);
rv = file->Create(nsIFile::NORMAL_FILE_TYPE, 0666);
if (NS_FAILED(rv)) {