1
\$\begingroup\$

I've coded a Visual Studio 2015 game in SDL2 and ran some distribution tests, I gave a user the game's .exe (the raw game with no files) and they got the error SDL2.dll is missing. How would I export the game so it includes the least amount of rubbish (visual studio) files and doesn't produce these sdl errors.

\$\endgroup\$
6
  • \$\begingroup\$ You ship the game with the SDL2.dll file included... That is no "rubbish", it's the SDL library. Users also need to have on their PCs installed the visual studio 2015 redistributable so you also have to include that just in case. \$\endgroup\$
    – rlam12
    Oct 20 '16 at 2:49
  • 1
    \$\begingroup\$ That said, its worth addressing that it is entirely possible to get a AAA title that requires, but does not include, VS redistributable. Do not be like these publishers. \$\endgroup\$
    – Gnemlock
    Oct 20 '16 at 3:11
  • \$\begingroup\$ Sorry to jump in like this, but how can you export it without neededing VS redistributables? \$\endgroup\$
    – lozzajp
    Oct 20 '16 at 7:20
  • 1
    \$\begingroup\$ @lozzajp By not building the executable with Visual Studio. \$\endgroup\$
    – Peter
    Oct 20 '16 at 12:14
  • 1
    \$\begingroup\$ @lozzajp You can still code in VS and even build through VS, using a different compiler. At least you could a few versions ago. (It's not something I recommend doing -just package the redistrubutables instead). You can also build VS solutions with the default compiler from the command line, but they will of course still need the redistributables. \$\endgroup\$
    – Peter
    Oct 20 '16 at 12:24
1
\$\begingroup\$

By testing.

To test your installer - which you build with any of the many installer tools your favorite search engine suggests - you should use a clean virtual machine. Anytime you test the installer, you first reset the machine to it's initial state. Such a reset removes any changes made by a previous run of the installer, including things that are easy to forget about, like registry settings or the visual studio redistributable package.

\$\endgroup\$
0
\$\begingroup\$

You could use the costura.fody nuget package. This will take your referenced dll's and embed them into one exe file.

\$\endgroup\$
0
\$\begingroup\$

So what you are looking for is some type of an installer-builder. You need something that takes the DLLs your game relies on, the game executable and all the resource files that your game loads in, and packages those into a single installer file, which will then extract all those files to the directory specified by the user. There are multiple systems that allow you to do this, I personally only have experience with WiX Toolset. An installer also allows you to reference VS Redistrubutables, which will be installed on the user's machine if they are not found.

An alternative to this would be to use a zip-file, where you manually copy the DLLs, resource files and the game executable. This way the user can just extract the package to a directory, and run the game. This however doesn't guarantee that any redistributables would be installed on the user's machine.

\$\endgroup\$
2
  • \$\begingroup\$ I think the actual question which is asked here is about how to find out which DLLs an application needs in the first place. Does WiX Toolset do that? \$\endgroup\$
    – Philipp
    Oct 20 '16 at 9:43
  • \$\begingroup\$ It does not. Sorry, I must have miss-interpreted the question body, as to me it seems that the question title asks how to distribute a game with everything that is required to run it. \$\endgroup\$
    – Tyyppi_77
    Oct 20 '16 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.