log4j-finder icon indicating copy to clipboard operation
log4j-finder copied to clipboard

Prevent console from closing when running as an frozen executable on windows

Open sibalzer opened this issue 3 years ago • 1 comments

proposal for #63

sibalzer avatar Dec 21 '21 15:12 sibalzer

I think we also need an option for not pausing, for example --no-auto-prompt, or else everyone that is deploying log4j-finder automatically will have a pause that cannot be cancelled.

Instead of os.system("pause") the following is preffered input("Press any key to continue..") so we do not execute a subprocess.

Also now Windows users always get this prompt, which could be annoying. We could make an autodetect if run via console or Explorer/GUI on windows, but still override it with the --no-auto-prompt in case it doesn't work properly. I have googled a bit and people seem to detect if run via cmd.exe or powershell.exe by checking if some Environment variables exists. For example PROMPT and PsModulePath, these do not exist when run via Explorer.

yunzheng avatar Dec 22 '21 08:12 yunzheng