@echo off
PUSHD %~dp0
cd /d "%~dp0"

rem ====金山公式：MathType 3.3

set xtxt=xx86
if exist "%windir%\SysWOW64" set xtxt=xx64

reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}" /f /ve /t REG_SZ /d "A Equation"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\0" /f /ve /t REG_SZ /d "编辑(&E),0,2"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\1" /f /ve /t REG_SZ /d "打开(&O),0,2"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\AuxUserType\2" /f /ve /t REG_SZ /d "Equation"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\AuxUserType\3" /f /ve /t REG_SZ /d "WPS 公式 3.0"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\Conversion\Readable\Main" /f /ve /t REG_SZ /d "Equation,Equation.2,1"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\DataFormats\GetSet\0" /f /ve /t REG_SZ /d "Document,1,1,3"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\DataFormats\GetSet\1" /f /ve /t REG_SZ /d "Embed_Source,1,8,1"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\DataFormats\GetSet\2" /f /ve /t REG_SZ /d "1,1,1,3"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\DataFormats\GetSet\3" /f /ve /t REG_SZ /d "3,1,32,1"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\DefaultIcon" /f /ve /t REG_SZ /d "%cd%\Ksee\EqnEdit.exe"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\InProcHandler" /f /ve /t REG_SZ /d "ole32.dll"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\InProcHandler32" /f /ve /t REG_SZ /d "ole32.dll"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\Insertable" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\LocalServer" /f /ve /t REG_SZ /d "%cd%\Ksee\EqnEdit.exe"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\LocalServer32" /f /ve /t REG_SZ /d "%cd%\Ksee\EqnEdit.exe"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\MiscStatus" /f /ve /t REG_SZ /d "0"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\MiscStatus\16" /f /ve /t REG_SZ /d "1"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\ProgID" /f /ve /t REG_SZ /d "Equation.KSEE3"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\verb\0" /f /ve /t REG_SZ /d "编辑(&E),0,2"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\verb\1" /f /ve /t REG_SZ /d "打开(&O),0,2"
reg add "HKLM\SOFTWARE\Classes\CLSID\{0002CE21-0000-0000-C000-000000000046}\VersionIndependentProgID" /f /ve /t REG_SZ /d "DSEquations"
rem reg add "HKLM\SOFTWARE\Classes\DSEquations" /f /ve /t REG_SZ /d "A Equation"
rem reg add "HKLM\SOFTWARE\Classes\DSEquations\CLSID" /f /ve /t REG_SZ /d "{0002CE21-0000-0000-C000-000000000046}"
rem reg add "HKLM\SOFTWARE\Classes\DSEquations\CurVer" /f /ve /t REG_SZ /d "Equation.KSEE3"
rem reg add "HKLM\SOFTWARE\Classes\DSEquations\Installed\Equation.KSEE3" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\Equation.KSEE3" /f /ve /t REG_SZ /d "Equation-金山公式"
reg add "HKLM\SOFTWARE\Classes\Equation.KSEE3\CLSID" /f /ve /t REG_SZ /d "{0002CE21-0000-0000-C000-000000000046}"
reg add "HKLM\SOFTWARE\Classes\Equation.KSEE3\DefaultIcon" /f /ve /t REG_SZ /d "%cd%\Ksee\EqnEdit.exe"
reg add "HKLM\SOFTWARE\Classes\Equation.KSEE3\Protocol\StdExecute\Server" /f /ve /t REG_SZ /d "%cd%\Ksee\EqnEdit.exe"
reg add "HKLM\SOFTWARE\Classes\Equation.KSEE3\Protocol\StdFileEditing\RequestDataFormats" /f /ve /t REG_SZ /d "Native,CF_METAFILEPICT,EqnDims"
reg add "HKLM\SOFTWARE\Classes\Equation.KSEE3\Protocol\StdFileEditing\Server" /f /ve /t REG_SZ /d "%cd%\Ksee\EqnEdit.exe"
reg add "HKLM\SOFTWARE\Classes\Equation.KSEE3\Protocol\StdFileEditing\SetDataFormats" /f /ve /t REG_SZ /d "Native,RTF"
reg add "HKLM\SOFTWARE\Classes\Equation.KSEE3\Protocol\StdFileEditing\Verb\0" /f /ve /t REG_SZ /d "Edit"
reg add "HKLM\SOFTWARE\Classes\Equation.KSEE3\shell\open\command" /f /ve /t REG_SZ /d "%cd%\Ksee\EqnEdit.exe"
reg add "HKEY_CURRENT_USER\Software\Design Science" /f /ve /t REG_SZ /d ""
reg add "HKEY_CURRENT_USER\Software\Design Science\KSEE3" /f /ve /t REG_SZ /d ""

