Winetricks / winetricks

Winetricks is an easy way to work around problems in Wine
GNU Lesser General Public License v2.1
2.77k stars 402 forks source link

Wont run in ubuntu 23.04 #2119

Closed Master811129 closed 8 months ago

Master811129 commented 1 year ago

simply running winetricks won't open the gui. Removing .wine didn't help.

wine version: wine-8.0 (Ubuntu 8.0~repack-4)

~$ winetricks
Executing mkdir -p /home/ubuntu
------------------------------------------------------
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
------------------------------------------------------
WINEPREFIX INFO:
Drive C: total 28
drwxrwxr-x  7 ubuntu ubuntu 4096 سپتامبر 17 23:53 .
drwxrwxr-x  4 ubuntu ubuntu 4096 سپتامبر 18 15:36 ..
drwxrwxr-x  3 ubuntu ubuntu 4096 سپتامبر 17 23:53 ProgramData
drwxrwxr-x  6 ubuntu ubuntu 4096 سپتامبر 17 23:53 Program Files
drwxrwxr-x  6 ubuntu ubuntu 4096 سپتامبر 17 23:53 Program Files (x86)
drwxrwxr-x  4 ubuntu ubuntu 4096 سپتامبر 17 23:53 users
drwxrwxr-x 18 ubuntu ubuntu 4096 سپتامبر 17 23:53 windows

Registry info:
/home/ubuntu/.wine/system.reg:#arch=win64
/home/ubuntu/.wine/user.reg:#arch=win64
/home/ubuntu/.wine/userdef.reg:#arch=win64
------------------------------------------------------
------------------------------------------------------
warning: wine cmd.exe /c echo '%AppData%' returned empty string, error message "" 
------------------------------------------------------

it says: warning: wine cmd.exe /c echo '%AppData%' returned empty string, error message "" interestingly, when i copy paste the command in the warning into terminal it gives me a string like this:

~$ wine cmd.exe /c echo '%AppData%'
C:\users\ubuntu\AppData\Roaming
spiral009 commented 1 year ago

Same

root@localhost:~# ./winetricks  ie8
------------------------------------------------------
warning: Running Wine/winetricks as root is highly discouraged. See https://wiki.winehq.org/FAQ#Should_I_run_Wine_as_root.3F
------------------------------------------------------
/usr/bin/od: wine: No such file or directory
------------------------------------------------------
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
------------------------------------------------------
WINEPREFIX INFO:
Drive C: total 25
drwxr-xr-x.  7 root root 3488 Sep 24 17:19 .
drwxr-xr-x.  4 root root 3488 Sep 24 17:57 ..
drwxr-xr-x.  6 root root 3488 Sep 24 17:19 Program Files
drwxr-xr-x.  6 root root 3488 Sep 24 17:20 Program Files (x86)
drwxr-xr-x.  3 root root 3488 Sep 24 17:19 ProgramData
drwxr-xr-x.  4 root root 3488 Sep 24 17:19 users
drwxr-xr-x. 19 root root 3488 Sep 24 17:44 windows

Registry info:
/root/.wine/system.reg:#arch=win64
/root/.wine/user.reg:#arch=win64
/root/.wine/userdef.reg:#arch=win64
------------------------------------------------------
------------------------------------------------------
warning: wine cmd.exe /c echo '%AppData%' returned empty string, error message ""
------------------------------------------------------

Also is ie8 going to work? I really need that activex 20230212-next - sha256sum: cf1e17a69db4126779e597def9facdecbb0703a20ed7172dd877b1f7824d66ec

Chiitoo commented 1 year ago

Do you get any different results with something like:


LANG="" winetrics

Ca set the lang to 'us' or something like that too to try.

For the second comment, do you really want to run this as 'root'? That will probably be causing more issues than not later.

spiral009 commented 1 year ago

Same,I can't run anything as non root as I'm using a chroot LANG variable isn't set in the environment

root@localhost:~# LANG="en_US.UTF-8" ./winetricks ie8                                                                                                   ------------------------------------------------------                      warning: Running Wine/winetricks as root is highly discouraged. See https://wiki.winehq.org/FAQ#Should_I_run_Wine_as_root.3F                            ------------------------------------------------------                      od: wine: No such file or directory                                         ------------------------------------------------------                      warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.                            ------------------------------------------------------                      ------------------------------------------------------                      WINEPREFIX INFO:                                                            Drive C: total 25                                                           drwxr-xr-x.  7 root root 3488 Sep 24 17:19 .                                drwxr-xr-x.  4 root root 3488 Sep 24 19:31 ..                               drwxr-xr-x.  3 root root 3488 Sep 24 17:19 ProgramData                      drwxr-xr-x.  6 root root 3488 Sep 24 17:19 Program Files                    drwxr-xr-x.  6 root root 3488 Sep 24 17:20 Program Files (x86)              drwxr-xr-x.  4 root root 3488 Sep 24 17:19 users                            drwxr-xr-x. 19 root root 3488 Sep 24 17:44 windows                                                                                                      Registry info:                                                              /root/.wine/system.reg:#arch=win64                                          /root/.wine/userdef.reg:#arch=win64                                         /root/.wine/user.reg:#arch=win64                                            ------------------------------------------------------                      ------------------------------------------------------                      warning: wine cmd.exe /c echo '%AppData%' returned empty string, error message ""                                                                       ----------------------------------------------------
Master811129 commented 1 year ago

