@rem @rem Copyright 2004-2008 Crypto-Pro. All rights reserved. @rem Этот файл содержит информацию, являющуюся @rem собственностью компании Крипто-Про. @rem @rem Любая часть этого файла не может быть скопирована, @rem исправлена, переведена на другие языки, @rem локализована или модифицирована любым способом, @rem откомпилирована, передана по сети с или на @rem любую компьютерную систему без предварительного @rem заключения соглашения с компанией Крипто-Про. @rem @rem --------------------------------------------------- @rem @rem Скрипт установки КриптоПро JCP v.1.0 @rem @rem Использование: @rem install.bat <путь_к_JRE> [<серийный_номер> <имя_компании>] @rem @rem Пример: @rem install.bat "E:\Program Files\Java\jdk1.5.0\jre" XXXXX-XXXXX-XXXXX-XXXXX-XXXXX "Your Company" @rem @if not "-%~1"=="-" @goto :checkjcp @echo USAGE: @echo install.bat path_to_JRE [serial_number company_name] @goto :EOF :checkjcp @if exist "%CD%\JCP.jar" @goto :checkjcpinst @echo Script must be run from the installer folder @goto :ERROR :checkjcpinst @if exist "%CD%\JCPinst.jar" @goto :setlicense @echo Script must be run from the installer folder @goto :ERROR :setlicense @set LICENSE= @if "-%~2"=="-" @goto :settempdir @set LICENSE=-serial %2 -company %3 :settempdir @set DELFILESLST= @if not "-%TMP%"=="-" @set DELFILESLST=%TMP%\delfiles.lst @if not "-%TEMP%"=="-" @set DELFILESLST=%TEMP%\delfiles.lst @if not "-%TMPDIR%"=="-" @set DELFILESLST=%TMPDIR%\delfiles.lst @if not "-%DELFILESLST%"=="-" @goto :setdelfileslst @echo Temporary directory is not set @goto :ERROR :setdelfileslst @if not exist "%DELFILESLST%" @goto :setjavacmd @del /q /f "%DELFILESLST%" :setjavacmd @set JAVACMD=java @set JREDIR= @if not "-%~1"=="-" @set JREDIR=%~1 @if not "-%JREDIR%"=="-" @goto :checkjre @goto :checklicense :checkjre @set JAVACMD="%JREDIR%\bin\java.exe" @if exist %JAVACMD% @goto :checklicense @echo File not found: %JAVACMD% @goto :ERROR :checklicense @%JAVACMD% -Xbootclasspath/p:JCP.jar ru.CryptoPro.JCP.tools.License %LICENSE% :uninstall @%JAVACMD% -version @echo ---- Uninstall started @%JAVACMD% -cp JCPinst.jar ru.CryptoPro.Install.VariantOne -uninstall all -verbose -skipfiles "%DELFILESLST%" @if "%errorlevel%"=="0" @goto :dellist @echo Uninstall failed @goto :ERROR :dellist @if not exist %DELFILESLST% @goto :hard_delete @for /F "tokens=*" %%i IN (%DELFILESLST%) DO @del /q /f "%%i" @for /F "tokens=*" %%i IN (%DELFILESLST%) DO @if exist "%%i" @goto :stopjava @del /q /f "%DELFILESLST%" :hard_delete @if "-%JREDIR%"=="-" @goto :uninstallend @echo ---- Hard delete started @echo ---- Hard delete started at %DATE% %TIME% @del /q /f "%JREDIR%\lib\ext\JCP.jar" @del /q /f "%JREDIR%\lib\ext\JCP_ASN.jar" @del /q /f "%JREDIR%\lib\ext\forms_rt.jar" @del /q /f "%JREDIR%\lib\ext\asn1rt.jar" @del /q /f "%JREDIR%\lib\ext\JCP.jar" @del /q /f "%JREDIR%\lib\ext\JCP_ASN.jar" @del /q /f "%JREDIR%\lib\ext\Oscar.jar" @del /q /f "%JREDIR%\lib\ext\JCryptoP.jar" @del /q /f "%JREDIR%\lib\ext\JCPinst.jar" @del /q /f "%JREDIR%\lib\ext\JCPxml.jar" @del /q /f "%JREDIR%\lib\ext\JCPRequest.jar" @del /q /f "%JREDIR%\lib\ext\JCP_CMS.jar" @del /q /f "%JREDIR%\lib\ext\cpSSL.jar" @del /q /f "%JREDIR%\lib\ext\Util.jar" @del /q /f "%JREDIR%\lib\ext\OCF.jar" @del /q /f "%JREDIR%\lib\ext\JCPRevCheck.jar" @del /q /f "%JREDIR%\lib\ext\JCPRevTools.jar" @del /q /f "%JREDIR%\lib\ext\AsnLite.jar" @if exist "%JREDIR%\lib\ext\JCP.jar" @goto :stopjava @if exist "%JREDIR%\lib\ext\JCP_ASN.jar" @goto :stopjava @if exist "%JREDIR%\lib\ext\forms_rt.jar" @goto :stopjava @if exist "%JREDIR%\lib\ext\asn1rt.jar" @goto :stopjava @if exist "%JREDIR%\lib\ext\JCP.jar" @goto :stopjava @if exist "%JREDIR%\lib\ext\JCP_ASN.jar" @goto :stopjava @if exist "%JREDIR%\lib\ext\Oscar.jar" @goto :stopjava @if exist "%JREDIR%\lib\ext\JCryptoP.jar" @goto :stopjava @if exist "%JREDIR%\lib\ext\JCPinst.jar" @goto :stopjava @if exist "%JREDIR%\lib\ext\JCPxml.jar" @goto :stopjava @if exist "%JREDIR%\lib\ext\JCPRequest.jar" @goto :stopjava @if exist "%JREDIR%\lib\ext\JCP_CMS.jar" @goto :stopjava @if exist "%JREDIR%\lib\ext\cpSSL.jar" @goto :stopjava @if exist "%JREDIR%\lib\ext\Util.jar" @goto :stopjava @if exist "%JREDIR%\lib\ext\OCF.jar" @goto :stopjava @if exist "%JREDIR%\lib\ext\JCPRevCheck.jar" @goto :stopjava @if exist "%JREDIR%\lib\ext\JCPRevTools.jar" @goto :stopjava @if exist "%JREDIR%\lib\ext\AsnLite.jar" @goto :stopjava @echo ---- Hard delete finished @goto :uninstallend :stopjava @echo ---- Warning @echo JVM is running or jar-files are locked @echo Stop all processes that use Java and retry @goto :ERROR :uninstallend @echo ---- Uninstall finished :install @echo ---- Install started @%JAVACMD% -cp JCPinst.jar ru.CryptoPro.Install.VariantTwo -install -verbose %LICENSE% @if "%errorlevel%"=="0" @goto :installend @echo Install failed @goto :ERROR :installend @echo ---- Install finished @echo ---- Script SUCCEEDED @goto :EOF :ERROR @echo ---- Script ERROR @goto :EOF