bug 12816 init XPInstall before any components are loaded so they can be replaced

This commit is contained in:
dveditz%netscape.com 1999-12-03 13:39:18 +00:00
parent cbe2026152
commit 4b48b79408

View File

@ -51,7 +51,12 @@
#include "nsIWindowMediator.h"
#include "nsIDOMWindow.h"
#include "nsIClipboard.h"
#ifndef XP_MAC
#include "nsISoftwareUpdate.h"
#include "nsSoftwareUpdateIIDs.h"
static NS_DEFINE_CID(kSoftUpdateCID, NS_SoftwareUpdate_CID);
#endif
static NS_DEFINE_IID(kIWindowMediatorIID,NS_IWINDOWMEDIATOR_IID);
static NS_DEFINE_CID(kWindowMediatorCID, NS_WINDOWMEDIATOR_CID);
static NS_DEFINE_IID(kWalletServiceCID, NS_WALLETSERVICE_CID);
@ -656,8 +661,28 @@ int main(int argc, char* argv[])
rv = NS_InitXPCOM(NULL, NULL, NULL);
NS_ASSERTION( NS_SUCCEEDED(rv), "NS_InitXPCOM failed" );
#ifndef XP_MAC
{
//----------------------------------------------------------------
// XPInstall needs to clean up after any updates that couldn't
// be completed because components were in use. This must be done
// **BEFORE** any other components are loaded!
//
// Will also check to see if AutoReg is required due to version
// change or installation of new components
//
// (scoped in a block to force release of COMPtr)
//----------------------------------------------------------------
nsCOMPtr<nsISoftwareUpdate> su = do_GetService(kSoftUpdateCID,&rv);
if (NS_SUCCEEDED(rv))
su->StartupTasks();
}
#endif
nsresult result = main1( argc, argv );
{
// Scoping this in a block to force the pref service to be
// released.