@echo off
  
    if %PROCESSOR_ARCHITECTURE%==x86 (goto register32) else (goto register64)
   
    :register32
        echo WINDOWS 32位系统组件注册开始...
	IF NOT EXIST C:\WINDOWS\system32\jEnvCheck.dll  (
		echo jEnvCheck.dll文件不存在，正在复制...
		copy C:\PROGRA~1\行助手\CaAssistant\control\jEnvCheck.dll    C:\WINDOWS\system32\
	) 
	IF NOT EXIST C:\WINDOWS\system32\MSCrypto.dll (
		echo MSCrypto.dll文件不存在，正在复制...
		copy C:\PROGRA~1\行助手\CaAssistant\control\MSCrypto.dll     C:\WINDOWS\system32\
	)
	IF NOT EXIST C:\WINDOWS\system32\pkiAtv.dll (
		echo pkiAtv.dll文件不存在，正在复制...
		copy C:\PROGRA~1\行助手\CaAssistant\control\pkiAtv.dll	     C:\WINDOWS\system32\
	)
	IF NOT EXIST C:\WINDOWS\system32\SignerX.dll (
		echo SignerX.dll文件不存在，正在复制...
		copy C:\PROGRA~1\行助手\CaAssistant\control\SignerX.dll      C:\WINDOWS\system32\
	)
	echo 开始注册组件
	regsvr32 C:\WINDOWS\system32\jEnvCheck.dll
        echo jEnvCheck.dll 注册成功！！
	regsvr32 C:\WINDOWS\system32\MSCrypto.dll
        echo MSCrypto.dll  注册成功！！
	regsvr32 C:\WINDOWS\system32\pkiAtv.dll
        echo pkiAtv.dll 注册成功！！
	regsvr32 C:\WINDOWS\system32\SignerX.dll
        echo SignerX.dll 注册成功！！
	goto end
    :register64
	echo WINDOWS 64位系统组件注册开始...
	IF NOT EXIST C:\WINDOWS\syswow64\jEnvCheck.dll  (
		echo jEnvCheck.dll文件不存在，正在复制...
		copy C:\PROGRA~1\行助手\CaAssistant\control\jEnvCheck.dll    C:\WINDOWS\syswow64\
	) 
	IF NOT EXIST C:\WINDOWS\syswow64\MSCrypto.dll (
		echo MSCrypto.dll文件不存在，正在复制...
		copy C:\PROGRA~1\行助手\CaAssistant\control\MSCrypto.dll     C:\WINDOWS\syswow64\
	)
	IF NOT EXIST C:\WINDOWS\syswow64\pkiAtv.dll (
		echo pkiAtv.dll文件不存在，正在复制...
		copy C:\PROGRA~1\行助手\CaAssistant\control\pkiAtv.dll	     C:\WINDOWS\syswow64\
	)
	IF NOT EXIST C:\WINDOWS\syswow64\SignerX.dll (
		echo SignerX.dll文件不存在，正在复制...
		copy C:\PROGRA~1\行助手\CaAssistant\control\SignerX.dll      C:\WINDOWS\syswow64\
	)	

	
        echo 开始注册组件
	regsvr32 C:\WINDOWS\syswow64\jEnvCheck.dll
        echo jEnvCheck.dll 注册成功！！
	regsvr32 C:\WINDOWS\syswow64\MSCrypto.dll
        echo MSCrypto.dll  注册成功！！
	regsvr32 C:\WINDOWS\syswow64\pkiAtv.dll
        echo pkiAtv.dll 注册成功！！
	regsvr32 C:\WINDOWS\syswow64\SignerX.dll
        echo SignerX.dll 注册成功！！
	goto end
    :end
    
    pause