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/usr/media/Downloads/.preinstallWidgets"
18 _widget_temp="/opt/share/widget/*"
20 #Reinstall widget during booting
21 _temp_widget_path="/opt/share/widget/temp_info"
24 _wgt_list=`find $_working_dir -name '*.wgt'`
26 for list in $_wgt_list
29 return_string=`wrt-installer -i $list 2>&1 | grep -v plugin`
30 if [ "$return_string" != "${return_string/successful/}" ]; then
31 echo "$list widget installation success"
34 echo "$list widget installaiton failed"
39 if [ $install_failed -ne 1 ];then
40 echo "preinstall success"
46 #Remove temporary directory during widget installation
47 for file in $_widget_temp; do
48 if [[ -d $file && ${file#*temp_[0-9]*} != $file ]]; then
53 FILE_LIST=`ls $_temp_widget_path`
55 if [ -n "$FILE_LIST" ]; then
56 echo "There are widgets to need reinstall."
57 for widget in $FILE_LIST; do
58 FILE_NAME=$_temp_widget_path/$widget
60 echo "----------------------------------------------------------------"
61 echo "UnInstalling widget : $line ..."
62 return_string=`wrt-installer -up $line 2>&1 | grep -v plugin`
63 echo "Result $return_string"
66 echo "There is no reinstall widget."
70 #Plugin installation is temporary code for window SDK
71 /usr/bin/wrt-installer -p
73 RECOVER_WIDGETS=`ls $_temp_widget_path`
74 if [ -n "$RECOVER_WIDGETS" ]; then