rem @echo off
Setlocal enabledelayedexpansion
for /f "delims=: tokens=1,*" %%i in ('REG QUERY HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\ESUNMVP_PLUS /v "InstallLocation"') do (
	set str=%%i
	set var=%%j
	set ESUNAP_PLUS_InstallFolder="!str:~-1!:!var!"
)
echo Install Folder = [%ESUNAP_PLUS_InstallFolder%]

cd /D %ESUNAP_PLUS_InstallFolder%
regsvr32 %ESUNAP_PLUS_InstallFolder%\XQTrade\ESUNAP\exe\apiESUNAP.dll /u
regsvr32 %ESUNAP_PLUS_InstallFolder%\XQTrade\ESUNAP\exe\apiESUNAP.dll

echo ³ø»ù API µù¥U
%windir%\SysWOW64\regsvr32 %ESUNAP_PLUS_InstallFolder%\JDESUNAPQuoteObj.dll

reg add "HKCR\Wow6432Node\clsid\{EC98EF96-037D-4dec-9490-CD38FCDFB686}" /ve /t REG_SZ /d "Application Class" /f
reg add "HKCR\Wow6432Node\clsid\{EC98EF96-037D-4dec-9490-CD38FCDFB686}\LocalServer32" /ve /t REG_SZ /d "%ESUNAP_PLUS_InstallFolder%\daqESUNAP.exe" /f
reg add "HKCR\Wow6432Node\clsid\{EC98EF96-037D-4dec-9490-CD38FCDFB686}\ProgID" /ve /t REG_SZ /d "JDESUNAPQuoteObj.Application.1" /f
reg add "HKCR\Wow6432Node\clsid\{EC98EF96-037D-4dec-9490-CD38FCDFB686}\Programmable" /f
reg add "HKCR\Wow6432Node\clsid\{EC98EF96-037D-4dec-9490-CD38FCDFB686}\TypeLib" /ve /t REG_SZ /d "{1126F5E4-F3A2-4756-B072-AEEDAFE2E36E}" /f
reg add "HKCR\Wow6432Node\clsid\{EC98EF96-037D-4dec-9490-CD38FCDFB686}\VersionIndependentProgID" /ve /t REG_SZ /d "{JDESUNAPQuoteObj.Application}" /f

pause