Why can I not open the file "/home/user/Downloads/request.txt" with wine-notepad?

Questions about Wine on Linux
Locked
Opako
Level 3
Level 3
Posts: 74
Joined: Mon Jun 08, 2020 9:23 am

Why can I not open the file "/home/user/Downloads/request.txt" with wine-notepad?

Post by Opako »

Why can I not open the file "/home/user/Downloads/request.txt" ?

Terminal:

Input:

Code: Select all

$ env WINEPREFIX="/home/user/.local/share/wineprefixes/Microsoft" /opt/wine-staging/bin/wine start /ProgIDOpen txtfile "/home/user/Downloads/request.txt" 
Output:

Code: Select all

002c:fixme:winediag:LdrInitializeThunk wine-staging 6.5 is a testing version containing experimental patches.
002c:fixme:winediag:LdrInitializeThunk Please mention your exact version when filing bug reports on winehq.org.
00a8:err:plugplay:try_add_device Building report descriptor failed, removing device
00a8:err:plugplay:try_add_device Building report descriptor failed, removing device
0090:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\wineusb": c0000142
003c:fixme:service:scmdatabase_autostart_services Auto-start service L"wineusb" failed to start: 1114
Es konnte keine Anwendung gestartet werden, oder es ist keine Anwendung mit der angegebenen Datei verknüpft.
ShellExecuteEx fehlgeschlagen: Datei nicht gefunden.

user@x:~
$ 0094:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0094:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
wine: Unhandled page fault on write access to 02F0FEFC at address 7E7A2FD8 (thread 012c), starting debugger...
012c:err:seh:start_debugger Couldn't start debugger L"winedbg --auto 132 132" (1115)
Read the Wine Developers Guide on how to set up winedbg or another debugger
^C
Waht's wrong? What do this warnings and errors mean?
Would appreciate some help. Thank you.
Opako
Level 3
Level 3
Posts: 74
Joined: Mon Jun 08, 2020 9:23 am

Re: Why can I not open the file "/home/user/Downloads/request.txt" with wine-notepad?

Post by Opako »

Edit: Addition:

The command is from the content of the file:
/home/user/.local/share/applications/wine-extension-ini.desktop

It's the Exec line:
Exec=env WINEPREFIX="/home/user/.local/share/wineprefixes/Microsoft" /opt/wine-staging/bin/wine start /ProgIDOpen txtfile %f
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Why can I not open the file "/home/user/Downloads/request.txt" with wine-notepad?

Post by jkfloris »

Is notepad the program to open txtfile files?

Code: Select all

WINEPREFIX="/home/user/.local/share/wineprefixes/Microsoft" /opt/wine-staging/bin/wine reg query 'HKCR\txtfile' /s
It is also possible to open the text file in a different way:

Code: Select all

WINEPREFIX="/home/user/.local/share/wineprefixes/Microsoft" /opt/wine-staging/bin/wine notepad "/home/user/Downloads/request.txt"
# or (the "reg query" command must return "notepad.exe"):
WINEPREFIX="/home/user/.local/share/wineprefixes/Microsoft" /opt/wine-staging/bin/wine start "/home/user/Downloads/request.txt"
Opako
Level 3
Level 3
Posts: 74
Joined: Mon Jun 08, 2020 9:23 am

Re: Why can I not open the file "/home/user/Downloads/request.txt" with wine-notepad?

Post by Opako »

Thank you @jkfloris.

Quote: "Is notepad the program to open txtfile files? "
Yes.

I have tried out your other proposals. But none of them works.


In the folder /home/user/.local/share/applications/ I not only have the file wine-extension-ini.desktop. I have a lot of auto generate files there. For example:

Code: Select all

wine-extension-chm.desktop
wine-extension-docx.desktop
wine-extension-doc.desktop
wine-extension-dotx.desktop
wine-extension-css.desktop
wine-extension-dot.desktop
wine-extension-dochtml.desktop
wine-extension-dqy.desktop
wine-extension-csv.desktop
wine-extension-dothtml.desktop
wine-extension-cdf.desktop
wine-extension-docm.desktop
wine-extension-dic.desktop
wine-extension-dotm.desktop
They do not work. Of course: It must be the command-line "Exec=" that is wrong.

Question 1: Is it known, that this auto created wine-extension-xxx.desktop files do not work?
Question 2: Are the wine developers trying to fix the bug?

Or do I miss anything?

Wine version: 6.5

