Wednesday, August 19, 2009

Media Player Classic Rollout

We just solved a problem a customer had with media playback using Windows Media Player (WMP).

Basically there were two problems associated with WMP: First, several users complained that opening a file with WMP takes a long time. Secondly, a lot of users were confused by all the controls WMP offers and asked how to “clean” the interface. The help desk database showed that about 130 tickets were created about these issues in the last three months.

Our first idea was to see if we could solve this problem with registry settings and/or GPO settings. However, I personally didn’t use WMP for several years now; I always use Media Player Classic (MPC). Showing Media Player Classic the users that reported one of these issues the most resulted in one reaction: “Great. Exactly what I need”. If you do not quite understand what the user means, here’s an example of the interface difference between WMP and MPC:


_


Sure thing, this means we will roll out MPC to 550+ computers! A very important requirement of this rollout was that the changes could be reverted back easily. As Microsoft is constantly updating WMP, it might happen that a new version brings back a “clean” interface and is faster. At that time, MPC would be replaced by WMP again.

Therefore, we have created some .REG files and some .BAT files that install MPC. These scripts will then be executed by the computer management solution of the customer.

The first thing is to download MPC from http://mpc-hc.sourceforge.net/, and copying these files to Program Files folder.

md "%programfiles%\Media Player Classic\"

copy S:\soft\MPC\MPC_prog\*.* "%programfiles%\Media Player Classic" /V /Y

After that, Windows should know that a new program is available so we’ll add MPC to the “Applications” list by using this .REG file (simply import this file with the command regedit.exe /S app.reg)

REGEDIT4

[HKEY_CLASSES_ROOT\Applications\mplayerc.exe]
@="Media Player Classic"
"FriendlyAppName"="Media Player Classic"

[HKEY_CLASSES_ROOT\Applications\mplayerc.exe\DefaultIcon]
@="mplayerc.exe,0"

[HKEY_CLASSES_ROOT\Applications\mplayerc.exe\shell]
@="open"

[HKEY_CLASSES_ROOT\Applications\mplayerc.exe\shell\open]
@="&Open"

[HKEY_CLASSES_ROOT\Applications\mplayerc.exe\shell\open\command]
@="mplayerc.exe \"%L\""

[HKEY_CLASSES_ROOT\Applications\mplayerc.exe\shell\play]
@="&Play"

[HKEY_CLASSES_ROOT\Applications\mplayerc.exe\shell\play\command]
@="mplayerc.exe \"%L\""

[HKEY_CLASSES_ROOT\Applications\mplayerc.exe\SupportedTypes]
"WAV"=""
"WMA"=""
"MP3"=""
"OGG"=""
"SND"=""
"AU"=""
"AIF"=""
"AIFC"=""
"AIFF"=""
"MIDI"=""
"MPEG"=""
"MPG"=""
"MP2"=""
"VOB"=""
"AC3"=""
"DTS"=""
"ASX"=""
"M3U"=""
"PLS"=""
"WAX"=""
"ASF"=""
"WM"=""
"WMA"=""
"WMV"=""
"AVI"=""
"CDA"=""
"JPEG"=""
"JPG"=""
"GIF"=""
"PNG"=""
"BMP"=""
"D2V"=""
"MP4"=""
"SWF"=""
"MOV"=""
"QT"=""
"FLV"=""

After this, users can already right click any supported file type, select “Open with..” and choose “Media Player Classic”. However, when doing so this won’t work because Windows does not know where the file “mplayerc.exe” is. This REG file will help Windows to locate it:

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\mplayerc.exe]
@="C:\\Program Files\\Media Player Classic\\mplayerc.exe"
"Path"="C:\\Program Files\\Media Player Classic\\"

Although it is of course possible to include the complete path in the first REG, we are using the AppPaths here because this gives us one location where MPLAYERC.exe is located. This will be more important later on.

The next step is to associate the needed files with MPC. As said earlier, we are trying to accomplish this as least changes as possible. Therefore we are simply adding to each file type that should open with MPC, a new command “Play2” and make this command the default. That way, switching back to Windows Media Player just requires changing the default command.

