80 |
74 |
81 Logger::SetLevel( options.WarningLevel() ); |
75 Logger::SetLevel( options.WarningLevel() ); |
82 |
76 |
83 CInterpretSIS interpretSis(paramList); |
77 CInterpretSIS interpretSis(paramList); |
84 |
78 |
85 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
86 //Parsing Preprovisioned Resource file in not done if RegistryVersionExists |
|
87 if(!paramPtr->RegistryVersionExists()) |
|
88 { |
|
89 if ( paramPtr->IsFlagSet(CParameterList::EFlagsResourceFilePathSet)) |
|
90 { |
|
91 ParseResourceDir(paramPtr, interpretSis); |
|
92 |
|
93 if (NULL != logFile) |
|
94 { |
|
95 bool val = logFile->is_open(); |
|
96 logFile->close(); |
|
97 delete logFile; |
|
98 } |
|
99 return result; |
|
100 } |
|
101 else |
|
102 { |
|
103 ParseResourceDir(paramPtr, interpretSis); |
|
104 } |
|
105 } |
|
106 #endif //SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
107 |
|
108 result = interpretSis.Install(); |
79 result = interpretSis.Install(); |
109 |
80 |
110 // Uninstall the sis files |
81 // Uninstall the sis files |
111 interpretSis.Uninstall(); |
82 interpretSis.Uninstall(); |
112 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
113 if(result != 0) |
|
114 dbpath=GetDbPath(paramPtr); |
|
115 #endif |
|
116 } |
83 } |
117 catch( CCommandParser::CmdLineException err ) |
84 catch( CCommandParser::CmdLineException err ) |
118 { |
85 { |
119 CCommandParser::DisplayError(err); |
86 CCommandParser::DisplayError(err); |
120 result = CMDLINE_ERROR; |
87 result = CMDLINE_ERROR; |
129 { |
96 { |
130 LERROR(L"Config Manager Error - "); |
97 LERROR(L"Config Manager Error - "); |
131 e.Display(); |
98 e.Display(); |
132 result = CONFIG_ERROR; |
99 result = CONFIG_ERROR; |
133 } |
100 } |
134 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
135 catch(const CResourceFileException& aObject) |
|
136 { |
|
137 LERROR(L"Resource File Parsing Error - "); |
|
138 aObject.Display(); |
|
139 result = RSC_PARSING_ERROR; |
|
140 } |
|
141 #endif //SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
142 catch(const RomManagerException& e) |
101 catch(const RomManagerException& e) |
143 { |
102 { |
144 LERROR(L"ROM Manager Error - "); |
103 LERROR(L"ROM Manager Error - "); |
145 e.Display(); |
104 e.Display(); |
146 result = ROM_MANAGER; |
105 result = ROM_MANAGER; |
173 catch (...) |
132 catch (...) |
174 { |
133 { |
175 result = UNKNOWN_EXCEPTION; |
134 result = UNKNOWN_EXCEPTION; |
176 LERROR(L"Unknown Error" << std::endl); |
135 LERROR(L"Unknown Error" << std::endl); |
177 } |
136 } |
178 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
137 |
179 //Restore Database in case of installation error for SA over SA and PU case |
|
180 if(result != 0) |
|
181 { |
|
182 std::string BackupDb(dbpath); |
|
183 BackupDb.append("_backup"); |
|
184 if (FileExists(string2wstring(BackupDb))) |
|
185 { |
|
186 #ifdef __TOOLS2_LINUX__ |
|
187 std::string command = "mv " + BackupDb + " " + dbpath; |
|
188 #else |
|
189 std::string command = "move " + BackupDb + " " + dbpath; |
|
190 #endif |
|
191 int err = system(command.c_str()); |
|
192 if (err != 0) |
|
193 LERROR(L"Failed to Restore src.db "); |
|
194 } |
|
195 } |
|
196 #endif |
|
197 if (NULL != logFile) |
138 if (NULL != logFile) |
198 { |
139 { |
199 bool val = logFile->is_open(); |
140 bool val = logFile->is_open(); |
200 logFile->close(); |
141 logFile->close(); |
201 delete logFile; |
142 delete logFile; |
202 } |
143 } |
203 |
144 |
204 return result; |
145 return result; |
205 } |
146 } |