≡ Menu

Automatically Updating TC User Libs on 2-Tier Clients

Share the knowledge

Over at teamcenter.blog.com, Logresh brings up the topic of keeping 2-tier clients up to date. It also came up not to long ago on forums at PLM World. In particular, how do you keep your clients updated with the latest versions of your custom TC User Libs and Jar files for rich client plugins? So, I thought I’d share the solution we came up with at my workplace. I don’t claim it’s the best solution, but it has served our purposes reasonably well.


For our general Users, we maintain one TC_DATA directory on a shared drive to which all of the clients point.


Anything we need to customize on the client, such as our own DLLs, XML files, or JAR files for customizing the rich client, have a master copy on a share drive that is copied to users local machines as needed. We use xcopy to copy the master copy to the user’s machine. Xcopy’s /d switch will only copy files when the destination is missing or is older than the source. That way, the first time users log on xcopy will copy everything they need from the master copy. Every time thereafter, it will only copy files if we’ve updated the master copy or if the user deleted their local copy.

Application Data Directory

Every user on windows has their own Application Data directory which is there for applications to use. The environment variable APPDATA resolves to the current user’s application data directory, which is usually the same as %USERPROFILE%appdata. Simply put, APPDATA is a convenient place to which to copy data that doesn’t require the user to have administrative privileges on their machine. We put our own directory specifically for Teamcenter under APPDATA.


We added a line to the portal.bat file we install on users’ client machines that calls a master batch file on the shared drive that executes the xcopy and makedir commands. By having it split out into a separate file we can update the file at will. It also defines the appropriate Teamcenter environment variables, such as TC_USER_LIB which is the location of our custom DLLs.


Performance is reasonably good on the LAN. The first time users log in it may take a minute to download everything, but thereafter that is skipped and doesn’t add much time to the process.

Remote users coming in over the VPN or from remote sites are a different story, the performance is pretty bad. But 2-tier isn’t recommended for anything over (if I recall correctly) 5 ms latency. Still, I don’t think having to access TC_DATA off of a shared drive helps matters any.

To be honest, we’re planning to go to all 4-tier clients at our next upgrade. Only developers, like me, will use 2-tier clients after that.


That’s it in a nutshell. If you’re trying to administer 2-tier clients I hope that you found something useful. I’d love to hear what other solutions people have come up with.

  • https://twitter.com/uk_dave David Merritt

    I have done something similar to this in the past, except I have kept up with the changes to be copied based on a datestamp and have written the script such that it will download the datestamped changes once, write a log file or registry edit for that change successfully copied, then for future changes it will ignore those already copied datestamp changes.  This way I don’t have to keep downloading all of the changed files every time and only need to download those that have changed since the last download.   Hopefully that makes sense.

    • http://plmdojo.com Scott Pigman

      Hi Dave,
      Maybe I’m missing a nuance but it seems to me that xcopy /d accomplishes the same result more simply. The files are only copied down if they’ve changed since the last login.

      From the documentation,
      xcopy /d[:mm-dd-yyyy] : Copies source files changed on or after the specified date only. If you do not include a mm-dd-yyyy value, xcopy copies all Source files that are newer than existing Destination files. This command-line option allows you to update files that have changed.

      • https://twitter.com/uk_dave David Merritt

        That would be true.  But what happens if you have a change you need to push down to the client that is not simply a file copy i.e. some registry tweak, perhaps a software update that requires an installer etc?  The method I mention accommodates this — a point I failed to mentioned :-)

Optimization WordPress Plugins & Solutions by W3 EDGE