Skip to content
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

Configurable behavior on critical error: message on Error stream or pop-up dialog #16468

Closed
sba923 opened this issue Nov 14, 2021 · 5 comments
Closed
Labels
Issue-Enhancement the issue is more of a feature request than a bug Needs-Triage The issue is new and needs to be triaged by a work group. Resolution-No Activity Issue has had no activity for 6 months or more WG-Engine-Pipeline

Comments

@sba923
Copy link
Contributor

sba923 commented Nov 14, 2021

Summary of the new feature / enhancement

When critical errors such as "cannot start EXE due to missing DLL" occur in File Explorer or CMD, an explanatory error dialog is displayed:

image

When the same kind of error occurs in PowerShell, no error message is displayed, only $LASTEXITCODE is set:

image

It would be desirable to make this behavior configurable, so that especially in interactive scenarios the user is supplied with information about what's happening.

This inspired by MKS Korn Shell's set -X option (@BrucePay will remember...):

From set KornShell flags and positional parameters:

image

Of course, that exception handler is not desirable for scripted / unattended execution, so it should be off by default.

It doesn't have to be a GUI-based one, outputting the explanatory text to the Error stream would also be fine.

@corbob has collected repro steps on various shells.

Proposed technical implementation details (optional)

No response

@sba923 sba923 added Issue-Enhancement the issue is more of a feature request than a bug Needs-Triage The issue is new and needs to be triaged by a work group. labels Nov 14, 2021
@corbob
Copy link
Contributor

corbob commented Nov 14, 2021

Thanks for opening the issue @sba923. I've created a simple repro and have verified behaviour in Windows PowerShell 2 on Windows 7, Windows PowerShell 5.1, and PowerShell 7.2. I have also checked the behaviour of cmd, the run dialog box, and git-bash.

To expand on what is listed in above: PowerShell behaves the same as cmd and the run dialog when you use Start-Process. In all other cases I tested (running adb, . adb, & adb) the error is not emitted outside of $LASTEXITCODE. In git-bash an error is emitted, but it is not extremely helpful as it just indicates it couldn't load a file and gives a different exit code:

image

The repro steps I've used (from an administrative PowerShell window):

choco install adb
Remove-Item "$env:ChocolateyInstall\lib\adb\tools\platform-tools\AdbWinApi.dll"
adb

Note Chocolatey is not the only way to get adb installed, but it is a pretty quick and painless way to do it.

Copy link
Contributor

This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Resolution-No Activity Issue has had no activity for 6 months or more label Nov 15, 2023
Copy link
Contributor

This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.

@zchrissirhcz
Copy link

zchrissirhcz commented Jun 13, 2024

Is there any solution for the required "pop up window" when running .exe files missing .dll files?

#17060

@daxian-dbw I'm confused. I don't see a solution for that. Could you please give a look?

@sba923
Copy link
Contributor Author

sba923 commented Jun 13, 2024

This should be reopened if you ask me 😜@StevenBucher98 @SteveL-MSFT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement the issue is more of a feature request than a bug Needs-Triage The issue is new and needs to be triaged by a work group. Resolution-No Activity Issue has had no activity for 6 months or more WG-Engine-Pipeline
Projects
None yet
Development

No branches or pull requests

4 participants