diff --git a/EXE.h b/EXE.h index 895ba44..6f45f0e 100644 --- a/EXE.h +++ b/EXE.h @@ -16,6 +16,9 @@ #include "GseContext.h" #include "/EgtDev/Include/EgtILogger.h" +//---------------------------------------------------------------------------- +const std::string& ExeGetIniFile( void) ; + //---------------------------------------------------------------------------- ILogger* GetLogger( void) ; ILogger* GetCmdLogger( void) ; diff --git a/EXE_General.cpp b/EXE_General.cpp index eaef3d9..7a167af 100644 --- a/EXE_General.cpp +++ b/EXE_General.cpp @@ -41,6 +41,7 @@ static bool s_bCmdLog = false ; static Logger* s_pCmdLog = nullptr ; static string s_sKey ; static int s_nKeyType = KEY_LOCK_TYPE_ANY ; +static string s_sIniFile ; static pfProcEvents s_pFunProcEvents = nullptr ; static pfOutText s_pFunOutText = nullptr ; @@ -215,6 +216,14 @@ ExeSetLuaLibs( const string& sLuaLibsDir) return LuaSetLuaLibsDir( sLuaLibsDir) ; } +//----------------------------------------------------------------------------- +bool +ExeSetIniFile( const string& sIniFile) +{ + s_sIniFile = sIniFile ; + return true ; +} + //----------------------------------------------------------------------------- bool ExeSetCommandLogger( const string& sLogFile) @@ -418,6 +427,13 @@ ExeOutText( const string& sText) return false ; } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +const string& +ExeGetIniFile( void) +{ + return s_sIniFile ; +} //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- diff --git a/EgtExecutor.rc b/EgtExecutor.rc index a48b842..e794e31 100644 Binary files a/EgtExecutor.rc and b/EgtExecutor.rc differ diff --git a/LUA_General.cpp b/LUA_General.cpp index 9480882..c19395a 100644 --- a/LUA_General.cpp +++ b/LUA_General.cpp @@ -484,6 +484,22 @@ LuaWriteStringToIni( lua_State* L) return 1 ; } +//------------------------------------------------------------------------------- +static int +LuaGetIniFile( lua_State* L) +{ + // nessun parametro + LuaClearStack( L) ; + // recupero la path del file Ini dell'eseguibile + string sIniFile = ExeGetIniFile() ; + // restituisco il risultato + if ( ! sIniFile.empty()) + LuaSetParam( L, sIniFile) ; + else + LuaSetParam( L) ; + return 1 ; +} + //------------------------------------------------------------------------------- static int LuaGetVersion( lua_State* L) @@ -648,6 +664,7 @@ LuaInstallGeneral( LuaMgr& luaMgr) bOk = bOk && luaMgr.RegisterFunction( "EgtBinaryFileCompare", LuaBinaryFileCompare) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetStringFromIni", LuaGetStringFromIni) ; bOk = bOk && luaMgr.RegisterFunction( "EgtWriteStringToIni", LuaWriteStringToIni) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtGetIniFile", LuaGetIniFile) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetVersion", LuaGetVersion) ; bOk = bOk && luaMgr.RegisterFunction( "EgtIs64bit", LuaIs64bit) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetLanguage", LuaGetLanguage) ;