Why does Counter Strike: Condition Zero not play intro videos in Windows if the installation path has spaces in it?

Sounds like a bug in the game where the code opens video without quotes and as such part of the video path is assumed to be a parameter where it really isn't, resulting in an error, and thus the video never plays. Console will probably log an error too.

To explain this a bit... In Windows, when you work with paths, you either type it as such:

C:\My_Path_without_spaces

or

"C:\My Path With Spaces"

Note the quotes.

When you start an external program, for example a video player, the video player may have its argument list as follows (this is an example)

C:\Games\HalfLife\bin\videoplayer.exe /video C:\Games\HalfLife\intro.avi
                      ^ path to videoplayer
                                      ^parameter video
                                             ^video file

Now lets say you have Half Life as foldername:

C:\Games\Half Life\bin\videoplayer.exe /video C:\Games\Half Life\intro.avi
                       ^ path to videoplayer (the space may break here too)
                                       ^parameter video
                                              ^video file
                                                            ^invalid parameter
 

There's no video called Half without extension nor does it understaned the Life\intro.avi as parameter as the videoplayer does not recognize it.

Note that HalfLife 1 is a very old game. It was in the era where 8.3 length filenames were still very common.


The underlying issue is that under Windows the callee is responsible for parsing the command line. The callee gets the entire command line as one single string. (The *nix family of operating systems, by contrast, passes a set of single arguments to the callee, corresponding to argv. Separating arguments is simply not an issue.) Typical conventions separate command line arguments by spaces; consequently, single arguments that contain spaces must be quoted. The quotes are part of the command line passed to the callee! For a discussion, see this Microsoft article. As a side issue, there is no guarantee that the callee handles quotes at all! Don't quote parameters gratuitously.

In your case, quoting the path argument was forgotten: a bug in the game. Additionally, an entire equivalence group in the module tests was missed.

You may know such troubles from your favorite *nix shell: How do I again pass an argument that contains quotes? The user shell is the only program in the *nix world that needs to parse command lines. Programmatically calling one binary from another, by contrast, does not have that issue: The caller simply fills an array of arguments before the exec call, serving single arguments to the callee on a silver platter.

It is this ill-conceived combination of an ill-conceived, legacy DOS calling convention with an ill-conceived hippie idea (it's Apple's fault!1) of spaces in path names which precipitates errors like yours.


1 Yes I know, spaces (and other funny characters) in path names have been around before apple's adoption; but no sane *nix user would voluntarily name a folder "Program Files". Such nonsense has no right to exist on end user systems.