-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace scrcpy-noconsole.exe
by a simple wrapper script
#1988
Conversation
This simplifies the build system. Refs <#1975 (comment)>
For those who have no building problems, do not remove the option to create a scrcpy-noconsole.exe |
I think there is no benefit to keep it. If it's not necessary, I prefer to remove it to simplify the Makefile and remove the ifdefs from the sources. |
There is, at least for me. I like to create a shortcut (to change the icon) and pin it to my taskbar. |
Sorry, but I think #1988 is bad implemented. I was happily, BTW, using scrcpy-noconsole.exe without any problem but, after vacation, I found it just simply does not work in 1.17. I understand the desire to have just one executable and use wrappers if the same functionality is preserved but that is not the case. When I used a console (cmd, bash) when I invoked scrcpy.exe the console gets locked until the scrcpy window closes or if you press Ctrl-C on the console window. Now If I use scrcpy-noconsole.exe it just does not work. Besides if I use scrcpy-noconsole.bat the console window still remains locked!! because it just calls scrcpy.exe which locks the console while the scrcpy window remains open. That is not the previous behavior. Sure, I can use scrcpy-noconsole.vbs but I can use it only in cmd but not in bash by default and besides, you can't pass parameters to the vbs (for example --render-driver opengles2 or any other) which you can easily do with previous version of scrcpy-noconsole.exe. So, The new implementation of scrcpy-noconsole, IMO, is simply wrong as it does not mimic the previous behavior. Just my thoughts, J. |
To run in background (to get prompt immediately):
You could also pass arguments.
The goal was not to keep the previous behavior, the fact that it was executed in background was a side-effect.
That's a real drawback, the vbs script should forward the arguments to scrcpy. PR welcome.
The only purpose of |
Do you try this yourself? In my case I have the Windows 10 Pro 20H2, BTW, and that just don't work. So, both options aren't really a workaround. In fact, if I create a scrcpy.bat with
Not so easy without getting the console stuck, as I said.
Maybe, that were their original purpose but the more than I think about it the more I believe that it should be a parameter to scrcpy, not a duplicate program compiled with a special flag. That would be indeed a useful feature for me... and it seems to others as well. J. |
Yes, that works.
Because of the scrcpy output? Yes, if you don't want it, disable it (like any shell command): start /B scrcpy >nul 2>&1 scrcpy >&/dev/null
Yes, you need the
Of course that would be better, but that's not possible (otherwise it would have been implemented that way): on Windows the fact that a console is opened or not is determined before executing your program code, so the program itself could not decide to not start a new window. That's the reason why you can't execute a The wanted behavior is that of Linux:
On Windows, the behavior of consoles is totally broken (IMO, I might be biased):
(and that's not the only thing which is broken about command-line execution on Windows) |
scrcpy v1.17 Changes since v1.16: - Fix errors on Android 11 (Genymobile#1468) - Add --encoder option (Genymobile#1810, Genymobile#1827) - Add --forward-all-clicks option (Genymobile#1302, Genymobile#1613) - Add --legacy-paste option (Genymobile#1750, Genymobile#1771) - Workaround screen off/on issue on exit (Genymobile#1670) - Rework console/noconsole versions on Windows (Genymobile#1875, Genymobile#1988) - Terminate server properly without killing it on close (Genymobile#1992) - List available shortcut keys on error (Genymobile#1681) - Upgrade platform-tools to 30.0.5 (adb) in Windows releases - Upgrade SDL to 2.0.14 in Windows releases
In the Windows releases (until v1.16), there are two binaries:
scrcpy.exe
(which pauses on error to let the user a chance to see any error message before the terminal closes)scrcpy-noconsole.exe
which does not open a terminalThey both contain the whole program, and complicate the build system.
For the next release, the idea is to have 3 files:
scrcpy.exe
the main binary, with the same behavior as on other platforms (no pause on error)scrcpy-console.bat
a simple wrapper script to pause on error (already merged 904d470)scrcpy-noconsole.vbs
a one-line VBS script to startscrcpy.exe
without a console (this PR)scrcpy-noconsole.vbs
just contains:Refs #1975 (comment)