Fix for #131175 - Chnages to register MRE components

r=dougt, sr=rpotts, a=drivers


git-svn-id: svn://10.0.0.236/trunk@123059 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
chak%netscape.com
2002-06-11 20:33:04 +00:00
parent 002351597a
commit ded609d173

View File

@@ -28,6 +28,7 @@
#include "nsIStringBundle.h"
#include "nsIDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
#include "nsEmbedAPI.h"
#include "nsLiteralString.h"
@@ -108,6 +109,31 @@ nsresult NS_InitEmbedding(nsILocalFile *mozBinDirectory,
return rv;
}
// If the application is using an MRE, then,
// auto register components in the MRE directory as well.
//
// The application indicates that it's using an MRE by
// returning a valid nsIFile when queried (via appFileLocProvider)
// for the NS_MRE_DIR atom as shown below
//
if (appFileLocProvider)
{
nsCOMPtr<nsIFile> mreDir;
PRBool persistent = PR_TRUE;
appFileLocProvider->GetFile(NS_MRE_DIR, &persistent, getter_AddRefs(mreDir));
if (mreDir)
{
rv = registrar->AutoRegister(mreDir);
if (NS_FAILED(rv))
{
NS_ASSERTION(PR_FALSE, "Could not AutoRegister MRE components");
return rv;
}
}
}
sRegistryInitializedFlag = PR_TRUE;
}