CUI: How to disable starting explorer and system tray?

Questions about Wine on Linux
Locked
cj000
Level 2
Level 2
Posts: 12
Joined: Mon Apr 03, 2023 2:06 pm

CUI: How to disable starting explorer and system tray?

Post by cj000 »

I am running Arch Linux (kernel 6.2.9, 64-bit) with pacman installed distribution provided wine package (version "wine-8.5"). No winetricks, and no X11 installed.

I would like to run a console user interface (CUI) executable. Wineconsole fails to do that for both user and curses backends. Thus I am revering to Wine "Bare streams". That runs the application, though outputs a set of fixme warnings and errors before the executable starts. The warnings can easily disabled with "WINEDEBUG=-all". That leaves these error messages:

Code: Select all

0060:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0060:err:winediag:nodrv_CreateWindow L"The explorer process failed to start."
0060:err:systray:initialize_systray Could not create tray window
How can I disable the last two error messages, thus:
1. not starting explorer ("The explorer process failed to start.")
2. not starting system tray (systray) window (Could not create tray window)?

Which environment variable to set and/or registry "hack" to add?
cj000
Level 2
Level 2
Posts: 12
Joined: Mon Apr 03, 2023 2:06 pm

Re: CUI: How to disable starting explorer and system tray?

Post by cj000 »

Please note that I am logged in remotely via ssh.
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: CUI: How to disable starting explorer and system tray?

Post by jkfloris »

Does the program work if you start it with cmd?

Code: Select all

wine cmd /c program.exe
cj000
Level 2
Level 2
Posts: 12
Joined: Mon Apr 03, 2023 2:06 pm

Re: CUI: How to disable starting explorer and system tray?

Post by cj000 »

@jkfloris: There isn't a program.exe not starting issue for:

Code: Select all

wine program.exe
The issue is that wine tries to start unnecessary stuff.

Don't need explorer.exe/systray for a command line app.


For start up speed improvements, I'd like to start as little as possible.
cj000
Level 2
Level 2
Posts: 12
Joined: Mon Apr 03, 2023 2:06 pm

Re: CUI: How to disable starting explorer and system tray?

Post by cj000 »

I'd hope to trigger something like commit bd09340cf2d4dae6e9abd2dd11c532fee7711c41 "else" "TRACE( "not starting explorer since winstation is not visible\n" )" of this "if" in dlls/user32/win.c:

Code: Select all

if (!GetUserObjectInformationW( GetProcessWindowStation(), UOI_FLAGS, &flags,
                                        sizeof(flags), NULL ) || (flags.dwFlags & WSF_VISIBLE))
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: CUI: How to disable starting explorer and system tray?

Post by jkfloris »

You can disable explorer.exe with the WINEDLLOVERRIDES variabele

Code: Select all

WINEDLLOVERRIDES="explorer.exe=d" wine program.exe
The warnings can easily disabled with "WINEDEBUG=-all". That leaves these error messages:
WINEDEBUG=-all should hide all messages, including the err: messages.
Do you also get err: messages if you turn them off with:

Code: Select all

WINEDEBUG="-all,err-all" WINEDLLOVERRIDES="explorer.exe=d" wine program.exe
cj000
Level 2
Level 2
Posts: 12
Joined: Mon Apr 03, 2023 2:06 pm

Re: CUI: How to disable starting explorer and system tray?

Post by cj000 »

WINEDLLOVERRIDES="explorer.exe=d"
is what I need.

The systray window message is gone. Other errors are not gone while starting:

Code: Select all

0034:err:win:get_desktop_window failed to start explorer c0000135
0090:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0090:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0090:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0090:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
00f4:err:win:get_desktop_window failed to start explorer c0000135
00f4:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
00f4:err:winediag:nodrv_CreateWindow L"The explorer process failed to start."
Good news is that the "explorer.exe /desktop" process is no longer started using "wine" or "wineconsole" according to "ps".

PS Using

Code: Select all

WINEDEBUG="-all,err-all" WINEDLLOVERRIDES="explorer.exe=d" wineconsole mbserver.exe
no messages are displayed at all.

Maybe some of the processes can be disabled as well:
  • 850 ? Ssl 0:00 C:\windows\system32\services.exe
  • 853 ? Ssl 0:00 C:\windows\system32\winedevice.exe
  • 877 ? Ssl 0:00 C:\windows\system32\plugplay.exe
  • 884 ? Ssl 0:00 C:\windows\system32\svchost.exe -k LocalServiceNetworkRestricted
Suggestions?
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: CUI: How to disable starting explorer and system tray?

Post by jkfloris »

You can try turning them off one at a time and see what happens.
If the program stops running (properly), you'll know to leave that one on.

You can turn off multiple items by separating them with a comma.

Code: Select all

WINEDLLOVERRIDES="explorer.exe,services.exe=d" wine mbserver.exe
cj000
Level 2
Level 2
Posts: 12
Joined: Mon Apr 03, 2023 2:06 pm

Re: CUI: How to disable starting explorer and system tray?

Post by cj000 »

Thank you very much. This question is now solved.

I couldn't figure the syntax out:

Code: Select all

WINEDLLOVERRIDES="explorer.exe=d,services.exe=d" wine mbserver.exe
was no good.
Last edited by cj000 on Thu Apr 06, 2023 10:23 am, edited 1 time in total.
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: CUI: How to disable starting explorer and system tray?

Post by jkfloris »

When grouping items, use a comma. Between items a semicolon.
For example, you could also use:

Code: Select all

WINEDLLOVERRIDES="explorer.exe=d;services.exe=d" wine mbserver.exe
Locked