Hackerl / Wine_Appimage

Appimage For Wine
480 stars 69 forks source link

你能让`winetricks`去工作吗? #25

Closed probonopd closed 5 years ago

probonopd commented 5 years ago

你能让winetricks去工作吗? Can you get winetricks to work?

# Want to install QQintl2.11.exe using winetricks

sudo ln -s $(readlink -f Downloads/Wine_Windows_Program_Loader-3.5-x86_64.AppImage) /usr/bin/wine
sudo touch /usr/bin/wineserver # probably wrong
sudo chmod +x /usr/bin/wineserver # probably wrong

wget "https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks"
WINEPREFIX=$(readlink -f wineprefix) bash winetricks -q ie7 riched20 msctf vcrun2005 cjkfonts
Using winetricks 20181203-next - sha256sum: ad4de4abda1916f775e8d2294aa971ea246eee7097cc9003885a25e544b1027f with wine-3.5 and WINEARCH=win32
installed_file1="======= Ptrace Hook =======
Found Open Syscall: /lib/ld-linux.so.2
Modify Open Syscall: /tmp/.mount_winersyXMq/lib/ld-linux.so.2
------------------------------------------------------
bug: w_metadata adobeair corrupt, might need forward slashes?
------------------------------------------------------

WINEPREFIX=$(readlink -f wineprefix) bash winetricks list
Using winetricks 20181203-next - sha256sum: ad4de4abda1916f775e8d2294aa971ea246eee7097cc9003885a25e544b1027f with wine-3.5 and WINEARCH=win32
installed_file1="======= Ptrace Hook =======
Found Open Syscall: /lib/ld-linux.so.2
Modify Open Syscall: /tmp/.mount_winersyXMq/lib/ld-linux.so.2
------------------------------------------------------
bug: w_metadata adobeair corrupt, might need forward slashes?
------------------------------------------------------
Hackerl commented 5 years ago

我之前为了调试preloaderhook.c,所以让preloaderhook.c输出了一些信息,但可能会影响其余程序的工作。 将preloaderhook.c中的printf函数调用都删掉,就可以工作了。


I used to debug preloaderhook.c, so let preloaderhook.c output some information, but it may affect the work of other programs. Delete the printf function call in preloaderhook.c and it will work.

preloaderhook.c : https://github.com/Hackerl/Wine_Appimage/blob/master/preloaderhook.c

probonopd commented 5 years ago
me@host:~$ wget "https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks"

me@host:~$ WINEPREFIX=$(readlink -f wineprefix) bash winetricks -q ie7 riched20 msctf vcrun2005 cjkfonts
------------------------------------------------------
wineserver not found!
------------------------------------------------------

me@host:~$ sudo touch /usr/bin/wineserver
me@host:~$ WINEPREFIX=$(readlink -f wineprefix) bash winetricks -q ie7 riched20 msctf vcrun2005 cjkfonts
------------------------------------------------------
wineserver not found!
------------------------------------------------------

me@host:~$ sudo chmod +x /usr/bin/wineserver 
me@host:~$ WINEPREFIX=$(readlink -f wineprefix) bash winetricks -q ie7 riched20 msctf vcrun2005 cjkfonts
Using winetricks 20181203-next - sha256sum:
...
probonopd commented 5 years ago
wget "https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks"
sudo touch /usr/bin/wineserver
sudo chmod +x /usr/bin/wineserver 
rm -rf wineprefix/
WINEPREFIX=$(readlink -f wineprefix) bash winetricks -q ie7
WINEPREFIX=$(readlink -f wineprefix) "wine" 'C:\Program Files\\Internet Explorer\\iexplore'
# Crash

是不是因为上面的sudo touch /usr/bin/wineserver技巧?


Can it be due to the sudo touch /usr/bin/wineserver trick above?

Hackerl commented 5 years ago

如果只是需要运行环境,暴露出wine程序已经足够了。如果想使用别的程序,例如wineserver,需要修改一下脚本。


If you just need to runing time, it is enough to expose the wine program. If you want to use another program, such as wineserver, you need to modify the script. AppRun:

#!/bin/bash
HERE="$(dirname "$(readlink -f "${0}")")"

export LD_LIBRARY_PATH="$HERE/usr/lib":$LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$HERE/usr/lib/i386-linux-gnu":$LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$HERE/lib":$LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$HERE/lib/i386-linux-gnu":$LD_LIBRARY_PATH

#Sound Library
export LD_LIBRARY_PATH="$HERE/usr/lib/i386-linux-gnu/pulseaudio":$LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$HERE/usr/lib/i386-linux-gnu/alsa-lib":$LD_LIBRARY_PATH

#LD
export WINELDLIBRARY="$HERE/lib/ld-linux.so.2"

while getopts "a:c:" arg
do
        case $arg in
             a)
                Args="$OPTARG"
                ;;

             c)
                Command="$OPTARG"
                echo "Run Command: $Command"
                ;;
             ?)
                echo "unkonw argument"
        exit 1
        ;;
        esac
done

if [ -n "$Command" ] ; then
    if [ -n "$Args" ] ; then
        LD_PRELOAD="$HERE/bin/libhookexecv.so" "$WINELDLIBRARY" "$HERE/bin/$Command" "$Args" | cat
    else
        LD_PRELOAD="$HERE/bin/libhookexecv.so" "$WINELDLIBRARY" "$HERE/bin/$Command" | cat
    fi
else
    LD_PRELOAD="$HERE/bin/libhookexecv.so" "$WINELDLIBRARY" "$HERE/bin/wine" "$@" | cat
fi

/usr/bin/wineserver :

#!/bin/bash
wine -c wineserver -a "$@"

winetricks 工作正常,如果不能运行,或许是wine本身导致的。 以上只是一个示范,你可以做更加细致的修改。


The winetricks work fine, and if it doesn't work, it may be caused by wine itself. The above is just a demonstration, you can make more detailed modifications.

https://github.com/Winetricks/winetricks/issues/911

Hackerl commented 5 years ago

Ie8 runs successfully.

winetricks ie8
wine 'C:\Program Files\Internet Explorer\iexplore.exe

image

Hackerl commented 5 years ago

/usr/bin/winecmd -> AppRun:

#!/bin/bash
HERE="$(dirname "$(readlink -f "${0}")")"

export LD_LIBRARY_PATH="$HERE/usr/lib":$LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$HERE/usr/lib/i386-linux-gnu":$LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$HERE/lib":$LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$HERE/lib/i386-linux-gnu":$LD_LIBRARY_PATH

#Sound Library
export LD_LIBRARY_PATH="$HERE/usr/lib/i386-linux-gnu/pulseaudio":$LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$HERE/usr/lib/i386-linux-gnu/alsa-lib":$LD_LIBRARY_PATH

#LD
export WINELDLIBRARY="$HERE/lib/ld-linux.so.2"

if [ -n "$*" ] ; then
    LD_PRELOAD="$HERE/bin/libhookexecv.so" "$WINELDLIBRARY" "$HERE/bin/$@" | cat
fi

/usr/bin/wine:

winecmd wine "$@"

/usr/bin/wineserver:

winecmd wineserver "$@"