Always use the Windows environment in WSL

This commit is contained in:
Howard20181 2023-01-02 16:19:10 +08:00
parent ebb7a7f548
commit c4d06eecd0
2 changed files with 4 additions and 6 deletions

View File

@ -647,10 +647,10 @@ cp "$WORK_DIR"/wsa/"$ARCH"/resources.pri "$WORK_DIR"/wsa/pri/en-us.pri \
</index> </index>
</resources> </resources>
EOF EOF
if [ ! -f /proc/sys/fs/binfmt_misc/WSLInterop ] || which wine64 > /dev/null; then if [ -f /proc/sys/fs/binfmt_misc/WSLInterop ]; then
wine64 ../wine/"$HOST_ARCH"/makepri.exe new /pr "$WORK_DIR"/wsa/pri /in MicrosoftCorporationII.WindowsSubsystemForAndroid /cf "$WORK_DIR"/wsa/priconfig.xml /of "$WORK_DIR"/wsa/"$ARCH"/resources.pri /o
else
../wine/"$HOST_ARCH"/makepri.exe new /pr "$(wslpath -w "$WORK_DIR"/wsa/pri)" /in MicrosoftCorporationII.WindowsSubsystemForAndroid /cf "$(wslpath -w "$WORK_DIR"/wsa/priconfig.xml)" /of "$(wslpath -w "$WORK_DIR"/wsa/"$ARCH"/resources.pri)" /o ../wine/"$HOST_ARCH"/makepri.exe new /pr "$(wslpath -w "$WORK_DIR"/wsa/pri)" /in MicrosoftCorporationII.WindowsSubsystemForAndroid /cf "$(wslpath -w "$WORK_DIR"/wsa/priconfig.xml)" /of "$(wslpath -w "$WORK_DIR"/wsa/"$ARCH"/resources.pri)" /o
elif which wine64 > /dev/null; then
wine64 ../wine/"$HOST_ARCH"/makepri.exe new /pr "$WORK_DIR"/wsa/pri /in MicrosoftCorporationII.WindowsSubsystemForAndroid /cf "$WORK_DIR"/wsa/priconfig.xml /of "$WORK_DIR"/wsa/"$ARCH"/resources.pri /o
fi fi
sed -i -zE "s/<Resources.*Resources>/<Resources>\n$(cat "$WORK_DIR"/wsa/xml/* | grep -Po '<Resource [^>]*/>' | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/\$/\\$/g' | sed 's/\//\\\//g')\n<\/Resources>/g" "$WORK_DIR"/wsa/"$ARCH"/AppxManifest.xml sed -i -zE "s/<Resources.*Resources>/<Resources>\n$(cat "$WORK_DIR"/wsa/xml/* | grep -Po '<Resource [^>]*/>' | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/\$/\\$/g' | sed 's/\//\\\//g')\n<\/Resources>/g" "$WORK_DIR"/wsa/"$ARCH"/AppxManifest.xml
echo -e "Merge Language Resources done\n" echo -e "Merge Language Resources done\n"

View File

@ -46,8 +46,6 @@ check_dependencies() {
command -v lzip >/dev/null 2>&1 || NEED_INSTALL+=("lzip") command -v lzip >/dev/null 2>&1 || NEED_INSTALL+=("lzip")
if [ ! -f /proc/sys/fs/binfmt_misc/WSLInterop ]; then if [ ! -f /proc/sys/fs/binfmt_misc/WSLInterop ]; then
command -v wine64 >/dev/null 2>&1 || NEED_INSTALL+=("wine") command -v wine64 >/dev/null 2>&1 || NEED_INSTALL+=("wine")
fi
if [ ! -f /proc/sys/fs/binfmt_misc/WSLInterop ] || which wine64 > /dev/null; then
command -v winetricks >/dev/null 2>&1 || NEED_INSTALL+=("winetricks") command -v winetricks >/dev/null 2>&1 || NEED_INSTALL+=("winetricks")
fi fi
command -v patchelf >/dev/null 2>&1 || NEED_INSTALL+=("patchelf") command -v patchelf >/dev/null 2>&1 || NEED_INSTALL+=("patchelf")
@ -126,7 +124,7 @@ if [ -n "${NEED_INSTALL[*]}" ]; then
fi fi
pip list --disable-pip-version-check | grep -E "^requests " >/dev/null 2>&1 || python3 -m pip install requests pip list --disable-pip-version-check | grep -E "^requests " >/dev/null 2>&1 || python3 -m pip install requests
if [ ! -f /proc/sys/fs/binfmt_misc/WSLInterop ] || which wine64 > /dev/null; then if [ ! -f /proc/sys/fs/binfmt_misc/WSLInterop ] && which wine64 > /dev/null; then
winetricks list-installed | grep -E "^msxml6" >/dev/null 2>&1 || { winetricks list-installed | grep -E "^msxml6" >/dev/null 2>&1 || {
cp -r ../wine/.cache/* ~/.cache cp -r ../wine/.cache/* ~/.cache
winetricks msxml6 || abort winetricks msxml6 || abort