ide icon indicating copy to clipboard operation
ide copied to clipboard

Proper workaround if setup is called from powershell

Open hohwille opened this issue 2 years ago • 1 comments

As discussed in #1020: Issue #866 is not properly fixed. I have meanwhile fixed #1018 but the entire approach to detect if we are inside powershell is not valid or working reliable. Simply start a new CMD in windows terminal and execute this command:

echo %PSMODULEPATH%

You will see that it contains what we expect if we are called from within powershell but IMHO where are not, if we simply open a new CMD tab in Windows Terminal. As a result setup.bat runs itself again in a new CMD window. Also with my latest change from #1021 it now also prints this message:

Starting CMD window as workaround since setup has been called from powershell...

This behavior is OK if we really are calling setup.bat from powershell as a workaround for #866 but it should only happen if we really come from powershell as otherwise this is only causing confusion. Besides the workaround leaves you with a CMD popup that will remain open after you submitted the pause command with return so you have to close it manually what is undesired for regular cases. Running setup.bat from powershell is not recommended and we only implemented this workaround as we have many users and we want to avoid problems and support or bug reports in such scenarios.

hohwille avatar Dec 16 '22 12:12 hohwille

In the moment, I don't see any reliable solution to check wether the bat is run with Powershell oder CMD. Maybe we should update setup.bat so that it works for both.

alfeilex avatar Mar 02 '23 14:03 alfeilex