AExtensionFactoryPrivate::AExtensionFactoryPrivate()
: QObject( qApp )
{
#ifdef Q_OS_WIN32
    manager = new QPluginManager<AExtensionFactoryInterface>( IID_AExtensionFactory, QApplication::libraryPaths(), "/extensions", FALSE );
#else
	BrInitError error; 
	if (br_init_lib(&error) == 0 && error != BR_INIT_ERROR_DISABLED) { 
		aLog::print(aLog::MT_INFO, tr("Warning: BinReloc failed to initialize (error code %1)\n").arg(error));
		aLog::print(aLog::MT_INFO, tr("Will fallback to hardcoded default path.\n"));
	} 
	aLog::print(aLog::MT_DEBUG, tr("BinReloc path to library dir is '%1'\n").arg( br_find_lib_dir("/usr/lib") ));
    manager = new QPluginManager<AExtensionFactoryInterface>( IID_AExtensionFactory, QString(br_find_lib_dir("/usr/lib"))+QString("/ananas"), QString::null, FALSE );
#endif
    
}
Exemple #2
0
NPBool CPlugin::init(NPWindow* pNPWindow)
{
  if(pNPWindow == NULL)
    return FALSE;

#ifdef XP_WIN
  m_hWnd = (HWND)pNPWindow->window;
  if(m_hWnd == NULL)
    return FALSE;

  // subclass window so we can intercept window messages and
  // do our drawing to it
  lpOldProc = SubclassWindow(m_hWnd, (WNDPROC)PluginWinProc);

  // associate window with our CPlugin object so we can access 
  // it in the window procedure
  SetWindowLong(m_hWnd, GWL_USERDATA, (LONG)this);
#endif

  m_Window = pNPWindow;

  m_bInitialized	= TRUE;
  g_pNPInstance		= m_pNPInstance;
  g_pNPWindow		= pNPWindow;
  PString strPluginPath;
#ifdef XP_WIN // NPAPI plugin
	//Get Current Path of exe
	char szFullFileName[ MAX_PATH ];
	GetModuleFileName ( GetModuleHandle(NULL), szFullFileName, MAX_PATH ) ;
	strPluginPath = szFullFileName;
	PINDEX nPos = strPluginPath.FindLast( "\\" );
	strPluginPath = strPluginPath.Mid( 0, nPos + 1 ) + "plugins\\js2n\\";
#else // not Windows - assuming Linux
    BrInitError error;
    if (br_init_lib(&error) == 0 && error != BR_INIT_ERROR_DISABLED)
    {
        printf( "Error - can't init binreloc, code %d\n", error );
    }
	strPluginPath = br_find_exe_dir("/usr/lib/firefox/plugins/");
	strPluginPath += "js2n/";
#endif
  g_NativeLogic.Init( g_strPageURL, strPluginPath );
  return TRUE;
}
Exemple #3
0
int setTranslator(QString lang)
{
        QString langdir;
#ifdef _Windows
	langdir = qApp->applicationDirPath()+"/translations/";
#else
	BrInitError error;
	if (br_init_lib(&error) == 0 && error != BR_INIT_ERROR_DISABLED) {
		aLog::print(aLog::MT_INFO, QObject::tr("Warning: BinReloc failed to initialize (error code %1)\n").arg(error));
		aLog::print(aLog::MT_INFO, QObject::tr("Will fallback to hardcoded default path.\n"));
	}
	aLog::print(aLog::MT_DEBUG, QObject::tr("setTranslator - BinReloc path to data dir is %1.\n").arg( br_find_data_dir("/usr/share") ));

	langdir = QString(br_find_data_dir("/usr/share")) + QString("/ananas/translations/");
#endif
	tr_app.load( langdir+"ananas-engine-"+lang.lower()+".qm",".");
	tr_lib.load( langdir+"ananas-lib-"+lang.lower()+".qm",".");
	tr_plugins.load( langdir+"ananas-plugins-"+lang.lower()+".qm",".");
	return 0;
}
Exemple #4
0
/*!
*	\en
*	Return path to working dir.
*	\_en
*	\ru
*	Возвращает путь к рабочей директории.
*	\_ru
* 	\see setTable( const QString &name )
*/
QString
aReport::path2workdir()
{
	QString res;
#ifndef Q_OS_WIN32
	BrInitError error; 
	if (br_init_lib(&error) == 0 && error != BR_INIT_ERROR_DISABLED) { 
		aLog::print(aLog::MT_INFO, tr("Warning: BinReloc failed to initialize (error code %1)\n").arg(error));
		aLog::print(aLog::MT_INFO, tr("Will fallback to hardcoded default path.\n"));
	} 
	aLog::print(aLog::MT_DEBUG, tr("aReport::path2workdir BinReloc path to data dir is %1.\n").arg( br_find_data_dir("/usr/share") ));
	res = QString(br_find_data_dir("/usr/share")) + QString("/ananas/");
#else
	res = "";	
#endif
	if(md!=NULL)
	{
		res = md->rc.value("workdir");
	}
	aLog::print(aLog::MT_DEBUG, tr("aReport working dir = %1").arg(res));
	return res;
}
Exemple #5
0
void ConfigRoot::osConfigInstallDir()
{
#ifdef SUPERSERVER
	// Try getting the root path from the executable
	install_dir = getRootPathFromExePath();
    if (install_dir.hasData())
	{
        return;
    }
#elif defined(ENABLE_BINRELOC)
	BrInitError brError;
	if (br_init_lib(&brError))
	{
		string temp;
		PathUtils::splitLastComponent(install_dir, temp, br_find_exe_dir(FB_PREFIX));
		return;
	}
#endif

    // As a last resort get it from the default install directory
	install_dir = string(FB_PREFIX);
}
Exemple #6
0
/*!
*	\en
*	Shows report.
*	\_en
*	\ru
*	Показывает отчет.
*	\_ru
*/
void
aReport::show()
{       
	if(type==RT_text)
	{
		browser->textBrowser->setText( tpl->result() );
		browser->show();
	}
	if(type==RT_office_writer || type==RT_office_calc)
	{
		QString fileName = getName4NewTemplate();
		tpl->cleanUpTags();
		tpl->save(fileName);
		
		BrInitError error; 
		if (br_init_lib(&error) == 0 && error != BR_INIT_ERROR_DISABLED) { 
			aLog::print(aLog::MT_INFO, tr("Warning: BinReloc failed to initialize (error code %1)\n").arg(error));
			aLog::print(aLog::MT_INFO, tr("Will fallback to hardcoded default path.\n"));
		} 
		aLog::print(aLog::MT_DEBUG, tr("aReport::show BinReloc path to bin dir is %1.\n").arg( br_find_bin_dir("/usr/bin") ));
		
		QString startCatalog = br_find_bin_dir("/usr/bin");
		QString filter;
		bool sofficeFound = false;

		bool ok;
		QString oowriter = aService::readConfigVariable("OpenOfficeExecutable", &ok);
		if(!ok || oowriter == "" )
		{
#ifdef Q_OS_WIN32
			aLog::print(aLog::MT_INFO,tr("aReport OpenOfficeExecutable not found in registery"));
			startCatalog = QString("%1\\Program Files\\OpenOffice.org1.1.1\\program").arg(getenv("HOMEDRIVE"));
			QFile soffice(startCatalog + "\\soffice.exe");
			if(!soffice.exists())
			{
				startCatalog = QString("%1\\Program Files\\OpenOffice.org 2.0\\program").arg(getenv("HOMEDRIVE"));
			        soffice.setName(startCatalog + "\\soffice.exe");
				if(!soffice.exists())
				{
					startCatalog = QString("%1\\Program Files").arg(getenv("HOMEDRIVE"));
				}
				else
				{
					aService::writeConfigVariable("OpenOfficeExecutable",startCatalog + "\\soffice.exe");
					aLog::print(aLog::MT_INFO,tr("aReport OpenOfficeExecutable found %1").arg(startCatalog + "\\soffice.exe"));
				}
			}
			else
			{
				aService::writeConfigVariable("OpenOfficeExecutable",startCatalog + "\\soffice.exe");
				aLog::print(aLog::MT_INFO,tr("aReport OpenOfficeExecutable found %1").arg(startCatalog + "\\soffice.exe"));
			}
			filter = "Executable files (*.exe)";
#else
			aLog::print(aLog::MT_INFO,tr("aReport OpenOfficeExecutable not found in ~/.ananas/configrc"));
			QFile soffice(startCatalog + "/ooffice");
			if(!soffice.exists())
			{
				soffice.setName(startCatalog + "/ooffice2");
				if(soffice.exists())
				{
					aService::writeConfigVariable("OpenOfficeExecutable",startCatalog + "/ooffice2");
					aLog::print(aLog::MT_INFO,tr("aReport OpenOfficeExecutable found %1").arg(startCatalog + "/ooffice2"));
				}
			}
			else
			{
				aService::writeConfigVariable("OpenOfficeExecutable",startCatalog + "/ooffice");
				aLog::print(aLog::MT_INFO,tr("aReport OpenOfficeExecutable found %1").arg(startCatalog + "/ooffice"));
			}
#endif
		}
		oowriter = aService::readConfigVariable("OpenOfficeExecutable", &ok);
		if(!ok || oowriter == "" )
		{

			QFileDialog dlg(0,"select_file_dialog",true);
			dlg.addFilter( filter );
			dlg.setMode(QFileDialog::ExistingFile);
			dlg.setDir(QDir(startCatalog));
			dlg.setCaption("Для отображения отчета необходим OpenOffice. Укажите исполняемый файл OpenOffice"); 
			if(dlg.exec()==QDialog::Accepted)
			{
				oowriter = dlg.selectedFile();
				//printf("select %s", oowriter.ascii());
				QProcess process( oowriter );
				process.addArgument( "-n" );
				process.addArgument( QDir::convertSeparators( fileName ) );
				if( !process.start() )
				{
					QMessageBox::warning(0, tr("Warning"), tr("Unable to start OpenOffice (%1)").arg(oowriter), QMessageBox::Ok,QMessageBox::NoButton); 
//			 printf("Unable to start OpenOffice Writer\n");
				}
				else
				{
					aService::writeConfigVariable("OpenOfficeExecutable",oowriter);
					aLog::print(aLog::MT_INFO,tr("aReport OpenOfficeExecutable set to %1").arg(oowriter));
				}
			}
		}
		else
		{
			
			QProcess process( oowriter );
			process.addArgument( "-n" );
			process.addArgument( QDir::convertSeparators( fileName ) );
			if( !process.start() )
			{
				QMessageBox::warning(0, tr("Warning"), tr("Unable to start OpenOffice (%1)").arg(oowriter), QMessageBox::Ok,QMessageBox::NoButton); 
//			 printf("Unable to start OpenOffice Writer\n");
			}
			else
			{
				aService::writeConfigVariable("OpenOfficeExecutable",oowriter);
				aLog::print(aLog::MT_INFO,tr("aReport OpenOfficeExecutable set to %1").arg(oowriter));
			}
		}
		
		//tpl->open( tplName );
	}
	if (type==RT_msoffice_word || type==RT_msoffice_excel) 
	{
		QString fileName = getName4NewTemplate();
		tpl->cleanUpTags();
		tpl->save(fileName);
		QString msoCatalog = QString("%1\\Program Files\\Microsoft Office\\OFFICE11").arg(getenv("HOMEDRIVE"));
		QString configItem, msoAppName, msoAppFileName;
		if (type == RT_msoffice_word) 
		{
			configItem = "MSOfficeWordExecutable";
			msoAppName = "Word";
			msoAppFileName = "winword.exe";
		} 
		else 
		{
			configItem = "MSOfficeExcelExecutable";
			msoAppName = "Excel";	
			msoAppFileName = "excel.exe";
		}
		
		//реестр
		bool ok;
		QString msoReport = aService::readConfigVariable(configItem, &ok);
		//в реестре пусто
		if (!ok || msoReport.isEmpty()) {
			aLog::print(aLog::MT_INFO,tr("aReport "+configItem+" not found in registery"));
			QFile msoReportExe(msoCatalog + "\\"+msoAppFileName);
			//если файла нету
			if(!msoReportExe.exists())
			{
				QFileDialog dlg(0,"select_file_dialog",true);
				QString filter;
				filter = "Executable files (*.exe)";                        
				dlg.addFilter( filter );
				dlg.setMode(QFileDialog::ExistingFile);
				dlg.setDir(QDir(msoCatalog));
				dlg.setCaption(tr("For display of the report it is necessary Microsoft Office "+msoAppName+" 2003. Specify executed file Microsoft Office "+msoAppName+" 2003")); 
				if(dlg.exec()==QDialog::Accepted)
				{
					msoReport = dlg.selectedFile();
				}				
			}
			//сохраним в реестр
			else {
				//aService::writeConfigVariable("MSOfficeWordExecutable",winwordexe.name());
				msoReport = msoReportExe.name();
				aLog::print(aLog::MT_INFO,tr("aReport "+configItem+" found %1").arg(msoReportExe.name()));
			}
			QProcess process( msoReport );
			process.addArgument( QDir::convertSeparators( fileName ) );
			if( !process.start() )
			{
				if (!msoReport.isEmpty())
					QMessageBox::warning(0, tr("Warning"), tr("Unable to start Microsoft Office "+msoAppName+" 2003 (%1)").arg(msoReport), QMessageBox::Ok,QMessageBox::NoButton);
				else
					QMessageBox::warning(0, tr("Warning"), tr("Unable to start Microsoft Office "+msoAppName+" 2003"), QMessageBox::Ok,QMessageBox::NoButton);				
			}
			else
			{
				aService::writeConfigVariable(configItem,msoReport);
				aLog::print(aLog::MT_INFO,tr("aReport "+configItem+" set to %1").arg(msoReport));
			}			
		} 
		//тогда запускаем
		else 
		{
			QProcess process( msoReport );
			process.addArgument( QDir::convertSeparators( fileName ) );
			if( !process.start() )
			{
				QMessageBox::warning(0, tr("Warning"), tr("Unable to start Microsoft Office "+msoAppName+" 2003 (%1)").arg(msoReport), QMessageBox::Ok,QMessageBox::NoButton);
			}
			else
			{
				aService::writeConfigVariable(configItem,msoReport);
				aLog::print(aLog::MT_INFO,tr("aReport "+configItem+" set to %1").arg(msoReport));
			}
		}
	}
}
Exemple #7
0
int main( int argc, char ** argv )
{

	QApplication a( argc, argv );
//	dSelectDB dselectdb;
	dLogin dlogin;
//	application = &a;
	int rc = 1;
	bool ok;
	QPixmap pixmap;
	BrInitError error;

	QTextCodec::setCodecForCStrings( QTextCodec::codecForName("UTF8") );
	aLog::init("",aLog::MT_DEBUG);    

#ifndef _Windows
	if (br_init_lib(&error) == 0 && error != BR_INIT_ERROR_DISABLED) {
		aLog::print(aLog::MT_INFO, QObject::tr("Warning: BinReloc failed to initialize (error code %1)\n").arg(error));
		aLog::print(aLog::MT_INFO, QObject::tr("Will fallback to hardcoded default path.\n"));
	}
	aLog::print(aLog::MT_DEBUG, QObject::tr("main - BinReloc path to data dir is %1.\n").arg( br_find_data_dir("/usr/share") ));
	aLog::print(aLog::MT_DEBUG, QObject::tr("main - BinReloc path to lib dir is %1.\n").arg( br_find_data_dir("/usr/lib") ));
#endif
	if ( parseCommandLine( qApp->argc(), qApp->argv() ) ) return 1;
	qApp->installTranslator( &tr_app );
	qApp->installTranslator( &tr_lib );
	qApp->installTranslator( &tr_plugins );
	pixmap = QPixmap::fromMimeSource( "engine-splash-"+lang+".png" );
	if ( pixmap.isNull() )
#ifdef _Windows
	pixmap = QPixmap::fromMimeSource( qApp->applicationDirPath()+"/engine-splash-"+lang+".png" );
	qApp->addLibraryPath( qApp->applicationDirPath() );
#else
	pixmap = QPixmap::fromMimeSource( QString(br_find_data_dir("/usr/share") ) + "/ananas/designer/locale/engine-splash-"+lang+".png");
	qApp->addLibraryPath( QString( br_find_lib_dir("/usr/lib")) + "/ananas/qt3plugins" );

        QStringList list = a.libraryPaths();
	QString libPath = "";
	QStringList::Iterator it = list.begin();
	while( it != list.end() ) {
    	    libPath += *it+":";
    	    ++it;
	}
	aLog::print(aLog::MT_DEBUG, QString("main - qt library path is '%1'\n").arg( libPath));
#endif
	printf("extensions: \n%s\n",( const char *) AExtensionFactory::keys().join("\n") );
// Test create extension
//	AExtension *e = AExtensionFactory::create("AExtTest");
//	if (e) printf("EXT OK\n"); else printf("NO EXT OK\n");

	if ( pixmap.isNull() )
		pixmap = QPixmap::fromMimeSource( "engine-splash-en.png" );
	QSplashScreen *splash = new QSplashScreen( pixmap );
	if ( ananas_login( rcfile, username, userpassword ) ){
//	if ( rcfile.isEmpty() ) {
//    	    if (dselectdb.exec()==QDialog::Accepted) rcfile = dselectdb.rcfile;
//	}
//	if ( !rcfile.isEmpty() ) {
//    		if (dlogin.exec()==QDialog::Accepted) {
//		    username = dlogin.username;
//		    userpassword = dlogin.password;
//		}
//		if (dselectdb.rcfile.isEmpty()) return 0;

		splash->show();
		splash->message( QObject::tr("Init application"), Qt::AlignBottom, Qt::white );
		MainForm *w = new MainForm( 0, "MainForm");
		mainform = w;
		mainformws = mainform->ws;
		mainformwl = mainform->wl;
		qApp->setMainWidget( w );
		w->rcfile = rcfile;
//		printf( "rcfile = %s\n", rcfile.ascii() );
		w->show();
		ok = w->init();
		splash->clear();
       	splash->finish( w );
       	delete splash;
		if ( ok ) {
			qApp->connect( qApp, SIGNAL( lastWindowClosed() ), qApp, SLOT( quit() ) );
			rc = qApp->exec();
			if( w ) delete w;
			w=0;
		} else {
			QMessageBox::critical(0, QObject::tr("Error"), QObject::tr("Ananas runtime init error. See message window and log file for details."));
		}
		aLog::close();
		return rc;
	}
	else
	{
		aLog::close();
		return 0;
	}
}
Exemple #8
0
int GWEN_Init(void) {
  int err;

  if (gwen_is_initialized==0) {
    err=GWEN_Memory_ModuleInit();
    if (err)
      return err;
    err=GWEN_Logger_ModuleInit();
    if (err)
      return err;

    gnutls_global_init();

    if (gwen_binreloc_initialized==0) {
#ifdef ENABLE_BINRELOC
      BrInitError br_error;

      /* Init binreloc. Note: It is not totally clear whether the correct
       function might still be br_init() instead of br_init_lib(). */
      if (!br_init_lib(&br_error)) {
        DBG_INFO(GWEN_LOGDOMAIN, "Error on br_init: %d\n", br_error);
        gwen_binreloc_initialized=-1;
      }
      else
        gwen_binreloc_initialized=1;
#else
      gwen_binreloc_initialized=1;
#endif
    }

    GWEN_Error_ModuleInit();

    err=GWEN_PathManager_ModuleInit();
    if (err)
      return err;

    /* Define some paths used by gwenhywfar; add the windows
       registry entries first, because on Unix those functions
       simply do nothing and on windows they will ensure that the
       most valid paths (which are those from the registry) are
       first in the path lists. */

    /* ---------------------------------------------------------------------
     * $sysconfdir e.g. "/etc" */
    GWEN_PathManager_DefinePath(GWEN_PM_LIBNAME, GWEN_PM_SYSCONFDIR);
    GWEN_PathManager_AddPathFromWinReg(GWEN_PM_LIBNAME,
                                       GWEN_PM_LIBNAME,
                                       GWEN_PM_SYSCONFDIR,
                                       GWEN_REGKEY_PATHS,
                                       GWEN_REGNAME_SYSCONFDIR);
#if defined(OS_WIN32) || defined(ENABLE_LOCAL_INSTALL)
    /* add folder relative to EXE */
    GWEN_PathManager_AddRelPath(GWEN_PM_LIBNAME,
                                GWEN_PM_LIBNAME,
                                GWEN_PM_SYSCONFDIR,
                                GWEN_SYSCONF_DIR,
                                GWEN_PathManager_RelModeExe);
#else
    /* add absolute folder */
    GWEN_PathManager_AddPath(GWEN_PM_LIBNAME,
                             GWEN_PM_LIBNAME,
                             GWEN_PM_SYSCONFDIR,
                             GWEN_SYSCONF_DIR);
#endif

    /* ---------------------------------------------------------------------
     * $localedir e.g. "/usr/share/locale" */
    GWEN_PathManager_DefinePath(GWEN_PM_LIBNAME, GWEN_PM_LOCALEDIR);
    GWEN_PathManager_AddPathFromWinReg(GWEN_PM_LIBNAME,
                                       GWEN_PM_LIBNAME,
                                       GWEN_PM_LOCALEDIR,
                                       GWEN_REGKEY_PATHS,
                                       GWEN_REGNAME_LOCALEDIR);
#if defined(OS_WIN32) || defined(ENABLE_LOCAL_INSTALL)
    /* add folder relative to EXE */
    GWEN_PathManager_AddRelPath(GWEN_PM_LIBNAME,
                                GWEN_PM_LIBNAME,
                                GWEN_PM_LOCALEDIR,
                                LOCALEDIR,
                                GWEN_PathManager_RelModeExe);
#else
    /* add absolute folder */
    GWEN_PathManager_AddPath(GWEN_PM_LIBNAME,
                             GWEN_PM_LIBNAME,
                             GWEN_PM_LOCALEDIR,
                             LOCALEDIR);
#endif

    /* ---------------------------------------------------------------------
     * $plugindir e.g. "/usr/lib/gwenhywfar/plugins/0" */
    GWEN_PathManager_DefinePath(GWEN_PM_LIBNAME, GWEN_PM_PLUGINDIR);
    GWEN_PathManager_AddPathFromWinReg(GWEN_PM_LIBNAME,
                                       GWEN_PM_LIBNAME,
                                       GWEN_PM_PLUGINDIR,
                                       GWEN_REGKEY_PATHS,
                                       GWEN_REGNAME_PLUGINDIR);
#if defined(OS_WIN32) || defined(ENABLE_LOCAL_INSTALL)
    /* add folder relative to EXE */
    GWEN_PathManager_AddRelPath(GWEN_PM_LIBNAME,
                                GWEN_PM_LIBNAME,
                                GWEN_PM_PLUGINDIR,
                                PLUGINDIR,
                                GWEN_PathManager_RelModeExe);
#else
    /* add absolute folder */
    GWEN_PathManager_AddPath(GWEN_PM_LIBNAME,
                             GWEN_PM_LIBNAME,
                             GWEN_PM_PLUGINDIR,
                             PLUGINDIR);
#endif

    /* ---------------------------------------------------------------------
     * datadir e.g. "/usr/share/gwenhywfar" */
    GWEN_PathManager_DefinePath(GWEN_PM_LIBNAME, GWEN_PM_DATADIR);
    GWEN_PathManager_AddPathFromWinReg(GWEN_PM_LIBNAME,
                                       GWEN_PM_LIBNAME,
                                       GWEN_PM_DATADIR,
                                       GWEN_REGKEY_PATHS,
                                       GWEN_REGNAME_DATADIR);
#if defined(OS_WIN32) || defined(ENABLE_LOCAL_INSTALL)
    /* add folder relative to EXE */
    GWEN_PathManager_AddRelPath(GWEN_PM_LIBNAME,
                                GWEN_PM_LIBNAME,
                                GWEN_PM_DATADIR,
                                GWEN_DATADIR,
                                GWEN_PathManager_RelModeExe);
#else
    /* add absolute folder */
    GWEN_PathManager_AddPath(GWEN_PM_LIBNAME,
                             GWEN_PM_LIBNAME,
                             GWEN_PM_DATADIR,
                             GWEN_DATADIR);
#endif

    /* ---------------------------------------------------------------------
     * system datadir e.g. "/usr/share" */
    GWEN_PathManager_DefinePath(GWEN_PM_LIBNAME, GWEN_PM_SYSDATADIR);
    GWEN_PathManager_AddPathFromWinReg(GWEN_PM_LIBNAME,
                                       GWEN_PM_LIBNAME,
                                       GWEN_PM_SYSDATADIR,
                                       GWEN_REGKEY_PATHS,
                                       GWEN_REGNAME_SYSDATADIR);
#if defined(OS_WIN32) || defined(ENABLE_LOCAL_INSTALL)
    /* add folder relative to EXE */
    GWEN_PathManager_AddRelPath(GWEN_PM_LIBNAME,
                                GWEN_PM_LIBNAME,
                                GWEN_PM_SYSDATADIR,
                                GWEN_SYSDATADIR,
                                GWEN_PathManager_RelModeExe);
#else
    /* add absolute folder */
    GWEN_PathManager_AddPath(GWEN_PM_LIBNAME,
                             GWEN_PM_LIBNAME,
                             GWEN_PM_SYSDATADIR,
                             GWEN_SYSDATADIR);
#endif

    /* Initialize other modules. */
    DBG_DEBUG(GWEN_LOGDOMAIN, "Initializing I18N module");
    err=GWEN_I18N_ModuleInit();
    if (err)
      return err;
    DBG_DEBUG(GWEN_LOGDOMAIN, "Initializing InetAddr module");
    err=GWEN_InetAddr_ModuleInit();
    if (err)
      return err;
    DBG_DEBUG(GWEN_LOGDOMAIN, "Initializing Socket module");
    err=GWEN_Socket_ModuleInit();
    if (err)
      return err;
    DBG_DEBUG(GWEN_LOGDOMAIN, "Initializing Libloader module");
    err=GWEN_LibLoader_ModuleInit();
    if (err)
      return err;
    DBG_DEBUG(GWEN_LOGDOMAIN, "Initializing Crypt3 module");
    err=GWEN_Crypt3_ModuleInit();
    if (err)
      return err;
    DBG_DEBUG(GWEN_LOGDOMAIN, "Initializing Process module");
    err=GWEN_Process_ModuleInit();
    if (err)
      return err;
    DBG_DEBUG(GWEN_LOGDOMAIN, "Initializing Plugin module");
    err=GWEN_Plugin_ModuleInit();
    if (err)
      return err;
    DBG_DEBUG(GWEN_LOGDOMAIN, "Initializing DataBase IO module");
    err=GWEN_DBIO_ModuleInit();
    if (err)
      return err;
    DBG_DEBUG(GWEN_LOGDOMAIN, "Initializing ConfigMgr module");
    err=GWEN_ConfigMgr_ModuleInit();
    if (err)
      return err;
    DBG_DEBUG(GWEN_LOGDOMAIN, "Initializing CryptToken2 module");
    err=GWEN_Crypt_Token_ModuleInit();
    if (err)
      return err;
    /* add more modules here */

  }
  gwen_is_initialized++;

  return 0;

}