Would appreciate some reply. Thank you.
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Why can I not open the file "/home/user/Downloads/request.txt" with wine-notepad?

Post by jkfloris »

I have tried out your other proposals. But none of them works.
Then there is probably something wrong with the .../wineprefixes/Microsoft prefix. You can test this with:

Code: Select all

WINEPREFIX="${HOME}/wine-test" /opt/wine-staging/bin/wine notepad "/home/user/Downloads/request.txt"
This command creates a new Wine prefix in the wine-test folder and starts notepad.
Question 1: Is it known, that this auto created wine-extension-xxx.desktop files do not work?
What programs did you install in the .../wineprefixes/Microsoft wineprefix?
Opako
Level 3
Level 3
Posts: 74
Joined: Mon Jun 08, 2020 9:23 am

Re: Why can I not open the file "/home/user/Downloads/request.txt" with wine-notepad?

Post by Opako »

Thank you. I appreciate your answers.

jkfloris wrote: Sat Jun 04, 2022 11:39 am Then there is probably something wrong with the .../wineprefixes/Microsoft prefix.
OK. I have tried again now and I realized, that I had used the command in the terminal the wrong way:
I have tried this:

Code: Select all

env WINEPREFIX="/home/user/.local/share/wineprefixes/Microsoft" /opt/wine-staging/bin/wine notepad "/home/user/Downloads/request.txt"
instead of

Code: Select all

WINEPREFIX="/home/user/.local/share/wineprefixes/Microsoft" /opt/wine-staging/bin/wine notepad "/home/user/Downloads/request.txt"
This way it was successful.


But the other two commands do still not work:
Input:

Code: Select all

$ WINEPREFIX="/home/user/.local/share/wineprefixes/Microsoft" /opt/wine-staging/bin/wine reg query 'HKCR\txtfile' /s
Output:

Code: Select all

wine: created the configuration directory '/home/user/.local/share/wineprefixes/Microsoft'
002c:err:seh:check_bpf_jit_enable BPF JIT is not enabled in the kernel, enable it to reduce syscall emulation overhead.
002c:fixme:winediag:LdrInitializeThunk wine-staging 6.5 is a testing version containing experimental patches.
002c:fixme:winediag:LdrInitializeThunk Please mention your exact version when filing bug reports on winehq.org.
0048:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002
0048:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002
0048:err:ole:apartment_get_local_server_stream Failed: 0x80004002
0050:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002
0050:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002
0050:err:ole:apartment_get_local_server_stream Failed: 0x80004002
0050:err:ole:start_rpcss Failed to open RpcSs service
0040:err:setupapi:SetupDefaultQueueCallbackW copy error 1812 L"@C:\\windows\\system32\\drivers\\wineusb.sys,-1" -> L"C:\\windows\\inf\\wineusb.inf"
0040:fixme:winspool:AddPrinterW DocumentPropertiesW on printer L"Entwurf_hell_Einstellungen" fails
0040:fixme:winspool:AddPrinterW DocumentPropertiesW on printer L"Entwurf_hell_Einstellungen_besser" fails
0040:fixme:winspool:AddPrinterW DocumentPropertiesW on printer L"Entwurf_hell_Einstellungen_mx_2" fails
0040:fixme:winspool:AddPrinterW DocumentPropertiesW on printer L"ENVY-5540-series" fails
0040:fixme:winspool:AddPrinterW DocumentPropertiesW on printer L"falscher_AirPrint" fails
0040:fixme:winspool:AddPrinterW DocumentPropertiesW on printer L"Gamma" fails
0040:fixme:winspool:AddPrinterW DocumentPropertiesW on printer L"PDF" fails
0040:fixme:winspool:AddPrinterW DocumentPropertiesW on printer L"Windows_hell_besser_driver" fails
0064:fixme:file:NtLockFile I/O completion on lock not implemented yet
0064:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
0064:err:mscoree:LoadLibraryShim error reading registry key for installroot
0064:err:mscoree:LoadLibraryShim error reading registry key for installroot
0064:err:mscoree:LoadLibraryShim error reading registry key for installroot
0064:err:mscoree:LoadLibraryShim error reading registry key for installroot
006c:fixme:file:NtLockFile I/O completion on lock not implemented yet
006c:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
006c:err:mscoree:LoadLibraryShim error reading registry key for installroot
006c:err:mscoree:LoadLibraryShim error reading registry key for installroot
006c:err:mscoree:LoadLibraryShim error reading registry key for installroot
006c:err:mscoree:LoadLibraryShim error reading registry key for installroot
006c:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 5)
006c:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 5)
0064:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 1)
0064:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 1)
wine: configuration in L"/home/user/.local/share/wineprefixes/Microsoft" has been updated.
00ec:err:seh:check_bpf_jit_enable BPF JIT is not enabled in the kernel, enable it to reduce syscall emulation overhead.

