Skip to content

Commit

Permalink
re-structure
Browse files Browse the repository at this point in the history
  • Loading branch information
huan committed Feb 17, 2020
1 parent 22664f5 commit 02b0847
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -27,6 +27,7 @@ RUN apt-get update \
ca-certificates:amd64 \
cabextract:amd64 \
curl:amd64 \
gosu \
language-pack-zh-hans \
tzdata:amd64 \
unzip:amd64 \
Expand Down Expand Up @@ -57,7 +58,6 @@ ENV \
LC_ALL=zh_CN.UTF-8 \
TZ=Asia/Shanghai

COPY ./entrypoint.sh /
ENTRYPOINT [ "/entrypoint.sh" ]

VOLUME /WechatFiles
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -10,10 +10,12 @@ A Docker Image for Running Windows WeChat on Your Linux Desktop

## Features

1. Tested under Ubuntu 19.10
1. Developed & Tested under Ubuntu 19.10 (WIP...)

## Usage

Under Construction...

## FAQ

### System Tray Icon with Gnome Desktop
Expand Down
18 changes: 16 additions & 2 deletions entrypoint.sh → container_root/entrypoint.sh
Expand Up @@ -3,6 +3,18 @@
set -e
set -x

#
# User Task
#
if [ "$(id -u)" -ne '0' ]; then
su user -c "wine reg QUERY 'HKEY_CURRENT_USER\Software\Tencent\WeChat'"
exec wine 'C:\Program Files\Tencent\WeChat\WeChat.exe'
fi

#
# Root Init
#

if [ -n "$AUDIO_GID" ]; then
groupmod -o -g "$AUDIO_GID" audio
fi
Expand All @@ -23,5 +35,7 @@ chown user:group /WechatFiles
# wine reg DELETE 'HKCU\Software\Tencent\WeChat' NeedUpdateType /f &> /dev/null
# rm "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/WeChat/All Users/config/configEx.ini"

su user -c "wine reg QUERY 'HKEY_CURRENT_USER\Software\Tencent\WeChat'"
su user -c "wine 'C:\Program Files\Tencent\WeChat\WeChat.exe'"
#
# Switch to user:group, and re-run self to run user task
#
exec gosu user:group "$0" "$@"

0 comments on commit 02b0847

Please sign in to comment.