1 /* 2014, Copyright © Intel Coporation, license APACHE-2.0, see LICENSE file */
2 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3 // Use of this source code is governed by a apache 2.0 license that can be
4 // found in the LICENSE file.
6 #include <common/pkgmgr_interface.h>
9 #include "hybrid/hybrid_installer.h"
10 #include "wgt/utils/wgt_app_query_interface.h"
11 #include "wgt/wgt_installer.h"
13 namespace ci = common_installer;
15 int main(int argc, char** argv) {
16 ci::PkgmgrInstaller pkgmgr_installer;
17 wgt::WgtAppQueryInterface query_interface;
18 auto pkgmgr = ci::PkgMgrInterface::Create(argc, argv, &pkgmgr_installer,
21 LOG(ERROR) << "Options of pkgmgr installer cannot be parsed";
25 // This is workaround for hybrid apps as they requires much different flow
26 // but installer does not branch at all in current design
27 if (query_interface.IsHybridApplication(
28 pkgmgr->GetRequestInfo(), pkgmgr->GetUid())) {
29 LOG(INFO) << "Hybrid package detected";
30 hybrid::HybridInstaller installer(pkgmgr);
31 return (installer.Run() == ci::AppInstaller::Result::OK) ? 0 : 1;
33 wgt::WgtInstaller installer(pkgmgr);
34 return (installer.Run() == ci::AppInstaller::Result::OK) ? 0 : 1;