HKEY_CLASSES_ROOT\txtfile
    (Standard)    REG_SZ    Text Document

HKEY_CLASSES_ROOT\txtfile\shell

HKEY_CLASSES_ROOT\txtfile\shell\open

HKEY_CLASSES_ROOT\txtfile\shell\open\command
    (Standard)    REG_SZ    C:\windows\system32\notepad.exe %1

HKEY_CLASSES_ROOT\txtfile\shell\print

HKEY_CLASSES_ROOT\txtfile\shell\print\command
    (Standard)    REG_SZ    C:\windows\system32\notepad.exe /p %1
Input:

Code: Select all

$ WINEPREFIX="/home/user/.local/share/wineprefixes/Microsoft" /opt/wine-staging/bin/wine start "/home/user/Downloads/request.txt"
Output:

Code: Select all

No application could be started or no application is associated with the specified file.
ShellExecuteEx failed: File not found.
jkfloris wrote: Sat Jun 04, 2022 11:39 am What programs did you install in the .../wineprefixes/Microsoft wineprefix?
MS Office 2010
Opako
Level 3
Level 3
Posts: 74
Joined: Mon Jun 08, 2020 9:23 am

Re: Why can I not open the file "/home/user/Downloads/request.txt" with wine-notepad?

Post by Opako »

OK.

Please ignore my post from " Sat Jun 04, 2022 7:50 pm ". Sorry I got a few things mixed up. (txt and dic)

Again:

In "/home/user/.local/share/applications/wine-extension-dic.desktop" I have this command:

Code: Select all

[Desktop Entry]
Type=Application
Name=notepad-dic
MimeType=application/x-wine-extension-dic;
Exec=env WINEPREFIX="/home/user/.local/share/wineprefixes/Microsoft" /opt/wine-staging/bin/wine start /ProgIDOpen txtfile %f
NoDisplay=true
StartupNotify=true
Icon=1E64_notepad.0
This "wine-extension-dic.desktop" does not work.


So to see how this command works in terminal, I tried it out. And it also was not working in the terminal:

Input:

Code: Select all

$ env WINEPREFIX="/home/user/.local/share/wineprefixes/Microsoft" wine "start /ProgIDOpen txtfile /home/user/Downloads/request.dic"
Output:

Code: Select all

002c:fixme:winediag:LdrInitializeThunk wine-staging 6.5 is a testing version containing experimental patches.
002c:fixme:winediag:LdrInitializeThunk Please mention your exact version when filing bug reports on winehq.org.
00b0:err:plugplay:try_add_device Building report descriptor failed, removing device
00b0:err:plugplay:try_add_device Building report descriptor failed, removing device
009c:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\wineusb": c0000142
003c:fixme:service:scmdatabase_autostart_services Auto-start service L"wineusb" failed to start: 1114
wine: failed to open L"start /ProgIDOpen txtfile /home/user/Downloads/request.dic": c0000135

user@xxx:~
[code]$ 00a0:err:rpc:I_RpcReceive we got fault packet with status 0x1c010003
00a0:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
00a0:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
wine: Unhandled page fault on write access to 02F0FEFC at address 7E7A2FD8 (thread 0128), starting debugger...
0128:err:seh:start_debugger Couldn't start debugger L"winedbg --auto 144 124" (1115)
Read the Wine Developers Guide on how to set up winedbg or another debugger
And also this is not working (Same without ""):

Input:

Code: Select all

$ env WINEPREFIX="/home/user/.local/share/wineprefixes/Microsoft" wine start /ProgIDOpen txtfile /home/user/Downloads/request.dic
Output:

Code: Select all

002c:fixme:winediag:LdrInitializeThunk wine-staging 6.5 is a testing version containing experimental patches.
002c:fixme:winediag:LdrInitializeThunk Please mention your exact version when filing bug reports on winehq.org.
00ac:err:plugplay:try_add_device Building report descriptor failed, removing device
00ac:err:plugplay:try_add_device Building report descriptor failed, removing device
0090:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\wineusb": c0000142
003c:fixme:service:scmdatabase_autostart_services Auto-start service L"wineusb" failed to start: 1114
No application could be started or no application is associated with the specified file.
ShellExecuteEx failed: File not found.

