2 # Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
17 _working_dir="/opt/media/Downloads/.preinstallWidgets"
18 _widget_temp="/opt/share/widget/*";
21 _wgt_list=`find $_working_dir -name '*.wgt'`
23 for list in $_wgt_list
26 return_string=`wrt-installer -il $list`
27 if [ "$return_string" != "${return_string/installed/}" ]; then
28 echo "$list widget installation success"
31 echo "$list widget installaiton failed"
36 if [ $install_failed -ne 1 ];then
37 echo "preinstall success"
43 #Remove temporary directory during widget installation
44 for file in $_widget_temp; do
45 if [[ -d $file && ${file#*temp_[0-9]*} != $file ]]; then
51 #Reinstall widget during booting
52 _temp_widget_path=/opt/share/widget/temp_info
54 FILE_LIST=`ls $_temp_widget_path`
56 if [ -n "$FILE_LIST" ]; then
57 echo "There are widgets to need reinstall."
58 for widget in $FILE_LIST; do
59 FILE_NAME=$_temp_widget_path/$widget
61 echo "----------------------------------------------------------------"
62 echo "UnInstalling widget : $line ..."
63 wrt-installer -up $line
64 echo "Installing widget : $line ..."
65 wrt-installer -i $line
68 echo "There is no reinstall widget."
72 if [ ! -d $_working_dir ]; then
73 echo "There is no preinstall widget directory - $_working_dir"
78 #Plugin installation is temporary code for window SDK
79 /usr/bin/wrt-installer -p