CURRENT_PATH="/opt/apps/com.exunsteno.main/files/Exunsteno"
CURRENT_File="$CURRENT_PATH/ExunMain.exe"
if [ -f "$CURRENT_File" ]; then
	echo "开始升级ExunMain程序文件……"
	sudo rm "$CURRENT_File"
	sudo cp "ExunMain.exe" "$CURRENT_PATH"
	sudo chmod 755 "$CURRENT_File"
fi

CURRENT_DIR=$(pwd)
CURRENT_USER=$(who | cut -d ' ' -f 1)
if [ -d "/home/$CURRENT_USER/.local/share/deepin-wine-bottles/bottles" ]; then
	cd $(find /home/$CURRENT_USER/.local/share/deepin-wine-bottles/bottles  -type d -name "Exunmain_setup*")
	CURRENT_SUBDIR=$(basename `pwd`)
	cd $CURRENT_DIR
	CURRENT_PATH="/home/$CURRENT_USER/.local/share/deepin-wine-bottles/bottles/$CURRENT_SUBDIR/dosdevices/c:/Program Files (x86)/Exunsteno"
	CURRENT_File="$CURRENT_PATH/ExunMain.exe"
	if [ -f "$CURRENT_File" ]; then
		echo "开始升级统信Windows应用兼容引擎程序文件……"
		rm "$CURRENT_File"
		cp "ExunMain.exe" "$CURRENT_PATH"
	fi
fi

CURRENT_USER=$(who)
CURRENT_USER=$(echo "$CURRENT_USER" | cut -d' ' -f1)
CURRENT_PATH="/home/$CURRENT_USER/.okylin-wine/Exun/drive_c/Program Files (x86)/Exunsteno"
CURRENT_File="$CURRENT_PATH/ExunMain.exe"
if [ -f "$CURRENT_File" ]; then
	echo "开始升级麒麟Wine助手-Exun容器文件……"
	rm "$CURRENT_File"
	cp "ExunMain.exe" "$CURRENT_PATH"
fi

CURRENT_USER=$(who)
CURRENT_USER=$(echo "$CURRENT_USER" | cut -d' ' -f1)
CURRENT_PATH="/home/$CURRENT_USER/.kylinwine/exunmain/drive_c/Program Files (x86)/Exunsteno"
CURRENT_File="$CURRENT_PATH/ExunMain.exe"
if [ -f "$CURRENT_File" ]; then
	echo "开始升级麒麟Wine助手-Exunmain容器文件……"
	rm "$CURRENT_File"
	cp "ExunMain.exe" "$CURRENT_PATH"
fi

CURRENT_USER=$(who)
CURRENT_USER=$(echo "$CURRENT_USER" | cut -d' ' -f1)
CURRENT_PATH="/home/$CURRENT_USER/.cxoffice/ExunMain/drive_c/Program Files/Exunsteno"
CURRENT_File="$CURRENT_PATH/ExunMain.exe"
if [ -f "$CURRENT_File" ]; then
	echo "开始升级CrossOver文件……"
	rm "$CURRENT_File"
	cp "ExunMain.exe" "$CURRENT_PATH"
fi

CURRENT_USER=$(who)
CURRENT_USER=$(echo "$CURRENT_USER" | cut -d' ' -f1)
CURRENT_PATH="/home/$CURRENT_USER/.local/share/wineprefixes/exun/drive_c/Program Files/exunsteno"
CURRENT_File="$CURRENT_PATH/ExunMain.exe"
if [ -f "$CURRENT_File" ]; then
	echo "开始升级银河麒麟龙芯版文件……"
	rm "$CURRENT_File"
	cp "ExunMain.exe" "$CURRENT_PATH"
fi

echo "OK!"
