diff -r 84a16765cd86 -r 98b66e4fb0be secureswitools/swisistools/source/interpretsis/main.cpp --- a/secureswitools/swisistools/source/interpretsis/main.cpp Fri Mar 19 09:33:35 2010 +0200 +++ b/secureswitools/swisistools/source/interpretsis/main.cpp Fri Apr 16 15:05:20 2010 +0300 @@ -28,9 +28,15 @@ #include "interpretsis.h" #include "logger.h" #include "../common/exception.h" +#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#include "dirparse.h" +#endif //SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK int main(int argc, const char* argv[]) { +#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK + std::string dbpath; +#endif bool pauseWhenDone = false; int result= SUCCESS; @@ -60,10 +66,33 @@ CInterpretSIS interpretSis(paramList); +#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK + if ( paramPtr->IsFlagSet(CParameterList::EFlagsResourceFilePathSet)) + { + ParseResourceDir(paramPtr, interpretSis); + + if (NULL != logFile) + { + bool val = logFile->is_open(); + logFile->close(); + delete logFile; + } + return result; + } + else + { + ParseResourceDir(paramPtr, interpretSis); + } +#endif //SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK + result = interpretSis.Install(); // Uninstall the sis files interpretSis.Uninstall(); +#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK + if(result != 0) + dbpath=GetDbPath(paramPtr); +#endif } catch( CCommandParser::CmdLineException err ) { @@ -82,6 +111,14 @@ e.Display(); result = CONFIG_ERROR; } +#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK + catch(const CResourceFileException& aObject) + { + LERROR(L"Resource File Parsing Error - "); + aObject.Display(); + result = RSC_PARSING_ERROR; + } +#endif //SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK catch(const RomManagerException& e) { LERROR(L"ROM Manager Error - "); @@ -118,13 +155,27 @@ result = UNKNOWN_EXCEPTION; LERROR(L"Unknown Error" << std::endl); } - +#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK + //Restore Database in case of installation error for SA over SA and PU case + if(result != 0) + { + std::string BackupDb(dbpath); + BackupDb.append("_backup"); + if (FileExists(string2wstring(BackupDb))) + { + std::string command = "move " + BackupDb + " " + dbpath; + int err = system(command.c_str()); + if (err != 0) + LERROR(L"Failed to Restore src.db "); + } + } +#endif if (NULL != logFile) - { + { bool val = logFile->is_open(); logFile->close(); delete logFile; - } + } return result; - } +}