Check if VLC is installed

后端 未结 2 898
再見小時候
再見小時候 2021-01-20 14:28

I\'m calling vlc from a C# app in order to play a video. I need a way to consistently check if VLC is installed. I\'ve tried checking registry keys, but they don\'t seem to

2条回答
  •  迷失自我
    2021-01-20 14:46

    I'd say you're doing unnecessary work in trying to detect this. What are you going to do if VLC is not installed? Show an error message? Then just try to launch it, and show an error message if it fails to launch. That way, you also capture the case where it is installed, but still fails to launch for whatever reason. Both are error conditions for your program.

    Beyond that, make sure that you include a setup program with your application that automatically installs VLC, since your application requires it to work properly. Then, the only situation where it wouldn't be installed (and thus your application would have to show an error message) is if the user explicitly removes it after installation. Since they would have to do so intentionally, it's very unlikely they would be surprised when your application subsequently failed to work.

提交回复
热议问题