ehlib自动安装bat

ehlib自动安装bat

@Echo off

set DVer=7
set CVer=10.1.029
set DBpl="D:\Program Files\Borland\Delphi7\Projects\Bpl"
set DCC32="D:\Program Files\Borland\Delphi7\Bin\Dcc32.exe" -Q -B -H -W -$D- -$L- -$Y- -LN -LE
set Log=..\..\EhlibInstallerD7.log
set Lib=%CVer%\LibD%DVer%

if exist %log% del %log%

call :MDDir
call :CopyFile
call :Compile
call :CopyBpl
call :RegDel
call :RegAdd

type %Log% | find "Fatal"
type %Log% | find " Error"
type %Log% | find "失败"
pause
goto :eof


:MDDir
echo 建立文件夹 ==================================================
if not exist %Lib% md %Lib%
del /Q %Lib%\*.* >nul

if not exist %Lib%_bpl md %Lib%_bpl
del /Q %Lib%_bpl\*.* >nul
goto :eof


:CopyFile
echo 复制源文件 ==================================================
cd /d %Lib%
>>%Log% copy /Y ..\Common\*.*
>>%Log% copy /Y ..\LangResources\Res.Ansi\*.*
>>%Log% copy /Y ..\RADSpecific\Delphi%DVer%\*.*

>>%Log% copy /Y ..\..\PrviewEh.res
>>%Log% copy /Y ..\..\EhLibLangConsts.dfm
goto :eof


:Compile
echo 编译包文件 ==================================================
:: cd /d %Lib%
>>%Log% %DCC32% Ehlib%DVer%0.dpk
>>%Log% %DCC32% EhLibADODataDrivers%DVer%0.dpk
>>%Log% %DCC32% EhLibBDEDataDrivers%DVer%0.dpk
>>%Log% %DCC32% EhLibDBXDataDrivers%DVer%0.dpk
>>%Log% %DCC32% EhLibIBXDataDrivers%DVer%0.dpk
>>%Log% %DCC32% DclEhlib%DVer%0.dpk
>>%Log% %DCC32% DclEhLibADODataDrivers%DVer%0.dpk
>>%Log% %DCC32% DclEhLibBDEDataDrivers%DVer%0.dpk
>>%Log% %DCC32% DclEhLibDBXDataDrivers%DVer%0.dpk
>>%Log% %DCC32% DclEhLibIBXDataDrivers%DVer%0.dpk
goto:eof


:CopyBpl
echo 复制BPL =====================================================
>>%Log% copy /Y *.bpl ..\LibD%DVer%_bpl\*.*
>>%Log% copy /Y *.dcp ..\LibD%DVer%_bpl\*.*
>>%Log% copy /Y *.bpl %DBpl%\*.*
>>%Log% copy /Y *.dcp %DBpl%\*.*
del /Q *.dcp >nul
del /Q *.bpl >nul
goto :eof


:RegDel
echo 删除注册 ====================================================
echo 删除注册 >>%Log%
set RDel=REG DELETE HKCU\Software\Borland\Delphi\7.0\Known" "Packages /v %DBpl%
>>%Log% %RDel%\DclEhlib%DVer%0.bpl    /f 
>>%Log% %RDel%\DclEhLibADODataDrivers%DVer%0.bpl  /f
>>%Log% %RDel%\DclEhLibBDEDataDrivers%DVer%0.bpl  /f
>>%Log% %RDel%\DclEhLibDBXDataDrivers%DVer%0.bpl  /f
>>%Log% %RDel%\DclEhLibIBXDataDrivers%DVer%0.bpl  /f
goto :eof


:RegAdd
echo 增加注册 ====================================================
echo 增加注册 >>%Log%
set RAdd=REG ADD HKCU\Software\Borland\Delphi\7.0\Known" "Packages /v %DBpl%
>>%Log% %RAdd%\DclEhlib%DVer%0.bpl                /f /t REG_SZ /d "EhLib(%CVer%) Components" 
>>%Log% %RAdd%\DclEhLibADODataDrivers%DVer%0.bpl  /f /t REG_SZ /d "EhLib(%CVer%) DataDrivers for ADO"
>>%Log% %RAdd%\DclEhLibBDEDataDrivers%DVer%0.bpl  /f /t REG_SZ /d "EhLib(%CVer%) DataDrivers for BDE"
>>%Log% %RAdd%\DclEhLibDBXDataDrivers%DVer%0.bpl  /f /t REG_SZ /d "EhLib(%CVer%) DataDrivers for DBX"
>>%Log% %RAdd%\DclEhLibIBXDataDrivers%DVer%0.bpl  /f /t REG_SZ /d "EhLib(%CVer%) DataDrivers for IBX"
goto :eof

 

posted @ 2025-03-28 09:35  delphi中间件  阅读(27)  评论(0)    收藏  举报