Using the SDK / API to determine SDL Trados studio version

Hi

How to I get the current version and edition of Studio from a C# plugin running inside Studio?

This post: https://community.sdl.com/developers-more/developers/language-developers/f/57/t/118 talks about stuff that I can't see exists anymore in the SDK.

Many thanks in advance.

Best regards

Ruvan

Parents
  • Hi.  How about this?

    using System;
    using System.Diagnostics;
    using System.IO;
    using System.Reflection;
    using System.Resources;

    public static string Version() { var x86Folderpath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86); const string exeRelativepath = @"SDL\SDL Trados Studio\Studio4\SDLTradosStudio.exe"; var exeFullpath = Path.Combine(x86Folderpath, exeRelativepath); var assembly = Assembly.LoadFrom(exeFullpath); var resourceManager = new ResourceManager("Sdl.TranslationStudio.Application.StringResources", assembly); var version = string.Format(resourceManager.GetString("Version"), $"- {FileVersionInfo.GetVersionInfo(exeFullpath).FileVersion}"); return version; }
  • Hi Hiroshi
    Thanks for this. I was hoping for something more generic, preferably using the API from within C#. It this not possible?

    I mean, if they decided to change the directoy in later versions this would not work very well, and it really does not guarantee that this is the version the user is infact running studio from.
Reply Children