+SRC_URI += "file://modello-installer-postinst.sh"
+SRC_URI += "file://modello-installer-postinst.service"
+
RDEPENDS_Modello_Installer-xwalk_remove = "Modello_Phone"
-ALLOW_EMPTY_Modello_Installer-xwalk = "1"
\ No newline at end of file
+do_install_append() {
+ install -m 0755 -p -D ${WORKDIR}/modello-installer-postinst.sh ${D}${prefix}/share/modello-installer/modello-installer-postinst.sh
+ install -p -D ${WORKDIR}/modello-installer-postinst.service ${D}/lib/systemd/system/modello-installer-postinst.service
+ mkdir -p ${D}/lib/systemd/system/multi-user.target.wants
+ ln -sf ../modello-installer-postinst.service ${D}/lib/systemd/system/multi-user.target.wants/modello-installer-postinst.service
+}
+
+FILES_Modello_Installer-xwalk += "${prefix}/share/modello-installer/modello-installer-postinst.sh"
+FILES_Modello_Installer-xwalk += "/lib/systemd/system/modello-installer-postinst.service"
+FILES_Modello_Installer-xwalk += "/lib/systemd/system/multi-user.target.wants/modello-installer-postinst.service"
--- /dev/null
+[Unit]
+Description=Install Modello applications
+Before=Modello_Homescreen.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/share/modello-installer/modello-installer-postinst.sh
+ExecStartPost=/bin/rm -f /lib/systemd/system/multi-user.target.wants/modello-installer-postinst.service
+
+[Install]
+WantedBy=multi-user.target
--- /dev/null
+#!/bin/sh -e
+
+source /etc/tizen-platform.conf
+export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/5000/dbus/user_bus_socket"
+
+for list in $(find $TZ_SYS_APP_PREINSTALL -name "Modello*")
+do
+ #XWalk requires you not be root to install files
+ echo "Installing $list"
+ /bin/su app -c "xwalkctl -i $list"
+done
+
+for list2 in $(ls -d $TZ_SYS_HOME/app/.config/xwalk-service/applications/*/)
+do
+ /bin/su app -c "mkdir -p '$list2/css'"
+ /bin/su app -c "mkdir -p '$list2/js'"
+ /bin/su app -c "cp -r /opt/usr/apps/_common/js/services '$list2/js/'"
+ /bin/su app -c "cp -r /opt/usr/apps/_common/css/* '$list2/css/'"
+ /bin/su app -c "cp -r /opt/usr/apps/_common/icons '$list2/'"
+done