if /i not "%xtxt%"=="xx64" goto ddt
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}" /f /ve /t REG_SZ /d "A Equation"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\0" /f /ve /t REG_SZ /d "编辑(&E),0,2"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\1" /f /ve /t REG_SZ /d "打开(&O),0,2"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\AuxUserType\2" /f /ve /t REG_SZ /d "Equation"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\AuxUserType\3" /f /ve /t REG_SZ /d "WPS 公式 3.0"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\Conversion\Readable\Main" /f /ve /t REG_SZ /d "Equation,Equation.2,1"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\DataFormats\GetSet\0" /f /ve /t REG_SZ /d "Document,1,1,3"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\DataFormats\GetSet\1" /f /ve /t REG_SZ /d "Embed_Source,1,8,1"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\DataFormats\GetSet\2" /f /ve /t REG_SZ /d "1,1,1,3"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\DataFormats\GetSet\3" /f /ve /t REG_SZ /d "3,1,32,1"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\DefaultIcon" /f /ve /t REG_SZ /d "%cd%\Ksee\EqnEdit.exe"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\InProcHandler" /f /ve /t REG_SZ /d "ole32.dll"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\InProcHandler32" /f /ve /t REG_SZ /d "ole32.dll"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\Insertable" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\LocalServer" /f /ve /t REG_SZ /d "%cd%\Ksee\EqnEdit.exe"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\LocalServer32" /f /ve /t REG_SZ /d "%cd%\Ksee\EqnEdit.exe"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\MiscStatus" /f /ve /t REG_SZ /d "0"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\MiscStatus\16" /f /ve /t REG_SZ /d "1"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\ProgID" /f /ve /t REG_SZ /d "Equation.KSEE3"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\verb\0" /f /ve /t REG_SZ /d "编辑(&E),0,2"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\verb\1" /f /ve /t REG_SZ /d "打开(&O),0,2"
reg add "HKLM\SOFTWARE\Classes\Wow6432Node\CLSID\{0002CE21-0000-0000-C000-000000000046}\VersionIndependentProgID" /f /ve /t REG_SZ /d "DSEquations"

reg add "HKLM\SOFTWARE\Wow6432Node\Classes\Equation.KSEE3" /f /ve /t REG_SZ /d "Equation-金山公式"
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\Equation.KSEE3\CLSID" /f /ve /t REG_SZ /d "{0002CE21-0000-0000-C000-000000000046}"
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\Equation.KSEE3\DefaultIcon" /f /ve /t REG_SZ /d "%cd%\Ksee\EqnEdit.exe"
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\Equation.KSEE3\Protocol\StdExecute\Server" /f /ve /t REG_SZ /d "%cd%\Ksee\EqnEdit.exe"
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\Equation.KSEE3\Protocol\StdFileEditing\RequestDataFormats" /f /ve /t REG_SZ /d "Native,CF_METAFILEPICT,EqnDims"
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\Equation.KSEE3\Protocol\StdFileEditing\Server" /f /ve /t REG_SZ /d "%cd%\Ksee\EqnEdit.exe"
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\Equation.KSEE3\Protocol\StdFileEditing\SetDataFormats" /f /ve /t REG_SZ /d "Native,RTF"
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\Equation.KSEE3\Protocol\StdFileEditing\Verb\0" /f /ve /t REG_SZ /d "Edit"
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\Equation.KSEE3\shell\open\command" /f /ve /t REG_SZ /d "%cd%\Ksee\EqnEdit.exe"
:ddt

exit
