#!/bin/bash

DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"

function error {
  echo -e "\\e[91m$1\\e[39m"
  exit 1
}

cd ~/'.config/wechat-prefix/dosdevices/c:/Program Files/Tencent/WeChat'
env WINEPREFIX="$HOME/.config/wechat-prefix" wine C:\\windows\\command\\start.exe /Unix $HOME/.config/wechat-prefix/dosdevices/c:/ProgramData/Microsoft/Windows/Start\ Menu/Programs/WeChat/UninstallWeChat.lnk
rm -rf ~/Desktop/WeChat.desktop ~/.local/share/applications/wine/Programs/WeChat

echo -e "Wechat has been uninstalled, but the configuration is still intact. If you want\nto delete WeChat's configuration, run 'rm -rf $HOME/.config/wechat-prefix'"