@echo off
CD /d "%~dp0"
set _version=3.60.1196.0

echo Install Devart Developer setup installation


echo Setting environment variables for Devart dotConnect Universal v%_version%...
set _programFiles=%ProgramFiles%
set _commonFiles=%CommonProgramFiles%


set ProductDir="%_programFiles%\Devart\dotConnect\Universal"
set ProviderGACDir=%windir%\assembly\GAC_MSIL\Devart.Data.Universal\%_version%__09af7300eec23701
set DesignerGACDir=%windir%\assembly\GAC_MSIL\Devart.Data.Universal.Design\%_version%__09af7300eec23701
set AddinGACDir=%windir%\assembly\GAC_MSIL\Devart.Data.Universal.Vs\%_version%__09af7300eec23701

set Vs14="%_programFiles%\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies"

echo Deleting original "Devart.Data.Universal.dll" file and copying patched file to all locations 

echo Deleting original "Devart.Data.Universal.dll" file and copying patched file to all locations 
if exist %ProviderGACDir% (
  del /Q %ProviderGACDir%\*.*
) else (
  mkdir %ProviderGACDir%
)

copy Devart.Data.Universal.dll %ProviderGACDir%
copy Devart.Data.Universal.dll %ProductDir%
copy Devart.Data.Universal.dll "%_commonFiles%\Devart\dotConnect\5.0\Net2\Common"

echo Deleting original "Devart.Data.Universal.Designer.dll" file and copying patched file to all locations 
if exist %DesignerGACDir% (
  del /Q %DesignerGACDir%\*.*
) else (
  mkdir %DesignerGACDir%
)
copy Devart.Data.Universal.Design.dll %DesignerGACDir%
copy Devart.Data.Universal.Design.dll %ProductDir%

echo Deleting original "Devart.Data.Universal.Vs.dll" file and copying patched file to all locations 
if exist %Vs14% (
  copy Devart.Data.Universal.Design.dll %Vs14%
)

if exist %AddinGACDir% (
  del /Q %AddinGACDir%\*.*
) else (
  mkdir %AddinGACDir%
)
copy Devart.Data.Universal.Vs.dll %AddinGACDir%
copy Devart.Data.Universal.Vs.dll %ProductDir%

echo All is done!
pause