An easier way to register the Assemblies' Instrumentation In Enterprise Library

I know that we have a link on the start menu to run the batch file that registers all the assemblies instrumentation, but there is an easier way.   The batch file (Install Services.bat) requires that you have VS installed and assumes that you have it installed in the default location (C:\Program Files\…). Actually all you really need is installutil on the path.  If it got shipped, in the Common\Instrumentation\Scripts folder, there are two files called Install Instrumentation.cad and UninstallInstrumenation.cad.  Now we used this during development to register the assemblies.  You could modify this to register your assemblies at deployment time.   The parameter you pass to the script is the output directory you built the assemblies to.  For example if you built the Debug version of the library, you would run InstallInstrumentation.cmd Debug.

Since I don’t know if you guys have the files. I will post them here:

InstallInstrumentation.cmd
@echo off

echo ==================================================
echo Installing Common Instrumentation
echo ==================================================
installutil ..\..\bin\%1\Microsoft.Practices.EnterpriseLibrary.Common.dll

echo ==================================================
echo Installing Configuration Instrumentation
echo ==================================================
installutil ..\..\bin\%1\Microsoft.Practices.EnterpriseLibrary.Configuration.dll

echo ==================================================
echo Installing Data Instrumentation
echo ==================================================
installutil ..\..\..\Data\bin\%1\Microsoft.Practices.EnterpriseLibrary.Data.dll

echo ==================================================
echo Installing Caching Instrumentation
echo ==================================================
installutil ..\..\..\Caching\bin\%1\Microsoft.Practices.EnterpriseLibrary.Caching.dll

echo ==================================================
echo Installing Logging Instrumentation
echo ==================================================
installutil ..\..\..\Logging\bin\%1\Microsoft.Practices.EnterpriseLibrary.Logging.dll

echo ==================================================
echo Installing Logging Instrumentation Tests
echo ==================================================
installutil ..\..\..\Logging\Sinks\WMISchema\bin\%1\Microsoft.Practices.EnterpriseLibrary.Logging.Sinks.WMISchema.Tests.dll

echo ==================================================
echo Installing ExceptionHandling Instrumentation
echo ==================================================
installutil ..\..\..\ExceptionHandling\bin\%1\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll

echo ==================================================
echo Installing Security Instrumentation
echo ==================================================
installutil ..\..\..\Security\bin\%1\Microsoft.Practices.EnterpriseLibrary.Security.dll

echo ==================================================
echo Installing Security Cryptography Instrumentation
echo ==================================================
installutil ..\..\..\Security\Cryptography\bin\%1\Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.dll

UninstallInstrumenation.cmd
@echo off

echo ==================================================
echo Uninstalling Common Instrumentation
echo ==================================================
installutil /u ..\..\bin\%1\Microsoft.Practices.EnterpriseLibrary.Common.dll

echo ==================================================
echo Uninstalling Configuration Instrumentation
echo ==================================================
installutil /u ..\..\bin\%1\Microsoft.Practices.EnterpriseLibrary.Configuration.dll

echo ==================================================
echo Uninstalling Data Instrumentation
echo ==================================================
installutil /u ..\..\..\Data\bin\%1\Microsoft.Practices.EnterpriseLibrary.Data.dll

echo ==================================================
echo Uninstalling Caching Instrumentation
echo ==================================================
installutil /u ..\..\..\Caching\bin\%1\Microsoft.Practices.EnterpriseLibrary.Caching.dll

echo ==================================================
echo Uninstalling Logging Instrumentation
echo ==================================================
installutil /u ..\..\..\Logging\bin\%1\Microsoft.Practices.EnterpriseLibrary.Logging.dll

echo ==================================================
echo Installing Logging Instrumentation Tests
echo ==================================================
installutil /u ..\..\..\Logging\Sinks\WMISchema\bin\%1\Microsoft.Practices.EnterpriseLibrary.Logging.Sinks.WMISchema.Tests.dll

echo ==================================================
echo Uninstalling ExceptionHandling Instrumentation
echo ==================================================
installutil /u ..\..\..\ExceptionHandling\bin\%1\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll

echo ==================================================
echo Uninstalling Security Instrumentation
echo ==================================================
installutil /u ..\..\..\Security\bin\%1\Microsoft.Practices.EnterpriseLibrary.Security.dll

echo ==================================================
echo Uninstalling Security Cryptography Instrumentation
echo ==================================================
installutil /u ..\..\..\Security\Cryptography\bin\%1\Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.dll

Now playing: 311 - Silver