Distributing OpenTK applications

The most important dependency by far is the Mono/.Net framework. If you need to support users that might not have that installed, the best solution is to embed the Mono runtime into a small launcher (example code).

Additionally, on Windows, you will typically need to install OpenAL drivers:

  • either distribute the official oalinst.exe from Creative (requires admin rights to install)
  • or distribute OpenAL Soft (plain dll, no admin rights required).

There is no such redistributable for OpenGL drivers - the user will have to install those on his own.

On Linux, users will typically have OpenAL and OpenGL pre-installed. If you generate distro-specific packages, then list AL/GL as dependencies and the package manager will take care of the rest. If you provide distro-agnostic packages, then you can either expect the user to have AL/GL preinstalled (which is quite reasonable) or you can bundle your own version of OpenAL (use the OpenAL Soft link, above). Most commercial games follow the distro-agnostic package approach. Many include libopenal.so, too.

Apart from those, OpenTK uses either core OS components which are always available (e.g. user32.dll or libX) or optional components with transparent fallbacks (e.g. libXi).

In any case, do try to fail smoothly if AudioContext or GraphicsContext construction fails. It is also a good idea to check the OpenGL version and bail out early if too low.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tksuoran's picture

I found these when I added Linux support to my OpenTK application:
- Some people will have too old mono that can produce plain wrong and misleading messages, like suggestions to run windows version of mono in wine.
- Some people will not have sufficient mono packages installed and will get funny exceptions about windowsbase or winforms
- Showing standard Windows messagebox can fail on Linux (certainly if winforms package is not installed).
- Too old OpenGL drivers can hang while trying to create context. You can not catch this as an exception..

the Fiddler's picture

The first three issues can be solved via a static mkbundle or by embedding the Mono runtime (quite easy). The disadvantage is that the compile-once-run-everywhere aspect is lost, so you'll have to decide if this trade-off is worth it (for commercial software, it certainly is).