@Chiitoo I did some tests with LANG

~$ echo $LANG
en_US.UTF-8
~$ LANG="" winetricks
Executing mkdir -p /home/ubuntu
------------------------------------------------------
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
------------------------------------------------------
WINEPREFIX INFO:
Drive C: total 28
drwxrwxr-x  7 ubuntu ubuntu 4096 سپتامب 17 23:53 .
drwxrwxr-x  4 ubuntu ubuntu 4096 سپتامب 24 21:41 ..
drwxrwxr-x  6 ubuntu ubuntu 4096 سپتامب 17 23:53 Program Files
drwxrwxr-x  6 ubuntu ubuntu 4096 سپتامب 17 23:53 Program Files (x86)
drwxrwxr-x  3 ubuntu ubuntu 4096 سپتامب 17 23:53 ProgramData
drwxrwxr-x  4 ubuntu ubuntu 4096 سپتامب 17 23:53 users
drwxrwxr-x 18 ubuntu ubuntu 4096 سپتامب 17 23:53 windows

Registry info:
/home/ubuntu/.wine/system.reg:#arch=win64
/home/ubuntu/.wine/user.reg:#arch=win64
/home/ubuntu/.wine/userdef.reg:#arch=win64
------------------------------------------------------
------------------------------------------------------
warning: wine cmd.exe /c echo '%AppData%' returned empty string, error message "" 
------------------------------------------------------
~$ LANG="us" winetricks
Executing mkdir -p /home/ubuntu
------------------------------------------------------
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
------------------------------------------------------
WINEPREFIX INFO:
Drive C: total 28
drwxrwxr-x  7 ubuntu ubuntu 4096 Sep 17 23:53 .
drwxrwxr-x  4 ubuntu ubuntu 4096 Sep 24 23:14 ..
drwxrwxr-x  6 ubuntu ubuntu 4096 Sep 17 23:53 Program Files
drwxrwxr-x  6 ubuntu ubuntu 4096 Sep 17 23:53 Program Files (x86)
drwxrwxr-x  3 ubuntu ubuntu 4096 Sep 17 23:53 ProgramData
drwxrwxr-x  4 ubuntu ubuntu 4096 Sep 17 23:53 users
drwxrwxr-x 18 ubuntu ubuntu 4096 Sep 17 23:53 windows

Registry info:
/home/ubuntu/.wine/system.reg:#arch=win64
/home/ubuntu/.wine/user.reg:#arch=win64
/home/ubuntu/.wine/userdef.reg:#arch=win64
------------------------------------------------------
------------------------------------------------------
warning: wine cmd.exe /c echo '%AppData%' returned empty string, error message "" 
------------------------------------------------------
~$ LANG="en_US" winetricks
Executing mkdir -p /home/ubuntu
------------------------------------------------------
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
------------------------------------------------------
WINEPREFIX INFO:
Drive C: total 28
drwxrwxr-x  7 ubuntu ubuntu 4096 Sep 17 23:53 .
drwxrwxr-x  4 ubuntu ubuntu 4096 Sep 24 23:14 ..
drwxrwxr-x  6 ubuntu ubuntu 4096 Sep 17 23:53 Program Files
drwxrwxr-x  6 ubuntu ubuntu 4096 Sep 17 23:53 Program Files (x86)
drwxrwxr-x  3 ubuntu ubuntu 4096 Sep 17 23:53 ProgramData
drwxrwxr-x  4 ubuntu ubuntu 4096 Sep 17 23:53 users
drwxrwxr-x 18 ubuntu ubuntu 4096 Sep 17 23:53 windows

Registry info:
/home/ubuntu/.wine/system.reg:#arch=win64
/home/ubuntu/.wine/user.reg:#arch=win64
/home/ubuntu/.wine/userdef.reg:#arch=win64
------------------------------------------------------
------------------------------------------------------
warning: wine cmd.exe /c echo '%AppData%' returned empty string, error message "" 
------------------------------------------------------

So nothing changed.

GuillaumeCisco commented 11 months ago

I have the exact same issue, using LANG does not help either... I thought that I had an issue first with lutris using winetricks, but it looks like indeed the issue is about ubuntu 23.04.

Any tests we could run on our end?

Chiitoo commented 11 months ago

I set up an Ubuntu 23.10 virtual machine, and tried installing Winetricks via apt, which got me version 20230212, and it does run.

It seems it does so due to a Debian patch [1] they carry:

Description: Workaround case where wine and related binaries are in /usr/bin, but wine64 is only
  in Wine's bindir.
