Redist redone!

Published March 02, 2010
Advertisement
This has come up in a few places recently so I thought I'd dive into it myself. Up until now I've used the static runtime library for Visual C++ 2008 (/MT) with Citizen, for my own convenience and laziness. Less file dependencies mean less hassle in deployment.

Seriously though, I'm generally against using dynamic linking because:
  • The program depends on external files that could be missing, which is not a big problem but it incurs a reliability risk that increases with the number of dependencies.

  • If you release an update for the DLL you need to make sure that the program loads the new version and not the old. If the new version of the DLL exposes a different interface than the old then the program must deal with this.


However, if the library is managed by someone else, that has taken on the responsibility for these reliability problems, then there are benefits. For example security updates may be available for common libraries. For this reason Citizen now uses dynamic linking with the VC++ runtime (/MD), the D3D9 runtime and OpenAL, while smaller libs that are not updated regularly like ALUT, Shiny, Lua, Ogg/Vorbis, TinyXML and FCTX are linked statically. Specifically ALUT had to be modified in the common header for static linking. There may be many opposing opinions about this but I see no reason to go crazy with DLLs. My philosophy is to keep the finally deployed files as few as possible, for reliability.

Anyway one thing that has popped up is how to do silent installs of the various redists. I currently let Citizen run directly from its unzipped directory. To install the dependencies I use a simple batch file. Maybe I'll go for a real installer later but now this is sufficient. The commands for silent installs for DirectX and OpenAL are easy as can be:
echo Installing DirectX 9.0c ..."dep/dxwebsetup.exe" /Qecho Installing OpenAL ..."dep/oalinst.exe" /s

The command for silent VC++ redist install was a bit tricky but according to this (outdated and unofficial) source you can use the following command for the 2005 version:
echo Installing Visual C++ Runtime ..."dep/vcredist_x86.exe" /q:a /c:"msiexec /i vcredist.msi /qn /l*v %temp%\vcredist_x86.log"

I tried using it with the 2008 SP1 version and it seemed to work alright. Apparently they didn't change the interface much. Still I will keep an eye on it if it acts out. This goes out to the people I commented to recently about using silent installs. [smile]
Previous Entry Untitled
Next Entry Dark days
0 likes 2 comments

Comments

Prinz Eugn
This confuses me, too technical. post screenshots plz kthx
March 05, 2010 01:27 PM
Staffan E
Um, ok...



How is this any less confusing? ;P
March 06, 2010 04:43 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement