Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make powershell tell me about missing DLLs?

I use powershell as shell in Windows. When I'm trying to launch some application who's dll dependencies are missing in PATH environment variable, then nothing happens, powershell just silently returns with new command prompt.

Is there a way to make powershell fail louder, telling me what exactly is missing, like default cmd shell does?

like image 629
Alien-47 Avatar asked Apr 11 '14 12:04

Alien-47


1 Answers

I was having this same problem. PowerShell was setting $LASTEXITCODE code to -1073741515 (0xC0000142, 3221225794) but no output explaining what was actually wrong. When running it via cmd.exe I would get popup with something like:

The code execution cannot proceed because some.dll was not found. Reinstalling the program may fix this problem.

cygwin bash outputs errors relating to dll not found to stderr and if you run the the same via bash from PowerShell then you can see the error:

> & 'C:\tools\cygwin\bin\bash.exe' '-c' '"C:/Users/xxx/dir/main.exe"'
C:/Users/xxx/dir/main.exe: error while loading shared libraries: another.dll: cannot open shared object file: No such file or directory

This works with git bash also:

> & 'C:\Program Files\Git\bin\bash.exe' '-c' '"C:/Users/xxx/dir/main.exe"'
C:/Users/xxx/dir/main.exe: error while loading shared libraries: another.dll: cannot open shared object file: No such file or directory

Quite a hack but better than nothing.

like image 110
Iwan Aucamp Avatar answered Sep 20 '22 09:09

Iwan Aucamp