crc icon indicating copy to clipboard operation
crc copied to clipboard

[Windows] Try to find a better workaround instead flashing the powershell windows during crc setup

Open praveenkumar opened this issue 2 years ago • 2 comments

With https://github.com/code-ready/crc/pull/3088 crc daemon is started using task schedular but as of now when user perform crc setup then it flash a powershell window for a second because of limitation https://github.com/PowerShell/PowerShell/issues/3028, In this issue there are other workaround is something like using vbs script (which detect as virus as per @anjannath ) and then https://stackoverflow.com/questions/23250505/how-do-i-create-an-executable-from-golang-that-doesnt-open-a-console-window-whe which use go ldflag for not using any console window https://github.com/code-ready/crc/pull/3088#issuecomment-1081414893 . This isssue is to track if there is a better way.

praveenkumar avatar Mar 29 '22 05:03 praveenkumar

If we run crc daemon directly, then a console window is always shown. We try to avoid this through the use of powershell: powershell.exe -WindowStyle Hidden -Command %s, but there is still a console window flashing briefly as described in https://github.com/PowerShell/PowerShell/issues/3028

cfergeau avatar Mar 29 '22 08:03 cfergeau

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 04 '22 03:06 stale[bot]

Hi, I am experiencing the same with 2.8.0 (I gave up installing the newest version after many fails). I use Windows Terminal and despite the options mentioned by @cfergeau the powershell window (in Windows terminal) opens and keeps running with crc daemon for the whole login session. It is a bit cumbersome to move it every single time to the second virtual desktop and that still doesn't resolve an issue that I can close it accidentally (as it is running as Windows Terminal). Do you have any progress on this?

Drabenstein avatar Oct 22 '22 23:10 Drabenstein

If the powershell window stays open, it's unexpected and it's a bug. However I don't think it happens on our machines, so I'm not sure how to debug this further. This bug is about a window which is opened for less than 1 second, and automatically closes it self.

cfergeau avatar Nov 03 '22 16:11 cfergeau