diff --git a/xpinstall/stub/nsStubNotifier.cpp b/xpinstall/stub/nsStubNotifier.cpp index 032e9a0e93a..6cd0b396fa5 100644 --- a/xpinstall/stub/nsStubNotifier.cpp +++ b/xpinstall/stub/nsStubNotifier.cpp @@ -25,11 +25,10 @@ #include "nsString.h" #include "nsStubNotifier.h" +extern PRInt32 gInstallStatus; -nsStubNotifier::nsStubNotifier( pfnXPIStart aStart, - pfnXPIProgress aProgress, - pfnXPIFinal aFinal) - : m_start(aStart), m_progress(aProgress), m_final(aFinal) +nsStubNotifier::nsStubNotifier( pfnXPIProgress aProgress ) + : m_progress(aProgress) { NS_INIT_ISUPPORTS(); } @@ -57,8 +56,7 @@ nsStubNotifier::AfterJavascriptEvaluation(const PRUnichar *URL) NS_IMETHODIMP nsStubNotifier::InstallStarted(const PRUnichar *URL, const PRUnichar* UIPackageName) { - if (m_start) - m_start(nsCAutoString(URL), nsCAutoString(UIPackageName)); + // we're not interested in this one return NS_OK; } @@ -81,9 +79,9 @@ nsStubNotifier::FinalizeProgress(const PRUnichar* message, PRInt32 itemNum, PRIn NS_IMETHODIMP nsStubNotifier::FinalStatus(const PRUnichar *URL, PRInt32 status) { - if (m_final) - m_final( nsCAutoString(URL), status ); - +// if (m_final) +// m_final( nsCAutoString(URL), status ); + gInstallStatus = status; return NS_OK; } diff --git a/xpinstall/stub/nsStubNotifier.h b/xpinstall/stub/nsStubNotifier.h index 83dfee6436d..c63cdc1505b 100644 --- a/xpinstall/stub/nsStubNotifier.h +++ b/xpinstall/stub/nsStubNotifier.h @@ -34,16 +34,14 @@ class nsStubNotifier : public nsIXPINotifier { public: - nsStubNotifier( pfnXPIStart, pfnXPIProgress, pfnXPIFinal ); + nsStubNotifier( pfnXPIProgress ); virtual ~nsStubNotifier(); NS_DECL_ISUPPORTS NS_DECL_NSIXPINOTIFIER private: - pfnXPIStart m_start; pfnXPIProgress m_progress; - pfnXPIFinal m_final; }; #endif diff --git a/xpinstall/stub/xpistub.cpp b/xpinstall/stub/xpistub.cpp index 1dc10f4ef53..d8e2df75be1 100644 --- a/xpinstall/stub/xpistub.cpp +++ b/xpinstall/stub/xpistub.cpp @@ -62,6 +62,8 @@ static nsIServiceManager *gServiceMgr = 0; static NS_DEFINE_IID(kSoftwareUpdateCID, NS_SoftwareUpdate_CID); +PRInt32 gInstallStatus; + //------------------------------------------------------------------------ @@ -74,9 +76,7 @@ PR_PUBLIC_API(nsresult) XPI_Init( #else const char* aProgramDir, #endif - pfnXPIStart startCB, - pfnXPIProgress progressCB, - pfnXPIFinal finalCB ) + pfnXPIProgress progressCB ) { nsresult rv; nsCOMPtr nsIfsDirectory; @@ -154,7 +154,7 @@ PR_PUBLIC_API(nsresult) XPI_Init( //-------------------------------------------------------------------- // Save the install wizard's callbacks as a nsIXPINotifer for later //-------------------------------------------------------------------- - nsStubNotifier* stub = new nsStubNotifier( startCB, progressCB, finalCB ); + nsStubNotifier* stub = new nsStubNotifier( progressCB ); if (!stub) { gXPI->Release(); @@ -190,7 +190,7 @@ PR_PUBLIC_API(void) XPI_Exit() //------------------------------------------------------------------------ // XPI_Install() //------------------------------------------------------------------------ -PR_PUBLIC_API(nsresult) XPI_Install( +PR_PUBLIC_API(PRInt32) XPI_Install( #ifdef XP_MAC const FSSpec& aFile, #else @@ -206,11 +206,13 @@ PR_PUBLIC_API(nsresult) XPI_Install( nsFileURL URL(file); nsString URLstr(URL.GetURLString()); + gInstallStatus = -201; // nsInstall::UNEXPECTED_ERROR + NS_NewFileSpecWithSpec( file, getter_AddRefs(iFile) ); if (iFile && gXPI) rv = gXPI->InstallJar( iFile, URLstr.GetUnicode(), args.GetUnicode(), (aFlags | XPI_NO_NEW_THREAD), gNotifier ); - return rv; + return gInstallStatus; } diff --git a/xpinstall/stub/xpistub.h b/xpinstall/stub/xpistub.h index 0c755a24ec5..25c0f2cb5a4 100644 --- a/xpinstall/stub/xpistub.h +++ b/xpinstall/stub/xpistub.h @@ -84,9 +84,7 @@ PR_EXTERN(nsresult) XPI_Init( #else const char* aProgramDir, #endif - pfnXPIStart startCB, - pfnXPIProgress progressCB, - pfnXPIFinal finalCB ); + pfnXPIProgress progressCB ); /** XPI_Install * @@ -95,8 +93,10 @@ PR_EXTERN(nsresult) XPI_Init( * @param file Native filename of XPI archive * @param args Install.arguments, if any * @param flags the old SmartUpdate trigger flags. This may go away + * + * @returns status Status from the installed archive */ -PR_EXTERN(nsresult) XPI_Install( +PR_EXTERN(PRInt32) XPI_Install( #ifdef XP_MAC const FSSpec& file, #else