summarylogtreecommitdiffstats
path: root/scrin.io.install
blob: 41ca62bb66d3554a85debeabe1c39f57b6c0af9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
post_install() {
    gtk-update-icon-cache -q -t -f usr/share/icons/hicolor

    if [ -L '/usr/bin/scrin.io' -a -e '/usr/bin/scrin.io' -a "`readlink '/usr/bin/scrin.io'`" != '/etc/alternatives/scrin.io' ]; then
        rm -f '/usr/bin/scrin.io'
    else
        ln -sf '/opt/scrin.io/scrin.io' '/usr/bin/scrin.io'
    fi

    # SUID chrome-sandbox for Electron 5+
    chmod 4755 '/opt/scrin.io/chrome-sandbox' || true

    if hash update-mime-database 2>/dev/null; then
        update-mime-database /usr/share/mime || true
    fi

    if hash update-desktop-database 2>/dev/null; then
        update-desktop-database /usr/share/applications || true
    fi
    update-desktop-database -q
}

post_upgrade() {
    post_install
}

post_remove() {
    gtk-update-icon-cache -q -t -f usr/share/icons/hicolor

    # Delete the link to the binary
    rm -f '/usr/bin/scrin.io'

    update-desktop-database -q
}