Windows Application only starts in a Terminal

Questions about Wine on Linux
Locked
meyer
Level 3
Level 3
Posts: 50
Joined: Sat Jul 15, 2017 2:38 am

Windows Application only starts in a Terminal

Post by meyer »

I'm on Xubuntu 20.04 with Wine 5.8. I use Avisynth+ and AvsPmod (an editor for avisynth). I know there is a linux port of avisynth+ but the most filters are windows only. AvsPmod can open *.avs scripts and edit them with a preview of the video. I open the scripts using the Open with function in thunar or nemo.

With Wine 7.0.1 (stable), Wine 7.22 (devel) and Wine 8.0 RC2 on ubuntu 20.04 and 22.04 this doesn't work. When i right click on a avs file and choose avspmod the program is opened for a short moment and closed. avspmod works when i use a terminal

Code: Select all

env WINEPREFIX=/home/meyer/.wine wine "/home/meyer/.wine/drive_c/Program Files/AvsPmod/AvsPmod.exe" script.avs
or when i enable terminal in the desktop file

Code: Select all

Terminal=true
Then every time avspmod opens a avs script a terminal window is opened.

Other windows applications are working. I can open avs scripts in virtualdub without problems. That terminal window is very annoying.
meyer
Level 3
Level 3
Posts: 50
Joined: Sat Jul 15, 2017 2:38 am

Re: Windows Application only starts in a Terminal

Post by meyer »

No idea?
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: Windows Application only starts in a Terminal

Post by jkfloris »

or when i enable terminal in the desktop file
Could you post the complete .desktop-file?
meyer
Level 3
Level 3
Posts: 50
Joined: Sat Jul 15, 2017 2:38 am

Re: Windows Application only starts in a Terminal

Post by meyer »

This doesn't work because of "Terminal=false":
[Desktop Entry]
Name=AvsPmod
Exec=env WINEARCH=win32 WINEPREFIX="/home/meyer/.wine" wine "/home/meyer/.wine/drive_c/Program Files/AvsPmod/AvsPmod.exe"
Type=Application
StartupNotify=true
Icon=avspmod
Terminal=false
this works:
[Desktop Entry]
Name=AvsPmod
Exec=env WINEARCH=win32 WINEPREFIX="/home/meyer/.wine" wine "/home/meyer/.wine/drive_c/Program Files/AvsPmod/AvsPmod.exe"
Type=Application
StartupNotify=true
Icon=avspmod
Terminal=true
the problem only occurs with this program.
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: Windows Application only starts in a Terminal

Post by jkfloris »

It looks like you are using the default wineprefix. Therefore, you don't need to use the WINEPREFIX variable. The WINEARCH variable can only be used when creating the prefix, so you can leave that out as well. On the other hand, it is also not bad to use them.

Could you try the following desktop files with the wine start (/unix) command?

Code: Select all

[Desktop Entry]
Name=AvsPmod
Exec=env wine start "C:\\Program Files\\AvsPmod\\AvsPmod.exe" %f
Type=Application
Icon=avspmod
Or with all variables:

Code: Select all

[Desktop Entry]
Name=AvsPmod
Exec=env WINEARCH=win32 WINEPREFIX="/home/meyer/.wine" wine start /unix "/home/meyer/.wine/drive_c/Program Files/AvsPmod/AvsPmod.exe" %f
Type=Application
StartupNotify=true
Icon=avspmod
Terminal=false
meyer
Level 3
Level 3
Posts: 50
Joined: Sat Jul 15, 2017 2:38 am

Re: Windows Application only starts in a Terminal

Post by meyer »

Works, thank you.

What is the difference? I never had problems using the "unix path".
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: Windows Application only starts in a Terminal

Post by jkfloris »

I think this is related to the program. If I try to start AvsPmod without wine start the program creates a error_log.txt file with:

Code: Select all

Traceback (most recent call last):
  File "run.py", line 43, in <module>
  File "avsp.pyo", line 18060, in main
  File "wx\_core.pyo", line 7981, in __init__
  File "wx\_core.pyo", line 7555, in _BootstrapApp
  File "avsp.pyo", line 18047, in OnInit
  File "avsp.pyo", line 5385, in __init__
  File "avsp.pyo", line 5532, in ProcessArguments
LookupError: unknown encoding: cp0
Somehow the encoding is not being properly passed to Wine. Whether this is a bug in Python 2.7, the program or in Wine, I don't know.
Locked