diff options
author | Vufa | 2022-04-19 00:20:15 +0800 |
---|---|---|
committer | Vufa | 2022-04-19 00:20:15 +0800 |
commit | cc55df523a271aa779407dbcfeb8887b6ed7c491 (patch) | |
tree | 2d1f82788f0e883be367437c6db8f19c923ab2e0 /run.sh | |
parent | f9728a1b4f1c033843a5cf453eb0ddaf4ca98b19 (diff) | |
download | aur-cc55df523a271aa779407dbcfeb8887b6ed7c491.tar.gz |
generate 'PACKAGE_VERSION' file after installation.
Signed-off-by: Vufa <countstarlight@gmail.com>
Diffstat (limited to 'run.sh')
-rwxr-xr-x | run.sh | 32 |
1 files changed, 30 insertions, 2 deletions
@@ -12,8 +12,10 @@ version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; BOTTLENAME="Deepin-TIM" APPVER="9.3.2deepin20" WINEPREFIX="$HOME/.deepinwine/$BOTTLENAME" +TIM_FONTS="$WINEPREFIX/drive_c/windows/Fonts" TIM_VER="3.3.9.22051" EXEC_PATH="c:/Program Files/Tencent/TIM/Bin/TIM.exe" +EXEC_FILE="$WINEPREFIX/drive_c/Program Files/Tencent/TIM/Bin/TIM.exe" START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh" TIM_INSTALLER_PATH="c:/Program Files/Tencent/TIM$TIM_VER.exe" export MIME_TYPE="" @@ -32,6 +34,28 @@ OpenWinecfg() env WINEPREFIX=$WINEPREFIX $APPRUN_CMD winecfg } +DeployApp() +{ + # backup fonts + if [ -d "$TIM_FONTS" ];then + mkdir -p $HOME/.deepinwine/.tim_tmp + cp $TIM_FONTS/* $HOME/.deepinwine/.tim_tmp/ + fi + + # re-deploy bottle + rm -rf "$WINEPREFIX" + # run installer + env LC_ALL=zh_CN.UTF-8 WINEDLLOVERRIDES="winemenubuilder.exe=d" $START_SHELL_PATH $BOTTLENAME $APPVER "$TIM_INSTALLER_PATH" "$@" + + # restore fonts + if [ -d "$HOME/.deepinwine/.tim_tmp" ];then + cp -n $HOME/.deepinwine/.tim_tmp/* $TIM_FONTS/ + rm -rf "$HOME/.deepinwine/.tim_tmp" + fi + touch $WINEPREFIX/reinstalled + cat /opt/apps/$DEB_PACKAGE_NAME/files/files.md5sum > $WINEPREFIX/PACKAGE_VERSION +} + Run() { if [ -z "$DISABLE_ATTACH_FILE_DIALOG" ];then @@ -40,9 +64,13 @@ Run() if [ -n "$EXEC_PATH" ];then if [ ! -f "$WINEPREFIX/reinstalled" ];then - env LC_ALL=zh_CN.UTF-8 WINEDLLOVERRIDES="winemenubuilder.exe=d" $START_SHELL_PATH $BOTTLENAME $APPVER "$TIM_INSTALLER_PATH" "$@" - touch $WINEPREFIX/reinstalled + DeployApp else + # missing exec file + if [ ! -f "$EXEC_FILE" ];then + DeployApp + fi + env LC_ALL=zh_CN.UTF-8 $START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" "$@" fi else |