Please note that we are only changing those files that customer is using (often or sometimes) and leaving all other, even if MPC supports them, alone:

REGEDIT4

; .wav = soundrec (#1)
; default "play"
[HKEY_CLASSES_ROOT\SoundRec\shell]
@="play2"

[HKEY_CLASSES_ROOT\SoundRec\shell\play2]
@="&Open"

[HKEY_CLASSES_ROOT\SoundRec\shell\play2\command]
@="mplayerc.exe \"%L\""

; .mpeg = mpegfile (#2)
; default "play"
[HKEY_CLASSES_ROOT\mpegfile\shell]
@="play2"

[HKEY_CLASSES_ROOT\mpegfile\shell\play2]
@="&Open"

[HKEY_CLASSES_ROOT\mpegfile\shell\play2\command]
@="mplayerc.exe \"%L\""

; .avi = avifile (#3)
; default "play"
[HKEY_CLASSES_ROOT\avifile\shell]
@="play2"

[HKEY_CLASSES_ROOT\avifile\shell\play2]
@="&Open"

[HKEY_CLASSES_ROOT\avifile\shell\play2\command]
@="mplayerc.exe \"%L\""

; .mp3 = mp3file (#4)
; default "play"
[HKEY_CLASSES_ROOT\mp3file\shell]
@="play2"

[HKEY_CLASSES_ROOT\mp3file\shell\play2]
@="&Open"

[HKEY_CLASSES_ROOT\mp3file\shell\play2\command]
@="mplayerc.exe \"%L\""

; .mid = midfile (#5)
; default "play"
[HKEY_CLASSES_ROOT\midfile\shell]
@="play2"

[HKEY_CLASSES_ROOT\midfile\shell\play2]
@="&Open"

[HKEY_CLASSES_ROOT\midfile\shell\play2\command]
@="mplayerc.exe \"%L\""

; .MKV -> Not existsting by default (#6)
[HKEY_CLASSES_ROOT\.mkv]
@="MKVFile"

[HKEY_CLASSES_ROOT\MKVFile\DefaultIcon]
@="mplayerc.exe,0"

[HKEY_CLASSES_ROOT\MKVFile\shell]
@="play2"

[HKEY_CLASSES_ROOT\MKVFile\shell\play2]
@="&Open"

[HKEY_CLASSES_ROOT\MKVFile\shell\play2\command]
@="mplayerc.exe \"%L\""

; .divx = divxFile (#7)
; default "open"
[HKEY_CLASSES_ROOT\divxFile\shell]
@="play2"

[HKEY_CLASSES_ROOT\divxFile\shell\play2]
@="&Open"

[HKEY_CLASSES_ROOT\divxFile\shell\play2\command]
@="mplayerc.exe \"%L\""

; .FLV -> Not existing by default (#8)
[HKEY_CLASSES_ROOT\.flv]
@="Flash.VideoFile"

[HKEY_CLASSES_ROOT\Flash.VideoFile\DefaultIcon]
@="mplayerc.exe,0"

[HKEY_CLASSES_ROOT\Flash.VideoFile\shell]
@="play2"

[HKEY_CLASSES_ROOT\Flash.VideoFile\shell\play2]
@="&Open"

[HKEY_CLASSES_ROOT\Flash.VideoFile\shell\play2\command]
@="mplayerc.exe \"%L\""

As you can see, we are reusing the AppPath from above by executing “mplayerc.exe” without any path. If you want to install MPC in a different folder, just change the AppPath and everything else will still work. We simply find that a simpler solution then entering the complete path in every command, although Windows needs some milliseconds more to locate mplayerc.exe.

Once all these REG files have been imported (REGEDIT.EXE /S (SOMETHING).reg), give it a try if all files are opened with MPC as expected. In case you need test files, some very good ones could be found at Fx Sound and Magic.

Enjoy!

No comments:

Post a Comment