From 45ff58d8bf1cc92d0d1098bc505754b79ba2d26c Mon Sep 17 00:00:00 2001 From: "bryner%brianryner.com" Date: Thu, 27 Jan 2005 15:50:09 +0000 Subject: [PATCH] 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. --- xpinstall/src/nsInstall.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/xpinstall/src/nsInstall.cpp b/xpinstall/src/nsInstall.cpp index d7fbd251570..bb487a4d7fd 100644 --- a/xpinstall/src/nsInstall.cpp +++ b/xpinstall/src/nsInstall.cpp @@ -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)) {