https://bugs.winehq.org/show_bug.cgi?id=57017
Bug ID: 57017 Summary: .bat script won't work (fixme:console:write_console beep error) Product: Wine Version: 9.14 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs@winehq.org Reporter: brandowlucas@gmail.com Distribution: ---
Created attachment 76861 --> https://bugs.winehq.org/attachment.cgi?id=76861 .bat script
Trying to interact with the menu will output "fixme:console:write_console beep" to the terminal and nothing happens. Prior to wine-9.14, it would just spam "fixme:cmd:WCMD_choice bad parameter L" WSADVQE /n" for /C" and nothing would happen too. I attached the .bat with the full script code.
https://bugs.winehq.org/show_bug.cgi?id=57017
Eric Pouech eric.pouech@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |eric.pouech@gmail.com
--- Comment #1 from Eric Pouech eric.pouech@gmail.com --- Created attachment 76866 --> https://bugs.winehq.org/attachment.cgi?id=76866 Tentative patch
This patch helps locally selecting the relevant entries. Didn't test until the end as I don't have powershell installed for the V choice. Would you mind testing on your side?
Side note: also "mode 40 30" is only supported by DOS cmd. You should use mode CON cols=40 lines=30.
https://bugs.winehq.org/show_bug.cgi?id=57017
--- Comment #2 from brandow brandowlucas@gmail.com --- Created attachment 76883 --> https://bugs.winehq.org/attachment.cgi?id=76883 showcase on Windows 11
https://bugs.winehq.org/show_bug.cgi?id=57017
--- Comment #3 from brandow brandowlucas@gmail.com --- This patch successfully add the relevant entries. As you mentioned, the V choice doesn't proceed on what it was supposed to do. I attached a picture how it should look like after pressing the V choice.
https://bugs.winehq.org/show_bug.cgi?id=57017
--- Comment #4 from Eric Pouech eric.pouech@gmail.com --- (In reply to brandow from comment #3)
This patch successfully add the relevant entries. As you mentioned, the V choice doesn't proceed on what it was supposed to do. I attached a picture how it should look like after pressing the V choice.
actually, that screen is printed, but since powershell is not present (or actually, just wine's stub, which mainly prints its arguments and returns), you always go back to main screen.
See for example https://bugs.winehq.org/show_bug.cgi?id=56417 on how to proceed to get a powershell replacement.
https://bugs.winehq.org/show_bug.cgi?id=57017
--- Comment #5 from brandow brandowlucas@gmail.com --- I forgot to mention I tried running the script after installing powershell-wrapper, but nothing would change on the cmd.exe side. I also tried running the script inside the Powershell window ("wine powershell"), but i'd get just a blank screen and nothing would output into it. Am I doing something wrong or can this be an expected behavior?
https://bugs.winehq.org/show_bug.cgi?id=57017
Eric Pouech eric.pouech@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|wine-bugs@winehq.org |eric.pouech@gmail.com Status|UNCONFIRMED |ASSIGNED Ever confirmed|0 |1
--- Comment #6 from Eric Pouech eric.pouech@gmail.com --- Created attachment 76890 --> https://bugs.winehq.org/attachment.cgi?id=76890 second patch (need to apply first as well)
You're doing nothing wrong. The issue turns out to be in the "slight" discrepancies of handling a .bat and a .cmd files. Most of the commands behave the same, but some don't (in this very case, SET always sets ERRORLEVEL for .cmd file, but only sets it for .bat in case of error). Current Wine implementation always sets ERRORLEVEL for SET command.
For a succinct explanation: https://groups.google.com/g/microsoft.public.win2000.cmdprompt.admin/c/XHeUq...
I'll move that missing feature higher in my todo list; but I have a couple of other pending items on cmd.exe to handle before. So don't hold your breath on this one. To be done properly, we need to add a bunch of new tests, or even have a way to share the tests between the two .bat & .cmd cases.
Anyway, I attached a small hacky patch that you help in your very case.
https://bugs.winehq.org/show_bug.cgi?id=57017
--- Comment #7 from brandow brandowlucas@gmail.com --- Created attachment 76891 --> https://bugs.winehq.org/attachment.cgi?id=76891 output log using the hacky patch
Thanks for taking the time into fixing this. I tried the hacky patch, but I get some fixme outputs and a "Invoke-Expression: You must provide a value expression following the '=' operator." error, after this the program comes back to the initial screen. This is most likely an problem with the current powershell-wrapper. I attached the output in case that's useful for something.