The popup to add a game instance is only supposed to let the user choose game executable files of known games, but it always shows all shortcuts:
If you choose one of these and try to use it to add a game instance, you get a (quite funny) "Catastrophic failure" message:
Reported by @PoofImAlex in KSP-CKAN/CKAN#4167.
Cause
This seems to be just how OpenFileDialog "works". I'm sure there's some obscure rationale for it in some Microsoft document somewhere, but it is truly inappropriate and in need of fixing in our case.
Changes
It seems to be impossible to hide shortcuts, so instead we hook into the FileOk event and reject any files that don't match the filter that we already gave to OpenFileDialog but which it decided to partially ignore:
Problem
The popup to add a game instance is only supposed to let the user choose game executable files of known games, but it always shows all shortcuts:
If you choose one of these and try to use it to add a game instance, you get a (quite funny) "Catastrophic failure" message:
Reported by @PoofImAlex in KSP-CKAN/CKAN#4167.
Cause
This seems to be just how
OpenFileDialog
"works". I'm sure there's some obscure rationale for it in some Microsoft document somewhere, but it is truly inappropriate and in need of fixing in our case.Changes
It seems to be impossible to hide shortcuts, so instead we hook into the
FileOk
event and reject any files that don't match the filter that we already gave toOpenFileDialog
but which it decided to partially ignore: