@ECHO off 
MODE con: COLS=80 lINES=10 &color 0A
cls
title Haali 安装卸载工具
if exist "Haali_卸载.bat" goto B   
goto A
:A
if exist splitter.ax goto disable
goto error2
exit
:B
if exist splitter.ax goto enable
goto error2
exit
:disable
reg add "HKLM\SOFTWARE\Classes\Media Type\{e436eb83-524f-11ce-9f53-0020af0ba770}\{49952F4C-3EDC-4A9B-8906-1DE02A3D4BC2}" /v "0" /t REG_SZ /d "0,4,,1A45DFA3" /f >nul
reg add "HKLM\SOFTWARE\Classes\Media Type\{e436eb83-524f-11ce-9f53-0020af0ba770}\{49952F4C-3EDC-4A9B-8906-1DE02A3D4BC2}" /v "1" /t REG_SZ /d "0,4,,52494646,8,4,,43445841,36,4,,64617461,68,4,,1A45DFA3" /f >nul
reg add "HKLM\SOFTWARE\Classes\Media Type\{e436eb83-524f-11ce-9f53-0020af0ba770}\{49952F4C-3EDC-4A9B-8906-1DE02A3D4BC2}" /v "Source Filter" /t REG_SZ /d "{55DA30FC-F16B-49FC-BAA5-AE59FC65F82D}" /f >nul
reg add "HKLM\SOFTWARE\HaaliMkx\Input" /v "avi.1" /t REG_SZ /d "ffffffff00000000ffffffff,524946460000000041564920,{51A00247-40A8-4845-9F17-7DBFCC9A8783}" /f >nul
reg add "HKLM\SOFTWARE\HaaliMkx\Input" /v "mp4.1" /t REG_SZ /d "00000000ffffffff,0000000066747970,{B3DE7EDC-0CD4-4d07-B1C5-92219CD475CC}" /f >nul
reg add "HKLM\SOFTWARE\HaaliMkx\Input" /v "mp4.2" /t REG_SZ /d "00000000ffffffff,000000006d6f6f76,{B3DE7EDC-0CD4-4d07-B1C5-92219CD475CC}" /f >nul
reg add "HKLM\SOFTWARE\HaaliMkx\Input" /v "mp4.3" /t REG_SZ /d "00000000ffffffff,000000006d646174,{B3DE7EDC-0CD4-4d07-B1C5-92219CD475CC}" /f >nul
reg add "HKLM\SOFTWARE\HaaliMkx\Input" /v "ogm.1" /t REG_SZ /d "ffffffff,4f676753,{DB43B405-43AA-4f01-82D8-D84D47E6019C}" /f >nul
reg add "HKLM\SOFTWARE\HaaliMkx\Input" /v "ts.1" /t REG_SZ /d "ff,47,{B841F346-4835-4de8-AA5E-2E7CD2D4C435}" /f >nul
regsvr32 /S dxr.dll
regsvr32 /S mp4.dll
regsvr32 /S ts.dll
regsvr32 /S mkx.dll
regsvr32 /S ogm.dll
regsvr32 /S avs.dll
regsvr32 /S avi.dll
regsvr32 /S splitter.ax
start "提示"  cmd /c "mode con  cols=55 lines=5&color 0A &echo. Haali分离器已安装成功,运行"Haali_卸载.bat"可卸载.&ping/n 2 400.1>nul"
ren %0 "Haali_卸载.bat"
exit
:enable 
reg delete "HKLM\SOFTWARE\Classes\Media Type\{e436eb83-524f-11ce-9f53-0020af0ba770}\{49952F4C-3EDC-4A9B-8906-1DE02A3D4BC2}" /f >nul
regsvr32 /S /U dxr.dll
regsvr32 /S /U mp4.dll
regsvr32 /S /U ts.dll
regsvr32 /S /U mkx.dll
regsvr32 /S /U ogm.dll
regsvr32 /S /U avs.dll
regsvr32 /S /U avi.dll
regsvr32 /S /U splitter.ax
reg delete "HKLM\SOFTWARE\HaaliMkx\Input" /f >nul
start "提示"  cmd /c "mode con  cols=50 lines=5&color 0A &echo. Haali分离器已卸载成功,运行"Haali_安装.bat"可安装.&ping/n 2 400.1>nul"
ren %0 "Haali_安装.bat"
exit
:error2
start "提示"  cmd /c "mode con  cols=60 lines=5&color 0A &echo. 请将本文件放置于 Haali 目录中运行.&ping/n 2 400.1>nul"