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 /bin/rm -rf /opt/share/widget/system/*
19 if [ "$1" == "--old" ]
21 /bin/echo "Uninstalling turned off"
24 #Removing of widget desktop icons
25 WIDGET_EXEC_PATH=/opt/usr/apps/
26 WIDGET_PRELOAD_EXEC_PATH=/usr/apps/
27 WIDGET_DESKTOP_PATH=/opt/share/applications/
28 SMACK_RULES_PATH=/etc/smack/accesses.d/
29 WRT_DB=/opt/dbspace/.wrt.db
30 PKGMGR_DB=/opt/dbspace/.pkgmgr_parser.db
31 PLUGINS_INSTALLATION_REQUIRED_PATH=/opt/share/widget/
32 PLUGINS_INSTALLATION_REQUIRED=plugin-installation-required
36 PKG_NAME_SET=$(/usr/bin/sqlite3 $WRT_DB 'select tizen_appid from WidgetInfo;')
37 for appid in $PKG_NAME_SET
39 if [ $uninstall_widgets -eq 1 ]
41 wrt-installer -un $appid 1>/dev/null 2>&1
43 pkgId=`echo "$appid" | cut -f1 -d"."`
44 /usr/bin/sqlite3 $PKGMGR_DB "delete from package_info where package=\"$pkgId\""
45 /usr/bin/sqlite3 $PKGMGR_DB "delete from package_app_info where app_id=\"$appid\""
46 /bin/rm -rf ${WIDGET_EXEC_PATH}${pkgId}
47 /bin/rm -rf ${WIDGET_PRELOAD_EXEC_PATH}${pkgId}
48 widget_desktop_file="${WIDGET_DESKTOP_PATH}${appid}.desktop";
49 if [ -f ${widget_desktop_file} ]; then
50 /bin/rm -f $widget_desktop_file;
52 widget_smack_rule="${SMACK_RULES_PATH}${pkgId}"
53 if [ -f ${widget_smack_rule} ]; then
54 /bin/rm -f $widget_smack_rule;
58 echo "${WRT_DB} doesn't exist"
61 /usr/bin/wrt_commons_create_clean_db.sh
63 #TODO: remove this when switched to wrt-plugins-installer completely
64 if [ -e ${PLUGINS_INSTALLATION_REQUIRED_PATH} ] && [ -d ${PLUGINS_INSTALLATION_REQUIRED_PATH} ]
66 /bin/touch ${PLUGINS_INSTALLATION_REQUIRED_PATH}${PLUGINS_INSTALLATION_REQUIRED}
70 if [ -x /usr/bin/wrt-installer ]
72 /usr/bin/wrt-installer -p