diff --git a/projects/mtg/debian/launcher b/projects/mtg/debian/launcher index 3db681737..8c06efcbb 100755 --- a/projects/mtg/debian/launcher +++ b/projects/mtg/debian/launcher @@ -10,7 +10,6 @@ if grep -q /home/user/MyDocs /proc/mounts; then dirSize=`du -s /home/user/wagic/Res | awk '{print $1}'` # Size available on the FAT partition avaSize=`df | grep /dev/mmcblk0p1 | awk '{print $4}'` - echo "$usedSize $dirSize $avaSize" if [ $usedSize -lt 100 ] then if [ $avaSize -gt $dirSize ] then @@ -20,5 +19,5 @@ if grep -q /home/user/MyDocs /proc/mounts; then fi fi -./wagic +/opt/wagic/wagic exit 0 diff --git a/projects/mtg/debian/postinst b/projects/mtg/debian/postinst index 897e7f9ba..81fa5b56b 100644 --- a/projects/mtg/debian/postinst +++ b/projects/mtg/debian/postinst @@ -3,6 +3,25 @@ chmod a+x /opt/wagic/wagic chmod a+x /opt/wagic/launcher chmod -R a+rw /home/user/wagic +if grep -q /home/user/MyDocs /proc/mounts; then +# FAT partition mounted + mkdir -p /home/user/MyDocs/wagic + mkdir -p /home/user/MyDocs/wagic/Res +# Size used on the FAT partition + usedSize=`du -s /home/user/MyDocs/wagic/Res | awk '{print $1}'` +# Size needed on the FAT partition + dirSize=`du -s /home/user/wagic/Res | awk '{print $1}'` +# Size available on the FAT partition + avaSize=`df | grep /dev/mmcblk0p1 | awk '{print $4}'` + if [ $usedSize -lt 100 ] + then if [ $avaSize -gt $dirSize ] + then + echo "Copying resources on the FAT partition to ease customization" + cp -rf /home/user/wagic/Res/* /home/user/MyDocs/wagic/Res + fi + fi +fi + gtk-update-icon-cache -f /usr/share/icons/hicolor exit 0