Author: Jens Reyer <jre.winesim@gmail.com>
Forwarded: https://github.com/Winetricks/winetricks/pull/2035
Last-Update: 2023-02-26

--- a/src/winetricks
+++ b/src/winetricks
@@ -4922,10 +4922,17 @@ winetricks_set_wineprefix()
         elif command -v "${WINE}64" >/dev/null 2>&1; then
             WINE64="${WINE}64"
         else
-            # Handle case where wine binaries (or binary wrappers) have a suffix
-            WINE64="$(dirname "${WINE}")/"
-            [ "${WINE64}" = "./" ] && WINE64=""
-            WINE64="${WINE64}$(basename "${WINE}" | sed 's/^wine/wine64/')"
+            WINE_BINDIR="$(dirname "$(readlink -f /usr/bin/wineboot 2>/dev/null)" 2>/dev/null)"
+            if [ -x "${WINE_BINDIR}/wine64" ]; then
+                # Workaround case where wine and related binaries are in /usr/bin, but wine64 is only
+                # in Wine's bindir
+                WINE64="${WINE_BINDIR}/wine64"
+            else
+                # Handle case where wine binaries (or binary wrappers) have a suffix
+                WINE64="$(dirname "${WINE}")/"
+                [ "${WINE64}" = "./" ] && WINE64=""
+                WINE64="${WINE64}$(basename "${WINE}" | sed 's/^wine/wine64/')"
+            fi
         fi
         WINE_ARCH="${WINE64}"
         WINE_MULTI="${WINE}"

This change seems to already be under review here:

https://github.com/Winetricks/winetricks/pull/2035

  1. https://sources.debian.org/patches/winetricks/20230212-2/wine64.patch/
GuillaumeCisco commented 11 months ago

I can confirm after adding this patch, it now works correctly.

Master811129 commented 11 months ago

Hello I just upgraded from 23.04 to 23.10 and this issue doesn't exist for me anymore. It looks like it's rather an Ubuntu packaging issue than a winetricks one.

GuillaumeCisco commented 11 months ago

It should not be closed :/ If no custom test is realized, it will never work.

Chiitoo commented 11 months ago

Yeah, I think this can remain open at least until the linked PR is handled, since the issue does prevent running Winetricks without modifications (aside from the packaged one, since that comes with the patche).

kenorb commented 9 months ago

Here are repro steps for Debian:

$ docker run -it debian:latest

Inside Docker container:

# apt update
# DEBIAN_FRONTEND=noninteractive apt -y install ansible git
# ansible-galaxy install git+https://github.com/EA31337/ansible-role-wine.git,dev
# printf -- "- hosts: localhost\n  roles:\n    - ansible-role-wine\n" | ansible-playbook -i "localhost," -c local /dev/stdin -v
# install -v <(wget -qO- https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks) /usr/local/bin/winetricks

Now run:

# winetricks
...
Registry info:
/root/.wine/system.reg:#arch=win64
/root/.wine/user.reg:#arch=win64
/root/.wine/userdef.reg:#arch=win64
------------------------------------------------------
------------------------------------------------------
warning: wine cmd.exe /c echo '%AppData%' returned empty string, error message "" 
# bash -x winetricks
+ printf '%s\nwarning: %b\n%s\n' ------------------------------------------------------ 'wine cmd.exe /c echo '\''%AppData%'\'' returned empty string, error message "" ' ------------------------------------------------------
------------------------------------------------------
warning: wine cmd.exe /c echo '%AppData%' returned empty string, error message "" 
# wine --version
wine-8.0 (Debian 8.0~repack-4)
# lsb_release -a
Description:    Debian GNU/Linux 12 (bookworm)

I've tested %AppData% and it seems it returns the value:

# wine cmd.exe /c echo '%AppData%'
C:\users\root\AppData\Roaming

but winetricks still errors, so it doesn't make much sense.


I've tested PR https://github.com/Winetricks/winetricks/pull/2035 and it seems to work fine:

# install -v <(wget -qO- https://raw.githubusercontent.com/jre-wine/winetricks/Workaround_missing_/usr/bin/wine64/src/winetricks) /usr/local/bin/winetricks
# winetricks
(no errors)
austin987 commented 8 months ago

IMO this is a Debian packaging bug (which they work around by carrying their own patch).

There are similar issues with some other wrappers (protontricks, nixos, according to #2183), but as I wrote there, this is due to their wrappers.

I consider it a WONTFIX. There are a lot of things a wrapper could do, and I don't think it will be trivial to solve this in a generic way. If someone has an idea on how to do that, please submit a PR.

kenorb commented 8 months ago

If someone has an idea on how to do that, please submit a PR.

There is PR at #2035 which I've tested and solved the problem on Debian, is it going to be considered?

austin987 commented 8 months ago

Not in its current form, as it only fixes things for Debian and would break older macOS / possibly other platforms (which I wrote on the PR, but haven't seen any updates).