summarylogtreecommitdiffstats
path: root/yozo-office.install
blob: c0aae4ec522aeacd290c45792b6533b79a126f1a (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/sh
pre_install() {
    if [ "$1" = "8.0.1331.101ZH.S1-3" ]; then 
        if ! pacman -Qs yozo-office | grep -qi 'local'; then
            if [ -f /etc/Yozosoft/Yozo_Office/installinfo.cfg ]; then
                echo "Yozo Office is exist. Please uninstall Yozo Office, then install this office."
                exit 1
            fi
            if [ -f /etc/Evermore/EIOffice/installinfo.cfg ]; then
                echo "EIOffice is exist. Please uninstall EIOffice, then install this office."
                exit 1
            fi
        fi
    fi

    if [ "$1" = "8.0.1331.101ZH.S1-3" ]; then
        if [ -f /opt/Yozosoft/Yozo_Office/System/doExit ]; then
            /opt/Yozosoft/Yozo_Office/System/doExit -check
            if [ $? -ne 0 ]; then
                echo "Yozo Office is running. Please stop Yozo Office, then upgrade."
                exit 1
            fi
         fi
    fi

    exit 0

}
post_install() {
  # cd /usr/lib/jvm/java-8-openjdk/jre/lib
  # for i in *; do
  #    if [ "$i" != "ext" ]; then
  #        ln -sf /usr/lib/jvm/java-8-openjdk/jre/lib/$i /opt/Yozosoft/Yozo_Office/Jre/lib/$i
  #    fi
  #done
  # post_upgrade

    target=/opt/Yozosoft/Yozo_Office
    if [ "$1" = "8.0.1331.101ZH.S1-3" ]; then
        if [ -z "$2" ]; then
            echo "Configuring system. Please wait a while."
            $target/Jre/bin/java -jar $target/System/configure.jar -i
        fi
        $target/Jre/bin/deployApplet -default -nogui
        echo "Congratulations! Installation is complete. Please restart your computer."
    fi
    exit 0
}
post_upgrade() {
    xdg-icon-resource forceupdate --theme hicolor &>/dev/null
    update-mime-database /usr/share/mime &>/dev/null
    update-desktop-database -q &>/dev/null
}
pre_remove() {
    target=/opt/Yozosoft/Yozo_Office
    if [ "$1" = "8.0.1331.101ZH.S1-3" ]; then
        $target/System/doExit -check
        if [ $? -ne 0 ]; then
            echo "Yozo Office is running. Please stop Yozo Office, then uninstall."
            exit 1
        fi
        echo "Configuring system. Please wait a while."

        if [ -f $target/System/unpatch.ini ]; then
            while read line
            do
                truncate=${line#*=}
                if [ -f $truncate ]; then
                    rm -f $truncate
                fi
            done < $target/System/unpatch.ini
        fi

        $target/Jre/bin/java -jar $target/System/configure.jar -u
        rm /etc/skel/.java/deployment/deployment.properties

        rm -rf $HOME/.Yozo_Office/UserConfig
        if [ -f $target/patcheio.log ]; then
            rm -f $target/patcheio.log
        fi
        if [ -d $HOME/.Yozo_Office/CustomizedSEImages ]; then
            rm -rf $HOME/.Yozo_Office/CustomizedSEImages
        fi
        #rm -f $target/ScienceEditorImages/logicalData $target/ScienceEditorImages/logicalData_0 $target/#ScienceEditorImages/logicalData_1 $target/ScienceEditorImages/logicalData_2
        #if [ -d $target/ScienceEditorImages ]; then 
        #    rm -rf $target/ScienceEditorImages &>/dev/null
        #fi
        rm -rf $target/Config/Key.store
        rm -rf $target/System
        rm -rf $target/Upgrade/Patch
        rm -rf $target/Jre/lib
    fi
    exit 0
}