diff --git a/mozilla/xpinstall/public/nsPIXPIStubHook.idl b/mozilla/xpinstall/public/nsPIXPIStubHook.idl index 62e21bcf906..da413623683 100644 --- a/mozilla/xpinstall/public/nsPIXPIStubHook.idl +++ b/mozilla/xpinstall/public/nsPIXPIStubHook.idl @@ -35,5 +35,5 @@ [uuid(089929F0-4ED9-11d3-ABDD-000064657374)] interface nsPIXPIStubHook : nsISupports { - void StubInitialize(in nsIFile dir); + void StubInitialize(in nsIFile dir, in string logName); }; diff --git a/mozilla/xpinstall/src/nsLoggingProgressNotifier.cpp b/mozilla/xpinstall/src/nsLoggingProgressNotifier.cpp index 9073f7387d8..72712b94be8 100644 --- a/mozilla/xpinstall/src/nsLoggingProgressNotifier.cpp +++ b/mozilla/xpinstall/src/nsLoggingProgressNotifier.cpp @@ -80,11 +80,18 @@ nsLoggingProgressListener::BeforeJavascriptEvaluation(const PRUnichar *URL) if (NS_FAILED(rv)) return rv; + if (!nsSoftwareUpdate::GetLogName()) + { #ifdef XP_MAC - rv = iFile->Append("Install Log"); + rv = iFile->Append("Install Log"); #else - rv = iFile->Append("install.log"); + rv = iFile->Append("install.log"); #endif + } + else + rv = iFile->Append(nsSoftwareUpdate::GetLogName()); + + if (NS_FAILED(rv)) return rv; // create log file if it doesn't exist (to work around a mac filespec bug) PRBool bExists = PR_FALSE; diff --git a/mozilla/xpinstall/src/nsSoftwareUpdate.cpp b/mozilla/xpinstall/src/nsSoftwareUpdate.cpp index 05389a3f3ca..e8183167762 100644 --- a/mozilla/xpinstall/src/nsSoftwareUpdate.cpp +++ b/mozilla/xpinstall/src/nsSoftwareUpdate.cpp @@ -99,6 +99,7 @@ static NS_DEFINE_CID(knsRegistryCID, NS_REGISTRY_CID); nsSoftwareUpdate* nsSoftwareUpdate::mInstance = nsnull; nsCOMPtr nsSoftwareUpdate::mProgramDir = nsnull; +char* nsSoftwareUpdate::mLogName = nsnull; #if NOTIFICATION_ENABLE #include "nsUpdateNotification.h" @@ -182,6 +183,8 @@ nsSoftwareUpdate::~nsSoftwareUpdate() //NS_IF_RELEASE( mProgramDir ); NS_IF_RELEASE (mMasterListener); mInstance = nsnull; + + PR_FREEIF(mLogName); } @@ -533,13 +536,16 @@ nsSoftwareUpdate::RegisterNameset() NS_IMETHODIMP -nsSoftwareUpdate::StubInitialize(nsIFile *aDir) +nsSoftwareUpdate::StubInitialize(nsIFile *aDir, const char* logName) { if (mStubLockout) return NS_ERROR_ABORT; else if ( !aDir ) return NS_ERROR_NULL_POINTER; + if (logName) + PL_strcpy(mLogName, logName); + // only allow once, it could be a mess if we've already started installing mStubLockout = PR_TRUE; diff --git a/mozilla/xpinstall/src/nsSoftwareUpdate.h b/mozilla/xpinstall/src/nsSoftwareUpdate.h index df2d5df559d..cf69d63590d 100644 --- a/mozilla/xpinstall/src/nsSoftwareUpdate.h +++ b/mozilla/xpinstall/src/nsSoftwareUpdate.h @@ -42,11 +42,16 @@ class nsSoftwareUpdate: public nsIAppShellComponent, static nsSoftwareUpdate *GetInstance(); /** GetProgramDirectory - * information used within the XPI module -- not + * Information used within the XPI module -- not * available through any interface */ static nsIFile* GetProgramDirectory() { return mProgramDir; } + /** GetLogName + * Optional log name used privately in the XPI module. + */ + static char* GetLogName() { return mLogName; } + NS_DECL_ISUPPORTS NS_DECL_NSIAPPSHELLCOMPONENT @@ -75,7 +80,7 @@ class nsSoftwareUpdate: public nsIAppShellComponent, * once, and is also set by the AppShellComponent initialize * so it can't be called during a normal Mozilla run */ - NS_IMETHOD StubInitialize(nsIFile *dir); + NS_IMETHOD StubInitialize(nsIFile *dir, const char* logName); nsSoftwareUpdate(); virtual ~nsSoftwareUpdate(); @@ -84,6 +89,7 @@ class nsSoftwareUpdate: public nsIAppShellComponent, private: static nsSoftwareUpdate* mInstance; static nsCOMPtr mProgramDir; + static char* mLogName; #if NOTIFICATION_ENABLE static nsIUpdateNotification *mUpdateNotifier; diff --git a/mozilla/xpinstall/stub/xpistub.cpp b/mozilla/xpinstall/stub/xpistub.cpp index ae664531fbf..c1dc181c93c 100644 --- a/mozilla/xpinstall/stub/xpistub.cpp +++ b/mozilla/xpinstall/stub/xpistub.cpp @@ -91,6 +91,7 @@ PR_PUBLIC_API(nsresult) XPI_Init( #else const char* aProgramDir, #endif + const char* aLogName, pfnXPIProgress progressCB ) { nsresult rv; @@ -199,7 +200,7 @@ PR_PUBLIC_API(nsresult) XPI_Init( #endif if (hook && iDirSpec) - hook->StubInitialize( iDirSpec ); + hook->StubInitialize( iDirSpec, aLogName ); else return NS_ERROR_NULL_POINTER; diff --git a/mozilla/xpinstall/wizard/mac/src/XPInstallGlue.c b/mozilla/xpinstall/wizard/mac/src/XPInstallGlue.c index a73456e95e8..992a718068d 100644 --- a/mozilla/xpinstall/wizard/mac/src/XPInstallGlue.c +++ b/mozilla/xpinstall/wizard/mac/src/XPInstallGlue.c @@ -30,7 +30,7 @@ *-----------------------------------------------------------*/ /*================== XPI Stub Entry Points ================== */ -typedef nsresult (*XPI_InitProc)(const FSSpec& aXPIStubDir, const FSSpec& aProgramDir, pfnXPIProgress progressCB); +typedef nsresult (*XPI_InitProc)(const FSSpec& aXPIStubDir, const FSSpec& aProgramDir, const char* aLogName, pfnXPIProgress progressCB); typedef nsresult (*XPI_InstallProc)(const FSSpec& file, const char* args,long flags); typedef nsresult (*XPI_ExitProc)(); @@ -247,7 +247,7 @@ RunAllXPIs(short xpiVRefNum, long xpiDirID, short vRefNum, long dirID) } ERR_CHECK_RET(LoadXPIStub(&xpi_initProc, &xpi_installProc, &xpi_exitProc, &connID, xpiStubDirSpec), err); - XPI_ERR_CHECK(xpi_initProc( xpiStubDirSpec, tgtDirSpec, xpicbProgress )); + XPI_ERR_CHECK(xpi_initProc( xpiStubDirSpec, tgtDirSpec, NULL, xpicbProgress )); // init overall xpi indicator numXPIs = CountSelectedXPIs(); diff --git a/mozilla/xpinstall/wizard/unix/src2/nsXIEngine.cpp b/mozilla/xpinstall/wizard/unix/src2/nsXIEngine.cpp index 038d336f325..e2389545131 100644 --- a/mozilla/xpinstall/wizard/unix/src2/nsXIEngine.cpp +++ b/mozilla/xpinstall/wizard/unix/src2/nsXIEngine.cpp @@ -364,7 +364,7 @@ printf("DEBUG: libpath = >>%s<<\n", libpath); } DUMP("xpistub symbols loaded"); - rv = aStub->fn_init(aDestination, ProgressCallback); + rv = aStub->fn_init(aDestination, NULL, ProgressCallback); #ifdef DEBUG printf("DEBUG: XPI_Init returned 0x%.8X\n", rv); diff --git a/mozilla/xpinstall/wizard/unix/src2/nsXIEngine.h b/mozilla/xpinstall/wizard/unix/src2/nsXIEngine.h index b0db225bab9..7aeb5905346 100644 --- a/mozilla/xpinstall/wizard/unix/src2/nsXIEngine.h +++ b/mozilla/xpinstall/wizard/unix/src2/nsXIEngine.h @@ -45,7 +45,8 @@ * XPI Stub Glue *------------------------------------------------------------------------*/ typedef nsresult (*pfnXPI_Init) - (const char *aProgramDir, pfnXPIProgress progressCB); + (const char *aProgramDir, const char *aLogName, + pfnXPIProgress progressCB); typedef nsresult (*pfnXPI_Install) (const char *file, const char *args, long flags); typedef void (*pfnXPI_Exit)();