Media Player Classic - Homecinema

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search

Silent installer for Media Player Classic - Homecinema (MPC-HC) - an open source (GPL) media player and the successor to Media Player Classic.

Installer Version[edit]

The silent uninstall mode is broken because it asks if you want to remove settings. Unregister all file associations, delete the program folder and remove the registry entry as a workaround.

<package
  id="mpc-hc"
  name="Media Player Classic - Home Cinema"
  revision="%version%"
  reboot="false"
  priority="50">

  <variable name="version" value="1.5.2.3456" />

  <check type="uninstall" condition="exists" path="Media Player Classic - Home Cinema v%version%" />

  <install cmd='"%SOFTWARE%\mpc-hc\MPC-HomeCinema.%version%.x86.exe" /silent' />
  <install cmd='"%PROGRAMFILES%\Media Player Classic - Home Cinema\mpc-hc.exe" /regvid' />
  <install cmd='%COMSPEC% /c reg add "HKCR\DVD\shell\play\command" /ve /d "\"C:\Program Files\Media Player Classic - Home Cinema\mpc-hc.exe\" \"%L\"" /f' />

  <upgrade cmd='"%SOFTWARE%\mpc-hc\MPC-HomeCinema.%version%.x86.exe" /silent' />
  <upgrade cmd='"%PROGRAMFILES%\Media Player Classic - Home Cinema\mpc-hc.exe" /regvid' />
  <upgrade cmd='%COMSPEC% /c reg add "HKCR\DVD\shell\play\command" /ve /d "\"C:\Program Files\Media Player Classic - Home Cinema\mpc-hc.exe\" \"%L\"" /f' />

  <remove cmd='"%PROGRAMFILES%\Media Player Classic - Home Cinema\mpc-hc.exe" /unregall' />
  <!-- <remove cmd='%COMSPEC% /C del /f /q "%PROGRAMFILES%\Media Player Classic - Home Cinema"' /> -->
  <remove cmd='"%PROGRAMFILES%\Media Player Classic - Home Cinema\unins000.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART' />
  <remove cmd='%COMSPEC% /C reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2624B969-7135-4EB1-B0F6-2D8C397B45F7}_is1" /va /f' />
</package>

Registering File Associations[edit]

Use the command line switches /regaud and /regvid to to register the file type associations for audio and video files. Use /unregall to remove all file associations. See mpc-hc.exe /? for all of the command line switches.

<install cmd='"%PROGRAMFILES%\Media Player Classic - Home Cinema\mpc-hc.exe" /regvid' />
<upgrade cmd='"%PROGRAMFILES%\Media Player Classic - Home Cinema\mpc-hc.exe" /regvid' />
<remove cmd='"%PROGRAMFILES%\Media Player Classic - Home Cinema\mpc-hc.exe" /unregall' />

Playing DVDs[edit]

I had trouble getting MPC-HC to play DVDs from Windows Explorer. This registry changes seems to work on XP.

<install cmd='%COMSPEC% /c reg add "HKCR\DVD\shell\play\command" /ve /d "\"C:\Program Files\Media Player Classic - Home Cinema\mpc-hc.exe\" \"%L\"" /f' />

Standalone Version[edit]

<package id="mpc-hc" 
  name="Media Player Classic - Home Cinema" 
  revision="20081129" 
  reboot="false" 
  priority="0">
  <check type="file" condition="exists" path="%PROGRAMFILES%\mpc-hc\mplayerc.exe" />
  <install cmd='%SOFTWARE%\mpc-hc\install.bat' />
  <remove cmd='%SOFTWARE%\mpc-hc\remove.bat' />
  <upgrade cmd='%SOFTWARE%\mpc-hc\remove.bat' />
  <upgrade cmd='%SOFTWARE%\mpc-hc\install.bat' />
</package>

install.bat[edit]

mkdir "%ProgramFiles%\mpc-hc"
copy /Y "%SOFTWARE%\mpc-hc\mplayerc.exe" "%ProgramFiles%\mpc-hc"
copy /Y "%SOFTWARE%\mpc-hc\*.dll" "%ProgramFiles%\mpc-hc"
copy /Y "%SOFTWARE%\mpc-hc\Media Player Classic.lnk" "%ALLUSERSPROFILE%\Start Menu\Programs\"

remove.bat[edit]

del /f /q "%ProgramFiles%\mpc-hc\*.dll"
del /f /q "%ProgramFiles%\mpc-hc\mplayerc.exe"
del /f /q "%ProgramFiles%\mpc-hc"
del /f /q "%ALLUSERSPROFILE%\Start Menu\Programs\Media Player Classic.lnk"