Event system deploy script

Developing event system modules is all in a day’s work for a Tridion professional. Deploying your modules is simple enough, but can get quite tedious. You need to shut down services, stop IIS, copy some DLLs to the Tridion bin folder, install other DLLs in the GAC, start IIS, restart services…

Today I got fed up so I wrote a windows batch script that automates all that. It isn’t earth-shattering, just a little thing that might help save you a few minutes of your precious time.

It works ONLY with Tridion 2013 by the way. On 2011 and before, you need to shutdown the COM+ as well, and that is not so easy to do.

Here is how to build a package for your event system, and deploy it with the script.

Step 1

First build the project in Release mode (for DEV you might want to use DEBUG mode!)

Step 2

Next, create a ‘package folder’. This is simply a folder on your file system that contains one subfolder called ‘gac’ (if you have nothing to install in the GAC, you should leave this out).

Step 3

Download deploy-eventsys and unblock it. Extract the file deploy-eventsys.bat from the zip and copy it to the package folder

Step 4

Copy files from Bin\Release into a (newly created) ‘package folder’:

  • The primary output of your project
    • E.g. My.Events.dll
  • The symbols file for your project (only if you built in Debug mode)
    • E.g. My.Events.pdb

Step 5

If there are files you need to store in the GAC, copy them to the ‘gac’ subfolder.

Step 6

Copy the package to the CM server.

Note: event system modules must be installed on ALL CM servers in an environment. So if there are multiple CM machines, or separate publishers, the package must be installed on all of them.

 

Step 7

Activitate the event system module in the Tridion configuration.

  • Open the file <Tridion Home>\config\Tridion.ContentManager.config in an editor
  • Search for <extensions>
  • Add the following line inside <extensions>:
    <add assemblyFileName=”D:\Tridion\bin\My.Events.dll”/>
  • Save and close the file

 

Step 8

Right-click on deploy-eventsys.bat and choose ‘Run as administrator’. This will shut down all relevant services, copy the DLL files to the Tridion bin folder, install the gac\*.dll files in the GAC and start the services again.

Note

The script assumes you have installed the Microsoft SDKs, which contain a file called gacutil.exe. It is assumed to be located here:

C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools

If you keep a copy of gacutil.exe at a different location, please update the bat file.

Otherwise, the script will tell you to install the DLLs in the GAC manually.

 

 

When you run the deploy-eventsys.bat script, you may get messages like the following (depending on which services are activated on your system):

The following services are dependent on the Tridion Content Manager Service Host service.
Stopping the Tridion Content Manager Service Host service will also stop these services.
Tridion Content Manager Workflow Agent
Do you want to continue this operation? (Y/N) [N]:

 

If this happens, type Y and press enter.

 

That’s it. The event system should now be activated. To check, open the Tridion event log and look for a message similar to this:

TCM Extension initialized: My Event System (My.Events)

 

Files to download