#!/bin/bash

set -e

if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-remove" ]; then
  if [ -x /etc/mateconf/mateconf.xml.defaults ]; then
    # Disable automatic window opening on mount
    mateconftool-2 --direct --config-source=xml:readwrite:/etc/mateconf/mateconf.xml.defaults \
    -s "/apps/caja/preferences/media_automount_open" --type bool "false"
  fi
  # Fool live-config to make pointlinux-installer icon appear on desktop
  touch /var/lib/dpkg/info/debian-installer-launcher.list
fi