user@xxx:~
$ 0094:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0094:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
wine: Unhandled page fault on write access to 02F0FEFC at address 7ECB5FD8 (thread 0128), starting debugger...
0128:err:seh:start_debugger Couldn't start debugger L"winedbg --auto 128 124" (1115)
Read the Wine Developers Guide on how to set up winedbg or another debugger
I am confused: Waht is with this "L" in the outputs:

Code: Select all

L"\\Registry\\......
Does this have something to do with wineconfig drives? I have no "L" there. Could this be the bug? :
k20220604-231751.jpg
Opako
Level 3
Level 3
Posts: 74
Joined: Mon Jun 08, 2020 9:23 am

Re: Why can I not open the file "/home/user/Downloads/request.txt" with wine-notepad?

Post by Opako »

I was able now, to modify the command in "/home/user/.local/share/applications/wine-extension-dic.desktop" in a way that it works now. (wine-extension-dic.desktop is used, to right-click a *.dic file, and open it with the "Open With dialog".

So I can now double click in thunar on the file "/home/user/Downloads/request.dic" and "wine notepad" opens and shows me the content of the file "request.dic". -- Before the modification this was not working.

So here is what I have changed in the file "/home/user/.local/share/applications/wine-extension-dic.desktop":

Command before (this was not working):

Code: Select all

Exec=env WINEPREFIX="/home/user/.local/share/wineprefixes/Microsoft" /opt/wine-staging/bin/wine start /ProgIDOpen txtfile %f
Command after (This is working now):

Code: Select all

Exec=env WINEPREFIX="/home/user/.local/share/wineprefixes/Microsoft" /opt/wine-staging/bin/wine /opt/wine-staging/bin/wine /home/user/.local/share/wineprefixes/Microsoft/drive_c/windows/command/start.exe /ProgIDOpen txtfile %f
So you can see the change:
I have replaced "start" through "/home/user/.local/share/wineprefixes/Microsoft/drive_c/windows/command/start.exe"


Unfortunately:
All my "/home/user/.local/share/applications/wine-extension-*.desktop" files have "start" instead of "/home/user/.local/share/wineprefixes/Microsoft/drive_c/windows/command/start.exe" in the command line and do not work.

Question: Is this a wine Bug? Is wine not able to create this "wine-extension-*.desktop" files correct?

Would appreciate some answer. Thank you.
Last edited by Opako on Sun Jun 05, 2022 4:30 pm, edited 1 time in total.
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Why can I not open the file "/home/user/Downloads/request.txt" with wine-notepad?

Post by jkfloris »

Does the command work if you don't use env? Because often env is only used in scripts.

I don't know exactly what the "L" stands for, but it has nothing to do with your (virtual) hard drives.
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Why can I not open the file "/home/user/Downloads/request.txt" with wine-notepad?

Post by jkfloris »

There was a bug in Wine 6.5 that made "wine start" not work properly. This has now been fixed.
Could you try Wine 7.x?

Maybe an odd question, but why not use a Linux program to open your text files?
Opako
Level 3
Level 3
Posts: 74
Joined: Mon Jun 08, 2020 9:23 am

Re: Why can I not open the file "/home/user/Downloads/request.txt" with wine-notepad?

Post by Opako »

Thank you again.
jkfloris wrote: Sun Jun 05, 2022 4:42 pm Maybe an odd question, but why not use a Linux program to open your text files?
That was just a representative example question for all wine-extension-*.desktop files. I thought, everyone who has wine, knows notepad and everyone has it installed. So it will be easier for others to understand my question. As I said, all my wine-extension-*.desktop files don't work. But I picked .dic as an example, to ask a simple specific question in the hope, that I could then apply the answer to all other wine-ext desktop files. (Which I can indeed do now.)


jkfloris wrote: Sun Jun 05, 2022 4:42 pm There was a bug in Wine 6.5 that made "wine start" not work properly. This has now been fixed.
Could you try Wine 7.x?
I have now tried Wine 7.9.

Result: My wine-extension-*.desktop files work now. :D :mrgreen:


All?
No. I have wine-extension-*.desktop filres created through the Prefix ...

Code: Select all

WINEPREFIX="/home/user/LutrisPfx/my/prefix"
-> They do not work. When I try in thunar to open them with the "open file with"- dialogue.

Only all wine-extension-*.desktop files created through the Prefix ...

Code: Select all

WINEPREFIX="/home/user/.local/share/wineprefixes/Microsoft"
... work now.



Question:
Why does "wine-extension-txt.desktop" not work, but "wine-extension-dic.desktop" works?:

Content of wine-extension-txt.desktop:

Code: Select all

[Desktop Entry]
Type=Application
Name=notepad-txt
MimeType=text/plain;
Exec=env WINEPREFIX="/home/user/LutrisPfx/my/prefix" /home/ubuntu/buildbot/runners/wine/lutris-4.21-x86_64/bin/wine start /ProgIDOpen txtfile %f
NoDisplay=true
StartupNotify=true
Icon=1E64_notepad.0
Content of wine-extension-dic.desktop:

Code: Select all

[Desktop Entry]
Type=Application
Name=notepad-dic
MimeType=application/x-wine-extension-dic;
Exec=env WINEPREFIX="/user/D-Konto/.local/share/wineprefixes/Microsoft" /opt/wine-staging/bin/wine start /ProgIDOpen txtfile %f
NoDisplay=true
StartupNotify=true
Icon=1E64_notepad.0

Edit:
Can it be that wine 5.2, which is connected to my Lutris prefix, has also the bug that makes "wine start" not work properly?
Opako
Level 3
Level 3
Posts: 74
Joined: Mon Jun 08, 2020 9:23 am

Re: Why can I not open the file "/home/user/Downloads/request.txt" with wine-notepad?

Post by Opako »

OK. I guess I have found the answer:

Part of the line "Exec=" in wine-extension-txt.desktop:

Code: Select all

/home/ubuntu/buildbot/runners/wine/lutris-4.21-x86_64/bin/wine
-> I guess when I try to open this file, thunar is looking for the file "/home/ubuntu/buildbot/runners/wine/lutris-4.21-x86_64/bin/wine", but I don't have this folder on my system.

Strange, that I do not have this folder. Maybe this works only somehow "Lutris intern". (And to add: I not even use Ubuntu distribution.)


Edit:
I have now changed the line "Exec=" in wine-extension-txt.desktop from ...

Code: Select all

/home/ubuntu/buildbot/runners/wine/lutris-4.21-x86_64/bin/wine
... into ...

Code: Select all

/home/user/.local/share/lutris/runners/wine/lutris-5.2-x86_64/bin/wine
This is the Wine, that Lutris uses.
Result: "wine-extension-txt.desktop" works now in thunar with txt-files.


Strange, that it had the wrong path in "wine-extension-txt.desktop".
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Why can I not open the file "/home/user/Downloads/request.txt" with wine-notepad?

Post by jkfloris »

The shortcuts are automatically set to the Wine installation by which the program was installed.
Maybe something went wrong in Lutris and the wrong Wine installation was set in the desktop file.

Fortunately, Linux has tools that allow you to modify the files.
Caution! I have not tested this command extensively.
First test the command on one desktop file

Code: Select all

sed 's@ubuntu/buildbot/runners/wine/lutris-4.21-x86_64@user/.local/share/lutris/runners/wine/lutris-5.2-x86_64@g' wine-extension-txt.desktop
Explanation:
search for ubuntu/buildbot/runners/wine/lutris-4.21-x86_64
and replace this string with user/.local/share/lutris/runners/wine/lutris-5.2-x86_64
Do this for all matches found (g)
The @ is used to distinguish the different fields. (Usually the / is used for this, but it is already in use by the path names)

If the output looks good then you can modify the file with:

Code: Select all

sed -i 's@ubuntu/buildbot/runners/wine/lutris-4.21-x86_64@user/.local/share/lutris/runners/wine/lutris-5.2-x86_64@g' wine-extension-txt.desktop
To modify all wine-extension files, use:

Code: Select all

sed -i 's@ubuntu/buildbot/runners/wine/lutris-4.21-x86_64@user/.local/share/lutris/runners/wine/lutris-5.2-x86_64@g' wine-extension-*.desktop
Opako
Level 3
Level 3
Posts: 74
Joined: Mon Jun 08, 2020 9:23 am

Re: Why can I not open the file "/home/user/Downloads/request.txt" with wine-notepad?

Post by Opako »

Thank you. That is very amazing. I will use this when I once will have again this situation. Unfortunately in the meantime I have edited all wine desktop files manually.
Locked