74 |
80 |
75 Logger::SetLevel( options.WarningLevel() ); |
81 Logger::SetLevel( options.WarningLevel() ); |
76 |
82 |
77 CInterpretSIS interpretSis(paramList); |
83 CInterpretSIS interpretSis(paramList); |
78 |
84 |
|
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 |
79 result = interpretSis.Install(); |
108 result = interpretSis.Install(); |
80 |
109 |
81 // Uninstall the sis files |
110 // Uninstall the sis files |
82 interpretSis.Uninstall(); |
111 interpretSis.Uninstall(); |
|
112 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
113 if(result != 0) |
|
114 dbpath=GetDbPath(paramPtr); |
|
115 #endif |
83 } |
116 } |
84 catch( CCommandParser::CmdLineException err ) |
117 catch( CCommandParser::CmdLineException err ) |
85 { |
118 { |
86 CCommandParser::DisplayError(err); |
119 CCommandParser::DisplayError(err); |
87 result = CMDLINE_ERROR; |
120 result = CMDLINE_ERROR; |
96 { |
129 { |
97 LERROR(L"Config Manager Error - "); |
130 LERROR(L"Config Manager Error - "); |
98 e.Display(); |
131 e.Display(); |
99 result = CONFIG_ERROR; |
132 result = CONFIG_ERROR; |
100 } |
133 } |
|
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 |
101 catch(const RomManagerException& e) |
142 catch(const RomManagerException& e) |
102 { |
143 { |
103 LERROR(L"ROM Manager Error - "); |
144 LERROR(L"ROM Manager Error - "); |
104 e.Display(); |
145 e.Display(); |
105 result = ROM_MANAGER; |
146 result = ROM_MANAGER; |
132 catch (...) |
173 catch (...) |
133 { |
174 { |
134 result = UNKNOWN_EXCEPTION; |
175 result = UNKNOWN_EXCEPTION; |
135 LERROR(L"Unknown Error" << std::endl); |
176 LERROR(L"Unknown Error" << std::endl); |
136 } |
177 } |
137 |
178 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
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 |
138 if (NULL != logFile) |
197 if (NULL != logFile) |
139 { |
198 { |
140 bool val = logFile->is_open(); |
199 bool val = logFile->is_open(); |
141 logFile->close(); |
200 logFile->close(); |
142 delete logFile; |
201 delete logFile; |
143 } |
202 } |
144 |
203 |
145 return result; |
204 return result; |
146 } |
205 } |