Autoregistration at startup on unix from the app

This commit is contained in:
dp%netscape.com 1999-03-12 00:04:39 +00:00
Родитель 727ac1e4df
Коммит 808d876c4b
1 изменённых файлов: 19 добавлений и 1 удалений

Просмотреть файл

@ -26,7 +26,7 @@
#include "nsRDFCID.h"
#ifdef ClientWallet
#include "nsIWalletService.h"
#endif wallet
#endif /* ClientWallet */
#include "nsIBrowserWindow.h"
#include "nsIWebShell.h"
@ -62,6 +62,8 @@
#include "nsIAllocator.h"
#include "nsIGenericFactory.h"
#include "nsSpecialSystemDirectory.h" // For exe dir
#ifdef XP_PC
#define XPCOM_DLL "xpcom32.dll"
#define WIDGET_DLL "raptorwidget.dll"
@ -266,6 +268,22 @@ static NS_DEFINE_IID(kLWBrkCID, NS_LWBRK_CID);
extern "C" void
NS_SetupRegistry()
{
// Autoregistration happens here. The rest of RegisterComponent() calls should happen
// only for dlls not in the components directory.
#ifdef XP_UNIX
nsSpecialSystemDirectory sysdir(nsSpecialSystemDirectory::OS_CurrentProcessDirectory);
nsFilePath filePath(sysdir);
char *componentsDir = PR_smprintf("%s/components", (char *) filePath);
if (componentsDir != NULL)
{
printf("nsComponentManager: Using components dir: %s\n", componentsDir);
nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup, componentsDir);
PR_Free(componentsDir);
// XXX Look for user specific components
// XXX UNIX: ~/.mozilla/components
}
#endif /* XP_UNIX */
nsComponentManager::RegisterComponent(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponent(kAllocatorCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponent(kGenericFactoryCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE);