Skip to content

Commit

Permalink
Add Windows installer script
Browse files Browse the repository at this point in the history
  • Loading branch information
cniw committed May 27, 2018
1 parent 71b08e3 commit e14fc85
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ mode when idle, while when playing, paused, and buffering use 'left' time mode.

## Install
1. For Linux, installing just run `install-linux.sh` on terminal.
2. For Windows,
2. For Windows, installing just run `install-win.bat` by double-clicking it.
If you prefer installing manually, follow the step:
- Open file `discord-rpc-win.zip` and extract file `discord-rpc\win32-dynamic\bin\discord-rpc.dll`
if your system is 32-bit or `discord-rpc\win64-dynamic\bin\discord-rpc.dll`
if your system is 64-bit to same folder that contain `mpv.exe`
Expand Down
54 changes: 54 additions & 0 deletions install-win.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
@echo off
title mpv-discordRPC Installer
echo mpv-discordRPC Windows installer script
echo ===========================================================================

:set_mpv_dir
echo Enter mpv directory E.g.: D:\Applications\mpv-x86_64-20171225
set /p mpv_dir="mpv folder: "
echo:

if exist "%mpv_dir%" (
if exist "%mpv_dir%\mpv.exe" (
goto install_library
) else (
echo Please try again, 'mpv.exe' can't found on that directory.
echo:
goto set_mpv_dir
)
) else (
echo Please try again, not a invalid directory.
echo:
goto set_mpv_dir
)

:install_library
unzip -qq ".\discord-rpc-win.zip"
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > nul && set os=32bit || set os=64bit
if %os%==32bit copy ".\discord-rpc\win32-dynamic\bin\discord-rpc.dll" "%mpv_dir%" > nul
if %os%==64bit copy ".\discord-rpc\win64-dynamic\bin\discord-rpc.dll" "%mpv_dir%" > nul
@rd /s /q ".\discord-rpc"

:set_scripts_dir
echo [1] install script on %mpv_dir%
echo [2] install script on %appdata%\mpv
set /p scripts_dir_select="select [1/2]: "
echo:

if %scripts_dir_select%==1 (
set scripts_dir="%mpv_dir%\scripts"
goto install_scripts
)
if %scripts_dir_select%==2 (
set scripts_dir="%appdata%\mpv\scripts"
goto install_scripts
) else goto set_scripts_dir

:install_scripts
if not exist "%scripts_dir%" mkdir "%scripts_dir%"
copy .\*.lua "%scripts_dir%" > nul

echo:
echo [discordapp] wachidadinugroho#7674: All done. Good Luck and have a nice day.
echo:
pause
Binary file added unzip.exe
Binary file not shown.

0 comments on commit e14fc85

Please sign in to comment.